Package jisa.experiment.queue
Class SimpleAction
- java.lang.Object
-
- jisa.experiment.queue.AbstractAction<java.lang.Void>
-
- jisa.experiment.queue.SimpleAction
-
- All Implemented Interfaces:
java.io.Serializable
,Action<java.lang.Void>
- Direct Known Subclasses:
MeasurementSubAction
public class SimpleAction extends AbstractAction<java.lang.Void>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jisa.experiment.queue.Action
Action.Status
-
-
Constructor Summary
Constructors Constructor Description SimpleAction(java.lang.String name, SRunnable action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleAction
copy()
Creates a deep copy of this action.java.util.List<Action>
getChildren()
Returns an unmodifiable list of sub-actions that this action contains.java.lang.Void
getData()
Returns whatever data this action generates.SimpleActionDisplay
getDisplay()
Returns the JavaFX node used to display this action in an ActionQueueDisplay object.java.lang.Exception
getError()
Returns the exception that caused the the action to result in failure.boolean
isRunning()
Returns whether the action is currently running or not.void
reset()
Resets the action to the state it was in before being run.void
skip()
Marks the action to be skipped next time it is run, or immediately if it is currently running.void
start()
Runs the action.void
stop()
Interrupts and stops the action.-
Methods inherited from class jisa.experiment.queue.AbstractAction
addAttributeListener, addChildrenListener, addNameListener, addStatusListener, addTag, childrenChanged, clearTags, copyBasicParametersTo, getAttribute, getAttributes, getName, getStatus, getStatusListeners, getTags, hasAttribute, isCritical, onFinish, onStart, removeAttribute, removeListener, removeTag, setAttribute, setCritical, setName, setOnEdit, setOnFinish, setOnStart, setStatus, userEdit
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jisa.experiment.queue.Action
addListener, getAttributeString, getAttributeString, resume
-
-
-
-
Constructor Detail
-
SimpleAction
public SimpleAction(java.lang.String name, SRunnable action)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:Action
Resets the action to the state it was in before being run.- Specified by:
reset
in interfaceAction<java.lang.Void>
- Specified by:
reset
in classAbstractAction<java.lang.Void>
-
start
public void start()
Description copied from interface:Action
Runs the action. Should only return once the action is complete/interrupted/failed.- Specified by:
start
in interfaceAction<java.lang.Void>
- Specified by:
start
in classAbstractAction<java.lang.Void>
-
stop
public void stop()
Description copied from interface:Action
Interrupts and stops the action.- Specified by:
stop
in interfaceAction<java.lang.Void>
- Specified by:
stop
in classAbstractAction<java.lang.Void>
-
skip
public void skip()
Description copied from interface:Action
Marks the action to be skipped next time it is run, or immediately if it is currently running.- Specified by:
skip
in interfaceAction<java.lang.Void>
- Specified by:
skip
in classAbstractAction<java.lang.Void>
-
getError
public java.lang.Exception getError()
Description copied from interface:Action
Returns the exception that caused the the action to result in failure.- Returns:
- Exception
-
isRunning
public boolean isRunning()
Description copied from interface:Action
Returns whether the action is currently running or not.- Specified by:
isRunning
in interfaceAction<java.lang.Void>
- Specified by:
isRunning
in classAbstractAction<java.lang.Void>
- Returns:
- Is it running?
-
getData
public java.lang.Void getData()
Description copied from interface:Action
Returns whatever data this action generates.- Specified by:
getData
in interfaceAction<java.lang.Void>
- Specified by:
getData
in classAbstractAction<java.lang.Void>
- Returns:
- Generated data
-
getChildren
public java.util.List<Action> getChildren()
Description copied from interface:Action
Returns an unmodifiable list of sub-actions that this action contains. The exact meaning of a sub-action and how it relates to the running of this action depends on the type of action this is.- Specified by:
getChildren
in interfaceAction<java.lang.Void>
- Specified by:
getChildren
in classAbstractAction<java.lang.Void>
- Returns:
- List of sub-actions
-
getDisplay
public SimpleActionDisplay getDisplay()
Description copied from interface:Action
Returns the JavaFX node used to display this action in an ActionQueueDisplay object.- Returns:
- Node
-
copy
public SimpleAction copy()
Description copied from interface:Action
Creates a deep copy of this action.- Returns:
- Deep copy of this action
-
-