Class Workflow

java.lang.Object
qupath.lib.plugins.workflow.Workflow
All Implemented Interfaces:
Externalizable, Serializable

public class Workflow extends Object implements Externalizable
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 Details

    • Workflow

      public Workflow()
  • Method Details

    • getSteps

      public List<WorkflowStep> getSteps()
      Get an unmodifiable list of the steps.
      Returns:
    • getLastStep

      public WorkflowStep getLastStep()
      Get the last WorkflowStep in the workflow, or null if no steps are available.
      Returns:
    • addStep

      public void addStep(WorkflowStep step)
      Append a new step to the end of the workflow, firing an update event.
      Parameters:
      step -
    • addSteps

      public void addSteps(Collection<WorkflowStep> steps)
      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

      public void removeStep(WorkflowStep step)
      Remove a single step, firing an update event if the step was successfully removed.
      Parameters:
      step -
    • removeSteps

      public void removeSteps(Collection<WorkflowStep> steps)
      Remove a collection of steps, firing an update event if the workflow was changed.
      Parameters:
      steps -
    • replaceLastStep

      public void replaceLastStep(WorkflowStep step)
      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

      public void addWorkflowListener(WorkflowListener listener)
      Add a listener for changes to the workflow.
      Parameters:
      listener -
    • removeWorkflowListener

      public void removeWorkflowListener(WorkflowListener listener)
      Remove a listener for changes to the workflow.
      Parameters:
      listener -
    • createScript

      public String createScript()
      Generate a script from the current workflow steps.
      Returns:
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException