Package snap.util

Class TaskMonitor

All Implemented Interfaces:
PropChange.DoChange
Direct Known Subclasses:
TaskMonitorPanel

public class TaskMonitor extends PropObject
Interface for tracking the progress of arbitrary tasks.
  • Field Details

  • Constructor Details

    • TaskMonitor

      public TaskMonitor()
      Constructor.
    • TaskMonitor

      public TaskMonitor(String aTitle)
      Constructor for given title.
    • TaskMonitor

      public TaskMonitor(PrintStream aPrintStream)
      Constructor for given writer.
  • Method Details

    • getTitle

      public String getTitle()
      Returns a string to describe task.
    • setTitle

      public void setTitle(String aValue)
      Sets a string to describe task.
    • getTasksTotal

      public int getTasksTotal()
      Returns the total number of tasks.
    • setTasksTotal

      protected void setTasksTotal(int aValue)
      Sets the total number of tasks.
    • getTasksDone

      public int getTasksDone()
      Returns the number of tasks done.
    • setTasksDone

      protected void setTasksDone(int aValue)
      Sets the number of tasks done.
    • getTaskTotal

      public int getTaskTotal()
      Returns the total number of task work units.
    • setTaskTotal

      protected void setTaskTotal(int aValue)
      Sets the total number of task work units.
    • getTaskDone

      public int getTaskDone()
      Returns the number of task work units completed.
    • setTaskDone

      protected void setTaskDone(int aValue)
      Sets the number of task work units completed.
    • getTaskTitle

      public String getTaskTitle()
      Returns the current task title.
    • setTaskTitle

      protected void setTaskTitle(String aString)
      Sets the current task title.
    • startTasks

      public void startTasks(int aTaskCount)
      Advise the monitor of the total number of subtasks (invoke only once).
    • beginTask

      public void beginTask(String aTitle, int theTotalWork)
      Begin processing a single task.
    • updateTask

      public void updateTask(int theWorkDone)
      Denote that some work units have been completed.
    • endTask

      public void endTask()
      Finish the current task, so the next can begin.
    • isCancelled

      public boolean isCancelled()
      Returns whether the user asked the process to stop working.
    • setCancelled

      public void setCancelled(boolean aValue)
      Sets whether the user asked the process to stop working.
    • isFinished

      public boolean isFinished()
      Returns whether monitor has finished.
    • setFinished

      public void setFinished(boolean aValue)
      Sets whether monitor has finished.
    • getMonitor

      public TaskMonitor getMonitor()
      Returns the next monitor in chain (if this monitor is linked to another).
    • setMonitor

      public void setMonitor(TaskMonitor sourceMonitor)
      Sets the next monitor in chain (if this monitor is linked to another).
    • getTaskProgress

      public double getTaskProgress()
      Returns the task progress.
    • showProgressPanel

      public TaskMonitorPanel showProgressPanel(View aView)
      Creates a monitor panel to show progress.
    • monitorDidChange

      protected void monitorDidChange(PropChange aPC)
      Called when source monitor changes.
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to support props for this class.
      Overrides:
      initProps in class PropObject
    • getPropValue

      public Object getPropValue(String aPropName)
      Override to support props for this class.
      Overrides:
      getPropValue in class PropObject
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override to support props for this class.
      Overrides:
      setPropValue in class PropObject