Package org.gephi.timeline.api
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()
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 aTimelineChart
accessible from theTimelineModel
.- Author:
- Julian Bilcke, Mathieu Bastian
- See Also:
TimelineModel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(TimelineModelListener listener)
Addlistener
to the list of event listerners.String[]
getDynamicGraphColumns()
Returns all the possible dynamic attribute columns.TimelineModel
getModel()
Get the current model from the current workspaceTimelineModel
getModel(Workspace workspace)
Returns the timeline model fromworkspace
.void
removeListener(TimelineModelListener listener)
Removelisterner
from the list of event listeners.void
selectColumn(String column)
Select a column to make aTimelineChart
of it.void
setCustomBounds(double min, double max)
Sets the timeline custom bounds.void
setEnabled(boolean enabled)
Sets the timeline enable status.void
setInterval(double from, double to)
Sets the current timeline interval.void
setPlayMode(TimelineModel.PlayMode playMode)
Sets the play mode.void
setPlaySpeed(int delay)
Sets the play delay in milliseconds.void
setPlayStep(double step)
Sets the play step.void
setTimeFormat(TimeFormat timeFormat)
void
startPlay()
Starts the timeline animation using the current delay, step size and play mode.void
stopPlay()
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
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 boundmax
- the upper bound- Throws:
IllegalArgumentException
- ifmin
is superior or equal thanmax
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 theDynamicModel
and defines the interval the graph is filtered with.- Parameters:
from
- the lower boundto
- the upper bound- Throws:
IllegalArgumentException
- ifmin
is superior or equal thanmax
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 aTimelineChart
of it. The column must be member of the graph table.- Parameters:
column
- the column to select- Throws:
IllegalArgumentException
- ifcolumn
is not a graph column
-
addListener
void addListener(TimelineModelListener listener)
Addlistener
to the list of event listerners.- Parameters:
listener
- the listener to add
-
removeListener
void removeListener(TimelineModelListener listener)
Removelisterner
from the list of event listeners.- Parameters:
listener
- the listener to remove
-
-