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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStep
(WorkflowStep step) Append a new step to the end of the workflow, firing an update event.void
addSteps
(Collection<WorkflowStep> steps) Append multiple steps to the end of the workflow, firing a single update event.void
addWorkflowListener
(WorkflowListener listener) Add a listener for changes to the workflow.void
clear()
Remove all steps, firing an update event if the workflow was not previously empty.Generate a script from the current workflow steps.protected void
Get the last WorkflowStep in the workflow, or null if no steps are available.getSteps()
Get an unmodifiable list of the steps.boolean
isEmpty()
Returns true if the workflow does not contain any steps.void
void
removeStep
(int ind) Remove a single step, identified by its list index.void
removeStep
(WorkflowStep step) Remove a single step, firing an update event if the step was successfully removed.void
removeSteps
(Collection<WorkflowStep> steps) Remove a collection of steps, firing an update event if the workflow was changed.void
removeWorkflowListener
(WorkflowListener listener) Remove a listener for changes to the workflow.void
replaceLastStep
(WorkflowStep step) Replace the most recently added step with this one.int
size()
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:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-