Package pamViewFX.pamTask
Class PamTaskUpdate
java.lang.Object
pamViewFX.pamTask.PamTaskUpdate
- Direct Known Subclasses:
BinaryMapMakeProgress
,CreateMapInfo
,DatagramProgress
,FileMapProgress
,LoadQueueProgressData
,SimplePamTaskUpdate
Class for passing information from loading tasks to the FX GUI.
- Author:
- Jamie Macaulay
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Analysing filesstatic final int
Currently counting filesstatic final int
static final int
The task has completed successfullystatic final int
The task has completed but an error was flagged.static final int
The loading of data is idlestatic final int
static final int
Sorting something, e.g. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getName()
Get the name of the load thread.abstract double
Get the progress of the load thread.double
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.Returns a message indicating progress.If two updates are available then this is used to return the fine progress update message.int
boolean
There may be two progress updates, one overall progress and then a finer scale progress.void
setDualProgressUpdate
(boolean twoProgUpdate) Set if there should be two progress updates, one overall progress and then a finer scale progress.void
setStatus
(int status) Set the status of the thread.
-
Field Details
-
STATUS_IDLE
public static final int STATUS_IDLEThe loading of data is idle- See Also:
-
STATUS_COUNTING_FILES
public static final int STATUS_COUNTING_FILESCurrently counting files- See Also:
-
STATUS_ANALYSING_FILES
public static final int STATUS_ANALYSING_FILESAnalysing files- See Also:
-
STATUS_SORTING
public static final int STATUS_SORTINGSorting 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_DONEThe task has completed successfully- See Also:
-
STATUS_DONE_ERROR
public static final int STATUS_DONE_ERRORThe 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
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 thenNote 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
Returns a message indicating progress. Can be overriden to supply other messages.- Returns:
-
getProgressString2
If two updates are available then this is used to return the fine progress update message.- Returns:
-