Class PamTaskUpdate

java.lang.Object
pamViewFX.pamTask.PamTaskUpdate
Direct Known Subclasses:
BinaryMapMakeProgress, CreateMapInfo, DatagramProgress, FileMapProgress, LoadQueueProgressData, SimplePamTaskUpdate

public abstract class PamTaskUpdate extends Object
Class for passing information from loading tasks to the FX GUI.
Author:
Jamie Macaulay
  • Field Details

    • STATUS_IDLE

      public static final int STATUS_IDLE
      The loading of data is idle
      See Also:
    • STATUS_COUNTING_FILES

      public static final int STATUS_COUNTING_FILES
      Currently counting files
      See Also:
    • STATUS_ANALYSING_FILES

      public static final int STATUS_ANALYSING_FILES
      Analysing files
      See Also:
    • STATUS_SORTING

      public static final int STATUS_SORTING
      Sorting something, e.g. file list
      See Also:
    • STATUS_SERIALIZING

      public static final int STATUS_SERIALIZING
      See Also:
    • STATUS_DESERIALIZING

      public static final int STATUS_DESERIALIZING
      See Also:
    • STATUS_DONE

      public static final int STATUS_DONE
      The task has completed successfully
      See Also:
    • STATUS_DONE_ERROR

      public static final int STATUS_DONE_ERROR
      The task has completed but an error was flagged. It is possible that the task did not complete successfully.
      See Also:
  • Constructor Details

    • PamTaskUpdate

      public PamTaskUpdate()
  • Method Details

    • getName

      public abstract String getName()
      Get the name of the load thread. Note the name is also the unique identifier for the running thread so cannot be the same between two different threads.
      Returns:
      the name of the thread.
    • getProgress

      public abstract double getProgress()
      Get the progress of the load thread. This is a value between 0 and 1 were 1 is equivalent to 100% or the thread having finished.

      Note that ProgressIndicator.INTERMEDIATE can be used as an update value to set progress to intermediate.

      Returns:
      the progress of the thread, between 0 and 1.
    • getProgress2

      public double getProgress2()
      There may be a need for two progress bars for long task- one showing overall progress and the other showing more fine scale loading tasks. If this is the case then

      Note that ProgressIndicator.INTERMEDIATE can be used as an update value to set progress to intermediate.

      Returns:
      the progress of the thread, between 0 and 1.
    • getStatus

      public int getStatus()
      Returns:
      the status
    • setStatus

      public void setStatus(int status)
      Set the status of the thread. This can either a generic status from the abstract class or a custom status.
      Parameters:
      status - flag to set.
    • isDualProgressUpdate

      public boolean isDualProgressUpdate()
      There may be two progress updates, one overall progress and then a finer scale progress.
      Returns:
      true if two progress updates.
    • setDualProgressUpdate

      public void setDualProgressUpdate(boolean twoProgUpdate)
      Set if there should be two progress updates, one overall progress and then a finer scale progress.
      Parameters:
      true - if two progress updates.
    • getProgressString

      public String getProgressString()
      Returns a message indicating progress. Can be overriden to supply other messages.
      Returns:
    • getProgressString2

      public String getProgressString2()
      If two updates are available then this is used to return the fine progress update message.
      Returns: