|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.activity.Activity prefuse.action.Action
public abstract class Action
Actions are building blocks that perform any number of operations on a
Visualization, typically processing VisualItems to set various visual
attributes. This class is a base implementation for Action instances.
Developers can subclass this class and implement the run
method
to create their own custom Actions.
After instantiating an Action, you should register it with a particular
Visualization before running it. Use the
Visualization.putAction(String, Action)
to do this. This
will ensure that the Action is configured to use that Visualization. If
an Action is part of an ActionList
or ActionSwitch
, it is
sufficient to only register that CompositeAction with the Visualization
-- all contained Action instances will be configured appropriately. You
can then run the Actions using the Visualization.run(String)
method and other similar methods of the Visualization
class.
As a subclass of Activity, Actions can be of two kinds. Run-once action lists have a duration value of zero, and simply run once when scheduled. Actions with a duration greater than zero can be executed multiple times, waiting a specified step time between each execution until the activity has run for its full duration. A duration of Activity.INFINITE will result in a continually re-running Action.
Field Summary | |
---|---|
protected Visualization |
m_vis
A reference to the visualization processed by this Action. |
Fields inherited from class prefuse.activity.Activity |
---|
DEFAULT_STEP_TIME, INFINITY |
Constructor Summary | |
---|---|
Action()
Creates an action instance with zero duration. |
|
Action(long duration)
Create a new Action with a specified duration. |
|
Action(long duration,
long stepTime)
Create a new Action with a specified duration and step time. |
|
Action(Visualization vis)
Create a new Action with a specified Visualization and zero duration. |
|
Action(Visualization vis,
long duration)
Create a new Action with a specified Visualization and duration. |
|
Action(Visualization vis,
long duration,
long stepTime)
Create a new Action with a specified Visualization, duration and step time. |
Method Summary | |
---|---|
Visualization |
getVisualization()
Return the Visualization processed by this Action. |
abstract void |
run(double frac)
Runs this Action, triggering whatever processing this Action performs. |
protected void |
run(long elapsedTime)
Runs this Action (as an Activity). |
void |
setVisualization(Visualization vis)
Set the Visualization processed by this Action. |
Methods inherited from class prefuse.activity.Activity |
---|
addActivityListener, alwaysRunAfter, cancel, fireActivityCancelled, fireActivityFinished, fireActivityScheduled, fireActivityStarted, fireActivityStepped, getDuration, getNextTime, getPace, getPacingFunction, getStartTime, getStepTime, getStopTime, isEnabled, isRunning, isScheduled, removeActivityListener, run, runAfter, runAt, setDuration, setEnabled, setPacingFunction, setStartTime, setStepTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Visualization m_vis
Constructor Detail |
---|
public Action()
public Action(long duration)
duration
- the Action duration in millisecondspublic Action(long duration, long stepTime)
duration
- the Action duration in millisecondsstepTime
- the time to wait between invocation of the Actionpublic Action(Visualization vis)
vis
- the Visualization this Action should process. If this
Action is registered with another Visualization, this value will
be overwritten.public Action(Visualization vis, long duration)
vis
- the Visualization this Action should process. If this
Action is registered with another Visualization, this value will
be overwritten.duration
- the Action duration in millisecondspublic Action(Visualization vis, long duration, long stepTime)
vis
- the Visualization this Action should process. If this
Action is registered with another Visualization, this value will
be overwritten.duration
- the Action duration in millisecondsstepTime
- the time to wait between invocation of the ActionMethod Detail |
---|
public abstract void run(double frac)
frac
- the fraction of this Action's duration that has elapsed.protected void run(long elapsedTime)
run
in class Activity
elapsedTime
- the time elapsed since the start of the activity.Activity.run(long)
public Visualization getVisualization()
Visualization
instance.public void setVisualization(Visualization vis)
vis
- the Visualization
to process.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |