|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.DefaultNodeProgressMonitor
public class DefaultNodeProgressMonitor
The default node progress monitor which keep a progress value between 0 and
1, and a progress message. Both can be null
if not available
or set wrong (progress value out of range). Furthermore, it holds a flag
which indicates that the task during execution was interrupted.
This progress monitor uses a static timer task looking every 250 milliseconds
if progress information has changed. The ProgressEvent
is
fired if either the value or message has changed only.
Nested Class Summary | |
---|---|
(package private) static class |
DefaultNodeProgressMonitor.SilentSubNodeProgressMonitor
Silent progress monitor which does only forward changed of the progress value rather than progress message. |
(package private) static class |
DefaultNodeProgressMonitor.SubNodeProgressMonitor
Progress monitor that is used by "sub-progresses", it doesn't have the range [0, 1] but only [0, b] where b is user-defined. |
Constructor Summary | |
---|---|
DefaultNodeProgressMonitor()
Creates a new progress monitor with an empty set of listeners. |
|
DefaultNodeProgressMonitor(NodeProgressListener l)
Creates a new node progress monitor, with the cancel requested false, and no progress. |
Method Summary | |
---|---|
void |
addProgressListener(NodeProgressListener l)
Adds a new listener to the list of instances which are interested in receiving progress events. |
void |
checkCanceled()
Checks if the execution was canceled. |
String |
getMessage()
The current progress message displayed. |
Double |
getProgress()
The current progress value or null if no progress available. |
(package private) boolean |
isCanceled()
|
void |
removeAllProgressListener()
Removes all registered progress listeners. |
void |
removeProgressListener(NodeProgressListener l)
Removes the given listener from the list and will therefore no longer receive progress events. |
void |
reset()
Resets this monitor. |
void |
setExecuteCanceled()
Sets the cancel requested flag. |
void |
setMessage(String message)
Displays the message as given by the argument. |
void |
setProgress(double progress)
Sets a new progress value. |
void |
setProgress(double progress,
String message)
Updates the progress value and message if different from the current one. |
void |
setProgress(String message)
Sets a new message according to the argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultNodeProgressMonitor()
DefaultNodeProgressMonitor(NodeProgressListener)
public DefaultNodeProgressMonitor(NodeProgressListener l)
l
- Initial node progress listener.Method Detail |
---|
public void reset()
reset
in interface NodeProgressMonitor
boolean isCanceled()
true
if the execution of the
NodeModel
has been canceled.public void checkCanceled() throws CanceledExecutionException
CanceledExecutionExeption
.
checkCanceled
in interface NodeProgressMonitor
CanceledExecutionException
- If the execution has been canceled.isCanceled()
public void setExecuteCanceled()
setExecuteCanceled
in interface NodeProgressMonitor
public void setProgress(double progress, String message)
setProgress
in interface NodeProgressMonitor
progress
- The (new) progress value.message
- The text message shown in the progress monitor.setProgress(double)
public void setProgress(double progress)
null
.
setProgress
in interface NodeProgressMonitor
progress
- The value between 0 and 1.public void setMessage(String message)
setMessage
in interface NodeProgressMonitor
message
- A convenience message shown in the progress monitor.NodeProgressMonitor.setProgress(String)
public void setProgress(String message)
setProgress
in interface NodeProgressMonitor
message
- The text message shown in the progress monitor.public Double getProgress()
NodeProgressMonitor
null
if no progress available.
getProgress
in interface NodeProgressMonitor
null
if not yet
set.public String getMessage()
NodeProgressMonitor
getMessage
in interface NodeProgressMonitor
public void addProgressListener(NodeProgressListener l)
addProgressListener
in interface NodeProgressMonitor
l
- The progress listener to add.public void removeProgressListener(NodeProgressListener l)
removeProgressListener
in interface NodeProgressMonitor
l
- The progress listener to remove.public void removeAllProgressListener()
removeAllProgressListener
in interface NodeProgressMonitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |