Package qupath.lib.plugins.workflow
Class Workflow
java.lang.Object
qupath.lib.plugins.workflow.Workflow
- All Implemented Interfaces:
Externalizable,Serializable
A collection of steps that relate to how an image has been - or should be - processed.
This can also be used to implement a 'command history'.
Where the WorkflowSteps contained in the Workflow are scriptable, then a script can be created automatically.
- Author:
- Pete Bankhead
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStep(WorkflowStep step) Append a new step to the end of the workflow, firing an update event.voidaddSteps(Collection<WorkflowStep> steps) Append multiple steps to the end of the workflow, firing a single update event.voidaddWorkflowListener(WorkflowListener listener) Add a listener for changes to the workflow.voidclear()Remove all steps, firing an update event if the workflow was not previously empty.Generate a script from the current workflow steps.protected voidGet the last WorkflowStep in the workflow, or null if no steps are available.getSteps()Get an unmodifiable list of the steps.booleanisEmpty()Returns true if the workflow does not contain any steps.voidvoidremoveStep(int ind) Remove a single step, identified by its list index.voidremoveStep(WorkflowStep step) Remove a single step, firing an update event if the step was successfully removed.voidremoveSteps(Collection<WorkflowStep> steps) Remove a collection of steps, firing an update event if the workflow was changed.voidremoveWorkflowListener(WorkflowListener listener) Remove a listener for changes to the workflow.voidreplaceLastStep(WorkflowStep step) Replace the most recently added step with this one.intsize()Total number of steps in the workflow.void
-
Constructor Details
-
Workflow
public Workflow()
-
-
Method Details
-
getSteps
Get an unmodifiable list of the steps.- Returns:
-
getLastStep
Get the last WorkflowStep in the workflow, or null if no steps are available.- Returns:
-
addStep
Append a new step to the end of the workflow, firing an update event.- Parameters:
step-
-
addSteps
Append multiple steps to the end of the workflow, firing a single update event.- Parameters:
steps-
-
removeStep
public void removeStep(int ind) Remove a single step, identified by its list index.- Parameters:
ind-
-
removeStep
Remove a single step, firing an update event if the step was successfully removed.- Parameters:
step-
-
removeSteps
Remove a collection of steps, firing an update event if the workflow was changed.- Parameters:
steps-
-
replaceLastStep
Replace the most recently added step with this one.- Parameters:
step-
-
size
public int size()Total number of steps in the workflow.- Returns:
-
isEmpty
public boolean isEmpty()Returns true if the workflow does not contain any steps.- Returns:
-
clear
public void clear()Remove all steps, firing an update event if the workflow was not previously empty. -
fireWorkflowUpdatedEvent
protected void fireWorkflowUpdatedEvent() -
addWorkflowListener
Add a listener for changes to the workflow.- Parameters:
listener-
-
removeWorkflowListener
Remove a listener for changes to the workflow.- Parameters:
listener-
-
createScript
Generate a script from the current workflow steps.- Returns:
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-