public class SubTaskMonitor extends java.lang.Object implements ProgressMonitor
SIZE_INDETERMINATE| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeCancelled()
return true if the process appears to support cancel.
|
void |
cancel()
Notifies the
ProgressMonitor that the task
being monitored should be canceled. |
static SubTaskMonitor |
create(ProgressMonitor parent,
boolean cancelChecked)
mode for when parent is indeterminate
|
static SubTaskMonitor |
create(ProgressMonitor parent,
long min,
long max)
create the subtask monitor.
|
static SubTaskMonitor |
create(ProgressMonitor parent,
long min,
long max,
boolean cancelChecked)
create the subtask monitor.
|
void |
finished()
Notifies the
ProgressMonitor that the task
being monitored has finished. |
java.lang.String |
getLabel()
Return the label string displayed, which is a concise string that
describes the task being performed.
|
ProgressMonitor |
getSubtaskMonitor(int start,
int end,
java.lang.String label)
return a monitor to use for a subtask.
|
ProgressMonitor |
getSubtaskMonitor(java.lang.String label)
get the subtask monitor when the current task length is indeterminate.
|
long |
getTaskProgress()
Returns the current progress of the monitored task.
|
long |
getTaskSize()
Return the size of the task.
|
boolean |
isCancelled()
Returns
true if the operation being tracked
should be cancelled. |
boolean |
isFinished()
true if the process has indicated that it is finished
|
boolean |
isStarted()
true if the process has indicated that it has started.
|
void |
setAdditionalInfo(java.lang.String s)
Deprecated.
|
void |
setLabel(java.lang.String label)
Set a concise string that describes the task being performed.
|
void |
setProgressMessage(java.lang.String message)
these messages are lost, unless doEchoToParent is set.
|
void |
setTaskProgress(long position)
Notifies the ProgressMonitor of a change in the progress
of the task.
|
void |
setTaskSize(long taskSize)
Sets the maximum value for the task progress of this
ProgressMonitor. |
void |
started()
Notifies the
ProgressMonitor that the task
being monitored has started. |
java.lang.String |
toString() |
public static SubTaskMonitor create(ProgressMonitor parent, long min, long max)
parent - parent monitormin - miniummax - maximumpublic static SubTaskMonitor create(ProgressMonitor parent, long min, long max, boolean cancelChecked)
parent - parent monitormin - miniummax - maximumcancelChecked - true if we should check the parent's cancel statuspublic static SubTaskMonitor create(ProgressMonitor parent, boolean cancelChecked)
parent - cancelChecked - public void cancel()
ProgressMonitorProgressMonitor that the task
being monitored should be canceled. After this method is
called, implementations should return true on
any subsequent calls to ProgressMonitor.isCancelled() and should
throw an IllegalStateException on any subsequent calls to
ProgressMonitor.setTaskProgress(long).cancel in interface ProgressMonitorpublic void finished()
ProgressMonitorProgressMonitor that the task
being monitored has finished. This must only be called once, and note that isFinished() must return
the state of this monitor.finished in interface ProgressMonitorpublic boolean isFinished()
ProgressMonitorisFinished in interface ProgressMonitorpublic long getTaskProgress()
ProgressMonitorgetTaskProgress in interface ProgressMonitorpublic boolean isCancelled()
ProgressMonitortrue if the operation being tracked
should be cancelled. For example, the human operator has pressed
the cancel button indicating that the process should be stopped. Note
that if the process is not checking the cancel status, the cancel button
should be disabled.isCancelled in interface ProgressMonitortrue if the operation being tracked
should be cancelled.@Deprecated public void setAdditionalInfo(java.lang.String s)
ProgressMonitorsetAdditionalInfo in interface ProgressMonitors - the message, such as (50KB/s)public void setTaskProgress(long position)
throws java.lang.IllegalArgumentException
ProgressMonitorsetTaskProgress in interface ProgressMonitorposition - the current task positionjava.lang.IllegalArgumentException - if ProgressMonitor.isCancelled() returns true or,
possibly if started() has not been called or
finished() has been called.public void setTaskSize(long taskSize)
ProgressMonitorProgressMonitor.setTaskSize in interface ProgressMonitortaskSize - maximum value for the task progress. A taskSize of -1 indicates the taskSize is indeterminate.public long getTaskSize()
ProgressMonitorgetTaskSize in interface ProgressMonitorpublic void started()
ProgressMonitorProgressMonitor that the task
being monitored has started. If the ProgressMonitor
is in a cancelled state when this method is called, that
ProgressMonitor should be 'uncancelled'.started in interface ProgressMonitorpublic boolean isStarted()
ProgressMonitorisStarted in interface ProgressMonitorpublic void setLabel(java.lang.String label)
ProgressMonitorsetLabel in interface ProgressMonitorlabel - the label describing the task.public java.lang.String getLabel()
ProgressMonitorgetLabel in interface ProgressMonitorpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setProgressMessage(java.lang.String message)
setProgressMessage in interface ProgressMonitormessage - public ProgressMonitor getSubtaskMonitor(int start, int end, java.lang.String label)
ProgressMonitorgetSubtaskMonitor in interface ProgressMonitorstart - start position on this monitor.end - end position on this monitor (exclusive).label - a label for the subtask, often this is handled as progress message; or null.public ProgressMonitor getSubtaskMonitor(java.lang.String label)
ProgressMonitorgetSubtaskMonitor in interface ProgressMonitorlabel - a label for the subtask, often this is handled as progress message; or null.public boolean canBeCancelled()
ProgressMonitorcanBeCancelled in interface ProgressMonitor