public class ActionSwitch extends CompositeAction
m_actions
DEFAULT_STEP_TIME, INFINITY
Constructor and Description |
---|
ActionSwitch()
Creates an empty action switch.
|
ActionSwitch(Action[] acts,
int switchVal)
Creates a new ActionSwitch with the given actions and switch value.
|
Modifier and Type | Method and Description |
---|---|
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.
|
add, add, get, remove, remove, setVisualization, size
getVisualization, run
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
public ActionSwitch()
public ActionSwitch(Action[] acts, int switchVal)
acts
- the Actions to include in this switchswitchVal
- the switch value indicating which Action to runpublic void run(double frac)
Action
run
in class Action
frac
- the fraction of this Action's duration that has elapsed.Action.run(double)
public int getSwitchValue()
public void setSwitchValue(int s)
s
- the new switch valueCopyright ? 2013 Regents of the University of California