prefuse.action
Class ActionSwitch

java.lang.Object
  extended by prefuse.activity.Activity
      extended by prefuse.action.Action
          extended by prefuse.action.CompositeAction
              extended by prefuse.action.ActionSwitch

public class ActionSwitch
extends CompositeAction

The ActionSwitch selects between a set of Actions, allowing only one of a group of Actions to be executed at a time.

Version:
1.0
Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.action.CompositeAction
m_actions
 
Fields inherited from class prefuse.action.Action
m_vis
 
Fields inherited from class prefuse.activity.Activity
DEFAULT_STEP_TIME, INFINITY
 
Constructor Summary
ActionSwitch()
          Creates an empty action switch.
ActionSwitch(Action[] acts, int switchVal)
          Creates a new ActionSwitch with the given actions and switch value.
 
Method Summary
 int getSwitchValue()
          Returns the current switch value, indicating the index of the Action that will be executed in reponse to run() invocations.
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
 void setSwitchValue(int s)
          Set the switch value.
 
Methods inherited from class prefuse.action.CompositeAction
add, add, get, remove, remove, setVisualization, size
 
Methods inherited from class prefuse.action.Action
getVisualization, run
 
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
 

Constructor Detail

ActionSwitch

public ActionSwitch()
Creates an empty action switch.


ActionSwitch

public ActionSwitch(Action[] acts,
                    int switchVal)
Creates a new ActionSwitch with the given actions and switch value.

Parameters:
acts - the Actions to include in this switch
switchVal - the switch value indicating which Action to run
Method Detail

run

public void run(double frac)
Description copied from class: Action
Runs this Action, triggering whatever processing this Action performs. Subclass this method to create custom Actions.

Specified by:
run in class Action
Parameters:
frac - the fraction of this Action's duration that has elapsed.
See Also:
Action.run(double)

getSwitchValue

public int getSwitchValue()
Returns the current switch value, indicating the index of the Action that will be executed in reponse to run() invocations.

Returns:
the switch value

setSwitchValue

public void setSwitchValue(int s)
Set the switch value. This is the index of the Action that will be executed in response to run() invocations.

Parameters:
s - the new switch value


Copyright © 2007 Regents of the University of California