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 FlowRunner
m_FlowRunner
for executing the flow.protected Actor
m_LastActor
the last actor that was run.protected FlowSetup
m_Setup
the 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 void
cleanUp()
Cleans up data structures, frees up memory.protected Object
doInBackground()
Runs the flow in the background.protected void
done()
After executing the flow.Actor
getLastActor()
Returns the actor that was executed.FlowSetup
getSetup()
Returns the underlying flow setup.boolean
isPaused()
Returns whether the object is currently paused.void
pauseExecution()
Pauses the execution.void
resumeExecution()
Resumes the execution.void
stopExecution()
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:
doInBackground
in classSwingWorker
- Returns:
- the last error or null if none
- Throws:
Exception
- if something goes wrong
-
done
protected void done()
After executing the flow.- Overrides:
done
in classSwingWorker
-
pauseExecution
public void pauseExecution()
Pauses the execution.- Specified by:
pauseExecution
in interfacePausable
-
isPaused
public boolean isPaused()
Returns whether the object is currently paused.
-
resumeExecution
public void resumeExecution()
Resumes the execution.- Specified by:
resumeExecution
in interfacePausable
-
stopExecution
public void stopExecution()
Stops the flow execution.- Specified by:
stopExecution
in interfaceStoppable
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
-
-