Package adams.flow.setup
Class FlowSetupWorker
- java.lang.Object
-
- javax.swing.SwingWorker
-
- adams.flow.setup.FlowSetupWorker
-
- All Implemented Interfaces:
CleanUpHandler,Pausable,Stoppable,Runnable,Future,RunnableFuture
public class FlowSetupWorker extends SwingWorker implements CleanUpHandler, Stoppable, Pausable
A specialized SwingWorker class for executing FlowSetups.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
-
-
Field Summary
Fields Modifier and Type Field Description protected FlowRunnerm_FlowRunnerfor executing the flow.protected Actorm_LastActorthe last actor that was run.protected FlowSetupm_Setupthe underlying flowsetup.
-
Constructor Summary
Constructors Constructor Description FlowSetupWorker(FlowSetup setup)Initializes the worker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.protected ObjectdoInBackground()Runs the flow in the background.protected voiddone()After executing the flow.ActorgetLastActor()Returns the actor that was executed.FlowSetupgetSetup()Returns the underlying flow setup.booleanisPaused()Returns whether the object is currently paused.voidpauseExecution()Pauses the execution.voidresumeExecution()Resumes the execution.voidstopExecution()Stops the flow execution.-
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
-
-
-
-
Field Detail
-
m_Setup
protected FlowSetup m_Setup
the underlying flowsetup.
-
m_FlowRunner
protected FlowRunner m_FlowRunner
for executing the flow.
-
m_LastActor
protected Actor m_LastActor
the last actor that was run.
-
-
Constructor Detail
-
FlowSetupWorker
public FlowSetupWorker(FlowSetup setup)
Initializes the worker.- Parameters:
setup- the underlying flowsetup
-
-
Method Detail
-
getSetup
public FlowSetup getSetup()
Returns the underlying flow setup.- Returns:
- the setup
-
getLastActor
public Actor getLastActor()
Returns the actor that was executed.- Returns:
- the actor
-
doInBackground
protected Object doInBackground() throws Exception
Runs the flow in the background.- Specified by:
doInBackgroundin classSwingWorker- Returns:
- the last error or null if none
- Throws:
Exception- if something goes wrong
-
done
protected void done()
After executing the flow.- Overrides:
donein classSwingWorker
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecutionin interfacePausable
-
isPaused
public boolean isPaused()
Returns whether the object is currently paused.
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecutionin interfacePausable
-
stopExecution
public void stopExecution()
Stops the flow execution.- Specified by:
stopExecutionin interfaceStoppable
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler
-
-