Package org.gephi.timeline.api
Interface TimelineController
-
public interface TimelineControllerControls 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()andstopPlay()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 aTimelineChartaccessible from theTimelineModel.- Author:
- Julian Bilcke, Mathieu Bastian
- See Also:
TimelineModel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(TimelineModelListener listener)Addlistenerto the list of event listerners.String[]getDynamicGraphColumns()Returns all the possible dynamic attribute columns.TimelineModelgetModel()Get the current model from the current workspaceTimelineModelgetModel(Workspace workspace)Returns the timeline model fromworkspace.voidremoveListener(TimelineModelListener listener)Removelisternerfrom the list of event listeners.voidselectColumn(String column)Select a column to make aTimelineChartof it.voidsetCustomBounds(double min, double max)Sets the timeline custom bounds.voidsetEnabled(boolean enabled)Sets the timeline enable status.voidsetInterval(double from, double to)Sets the current timeline interval.voidsetPlayMode(TimelineModel.PlayMode playMode)Sets the play mode.voidsetPlaySpeed(int delay)Sets the play delay in milliseconds.voidsetPlayStep(double step)Sets the play step.voidsetTimeFormat(TimeFormat timeFormat)voidstartPlay()Starts the timeline animation using the current delay, step size and play mode.voidstopPlay()Stops the timeline animation.
-
-
-
Method Detail
-
getModel
TimelineModel getModel(Workspace workspace)
Returns the timeline model fromworkspace.- 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
nullif 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 boundmax- the upper bound- Throws:
IllegalArgumentException- ifminis superior or equal thanmaxor 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 theDynamicModeland defines the interval the graph is filtered with.- Parameters:
from- the lower boundto- the upper bound- Throws:
IllegalArgumentException- ifminis superior or equal thanmaxor 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 aTimelineChartof it. The column must be member of the graph table.- Parameters:
column- the column to select- Throws:
IllegalArgumentException- ifcolumnis not a graph column
-
addListener
void addListener(TimelineModelListener listener)
Addlistenerto the list of event listerners.- Parameters:
listener- the listener to add
-
removeListener
void removeListener(TimelineModelListener listener)
Removelisternerfrom the list of event listeners.- Parameters:
listener- the listener to remove
-
-