Class FWProgressTask
java.lang.Object
net.simplace.pipe.progress.FWProgressTask
- All Implemented Interfaces:
Comparable<FWProgressTask>
A task that is displayed in the progress view (
FWProgressViewPanel), usually one step of a pipeline
(see progressid of a processor). It has a text label, optionally an image shown at a fixed position
(progress_x/progress_y), a state (see FWProgressTask.State), a percentage and a message. A
progress id with a parameter token is replaced from the parameters when the task starts.- Author:
- Andreas Enders, Sebastian Brocks, Martin Schmitz
Changes:
- MS-01, 11.05.2009 (Martin Schmitz)
Tries to avoid memory incriminating object references. Instead of holding the whole Observable, on store its ID (for which the Observable is needed at all).
- MS-01, 11.05.2009 (Martin Schmitz)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintget the imagelabel for this taskintintget the textlabel for this task may benullif this task doesn't need a textual descriptionbooleanvoidsetFixedLabel(String aFixedLabel) Sets a fixed label text (instead of the localised progress id) and updates the labels.voidsetMessage(String aMessage) voidsetNumberInRange(int aNumberInRange) Sets the number of the task in the range of tasks to be performed.voidsetStateOfTask(String aStatusOfTask, net.simplace.core.FWObservable aParameterMap) Sets the state of the task and clears the message.voidsetStateProgressing(int aPercentDone, String aMessage) Sets the state to progressing.toString()
-
Constructor Details
-
FWProgressTask
- Parameters:
aProgressID- progress id, also used as localisation key of the label and as image nameaX- x position of the image in the progress image panel, ornullfor no imageaY- y position of the image in the progress image panel, ornullfor no imageaSystemID- id of the system (selects the locale bundle), ornull
-
-
Method Details
-
getTextLabel
get the textlabel for this task may benullif this task doesn't need a textual description- Returns:
- the
JLabel
-
getImageLabel
-
getProgressID
- Returns:
- the progress id
-
isImageUsed
public boolean isImageUsed()- Returns:
trueif the task has an image label
-
getMessage
- Returns:
- the message of the task; if none is set, the localised text for the current state
(
${_PERCENT_DONE_}replaced while progressing)
-
setMessage
- Parameters:
aMessage- the message to show
-
setFixedLabel
Sets a fixed label text (instead of the localised progress id) and updates the labels.- Parameters:
aFixedLabel- the label text
-
setStateProgressing
Sets the state to progressing. Values outside 0-100 are clamped. A value of 0 keeps the current percentage (callers pass 0 to update only the message).- Parameters:
aPercentDone- progress in percent (0-100), 0 to keep the current percentageaMessage- message to show
-
getPercentDone
public int getPercentDone()- Returns:
- the percentDone (0-100)
-
getNumberInRange
public int getNumberInRange()- Returns:
- the number of the Task in the range of Tasks to be performed
-
setNumberInRange
public void setNumberInRange(int aNumberInRange) Sets the number of the task in the range of tasks to be performed.- Parameters:
aNumberInRange- position of the task (used for sorting)
-
getStateOfTask
- Returns:
- the state of the task, one of the constants in
FWProgressTask.State
-
setStateOfTask
Sets the state of the task and clears the message. Parameter tokens in the progress id (or in the label text) are replaced from the parameters; on start the labels are recreated, on success the percentage is set to 100.- Parameters:
aStatusOfTask- the new state, one of the constants inFWProgressTask.StateaParameterMap- parameters for the token replacement, ornull
-
getClonedTask
- Returns:
- a new task with the same progress id, image position and system id (initial state)
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<FWProgressTask>
-