Interface TimelineController


  • public interface TimelineController
    Controls the timeline bounds and animation features.

    By default the timeline is disabled and can be enabled with the setEnabled() method. Once enabled, the controller is setting its interval value to the DynamicModel.

    The interval can be animated using the startPlay() and stopPlay() methods. Configuration parameters are also available.

    This controller also allows to lookup graph attribute columns that can be used as sparklines (e.g. node count, average degree...). Use the selectColumn() to create a TimelineChart accessible from the TimelineModel.

    Author:
    Julian Bilcke, Mathieu Bastian
    See Also:
    TimelineModel
    • Method Detail

      • getModel

        TimelineModel getModel​(Workspace workspace)
        Returns the timeline model from workspace.
        Parameters:
        workspace - the workspace to get the model from
        Returns:
        the timeline model for this workspace
      • getModel

        TimelineModel getModel()
        Get the current model from the current workspace
        Returns:
        the current model, or null if no active workspace
      • setCustomBounds

        void setCustomBounds​(double min,
                             double max)
        Sets the timeline custom bounds. Custom bounds still need to be included in the min and max bound of the time scale. The timeline will resize accordingly.
        Parameters:
        min - the lower bound
        max - the upper bound
        Throws:
        IllegalArgumentException - if min is superior or equal than max or out of bounds
      • setEnabled

        void setEnabled​(boolean enabled)
        Sets the timeline enable status.
        Parameters:
        enabled - the enabled value to set
      • setInterval

        void setInterval​(double from,
                         double to)
        Sets the current timeline interval. This is propagated to the DynamicModel and defines the interval the graph is filtered with.
        Parameters:
        from - the lower bound
        to - the upper bound
        Throws:
        IllegalArgumentException - if min is superior or equal than max or out of bounds
      • setTimeFormat

        void setTimeFormat​(TimeFormat timeFormat)
      • startPlay

        void startPlay()
        Starts the timeline animation using the current delay, step size and play mode.
      • stopPlay

        void stopPlay()
        Stops the timeline animation.
      • setPlaySpeed

        void setPlaySpeed​(int delay)
        Sets the play delay in milliseconds. Defines the time between each interval shift.
        Parameters:
        delay - the delay in milliseconds
      • setPlayStep

        void setPlayStep​(double step)
        Sets the play step. Defines how much the interval is moved at each step during animation. Defined in percentage of the total interval.
        Parameters:
        step - the step, between 0 and 1
      • setPlayMode

        void setPlayMode​(TimelineModel.PlayMode playMode)
        Sets the play mode. This defines how the interval is moved.
        Parameters:
        playMode - the play mode
      • getDynamicGraphColumns

        String[] getDynamicGraphColumns()
        Returns all the possible dynamic attribute columns. This is essentially all number-based dynamic columns defined in the graph table.
        Returns:
        all dynamic number columns in the graph table
      • selectColumn

        void selectColumn​(String column)
        Select a column to make a TimelineChart of it. The column must be member of the graph table.
        Parameters:
        column - the column to select
        Throws:
        IllegalArgumentException - if column is not a graph column
      • addListener

        void addListener​(TimelineModelListener listener)
        Add listener to the list of event listerners.
        Parameters:
        listener - the listener to add
      • removeListener

        void removeListener​(TimelineModelListener listener)
        Remove listerner from the list of event listeners.
        Parameters:
        listener - the listener to remove