org.knime.core.node
Class DefaultNodeProgressMonitor.SubNodeProgressMonitor

java.lang.Object
  extended by org.knime.core.node.DefaultNodeProgressMonitor.SubNodeProgressMonitor
All Implemented Interfaces:
NodeProgressMonitor
Direct Known Subclasses:
DefaultNodeProgressMonitor.SilentSubNodeProgressMonitor
Enclosing class:
DefaultNodeProgressMonitor

static class DefaultNodeProgressMonitor.SubNodeProgressMonitor
extends Object
implements NodeProgressMonitor

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.SubNodeProgressMonitor(NodeProgressMonitor parent, double max)
          Creates new sub progress monitor.
 
Method Summary
 void addProgressListener(NodeProgressListener l)
          Must not be called.
(package private)  void appendMessage(String append)
           
 void checkCanceled()
          Delegates to parent.
 String getMessage()
          The current progress message displayed.
 Double getProgress()
          Get the subprogress, the value scaled to [0, 1].
 void removeAllProgressListener()
          Must not be called.
 void removeProgressListener(NodeProgressListener l)
          Must not be called.
 void reset()
          Reset progress, message and cancel flag.
 void setExecuteCanceled()
          Must not be called.
 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)
          Sets a new progress value.
 void setProgress(String message)
          Delegates to parent.
(package private)  void setProgress(String message, boolean append)
          Internal setter method, subject to override in silent progress mon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNodeProgressMonitor.SubNodeProgressMonitor

DefaultNodeProgressMonitor.SubNodeProgressMonitor(NodeProgressMonitor parent,
                                                  double max)
Creates new sub progress monitor.

Parameters:
parent - The parent of this monitor, i.e. where to report progress to and get the canceled status from.
max - The maximum progress (w.r.t parent) that this monitor should report.
Method Detail

addProgressListener

public void addProgressListener(NodeProgressListener l)
Must not be called. Throws IllegalStateException. Adds a new listener to the list of instances which are interested in receiving progress events.

Specified by:
addProgressListener in interface NodeProgressMonitor
Parameters:
l - The progress listener to add.

checkCanceled

public void checkCanceled()
                   throws CanceledExecutionException
Delegates to parent.

Specified by:
checkCanceled in interface NodeProgressMonitor
Throws:
CanceledExecutionException - If the execution of the NodeModel has been canceled during execute.

getMessage

public String getMessage()
The current progress message displayed.

Specified by:
getMessage in interface NodeProgressMonitor
Returns:
Progress message.

getProgress

public Double getProgress()
Get the subprogress, the value scaled to [0, 1]. The current progress value or null if no progress available.

Specified by:
getProgress in interface NodeProgressMonitor
Returns:
Progress value between 0 and 1, or null.

reset

public void reset()
Reset progress, message and cancel flag.

Specified by:
reset in interface NodeProgressMonitor

removeAllProgressListener

public void removeAllProgressListener()
Must not be called. Throws IllegalStateException.

Specified by:
removeAllProgressListener in interface NodeProgressMonitor
See Also:
NodeProgressMonitor.removeAllProgressListener()

removeProgressListener

public void removeProgressListener(NodeProgressListener l)
Must not be called. Throws IllegalStateException. Removes the given listener from the list and will therefore no longer receive progress events.

Specified by:
removeProgressListener in interface NodeProgressMonitor
Parameters:
l - The progress listener to remove.

setExecuteCanceled

public void setExecuteCanceled()
Must not be called. Throws IllegalStateException. Sets the cancel requested flag.

Specified by:
setExecuteCanceled in interface NodeProgressMonitor

setMessage

public void setMessage(String message)
Displays the message as given by the argument.

Specified by:
setMessage in interface NodeProgressMonitor
Parameters:
message - A convenience message shown in the progress monitor.
See Also:
NodeProgressMonitor.setProgress(String)

setProgress

public void setProgress(String message)
Delegates to parent. Displays the message as given by the argument.

Specified by:
setProgress in interface NodeProgressMonitor
Parameters:
message - A convenience message shown in the progress monitor.

setProgress

void setProgress(String message,
                 boolean append)
Internal setter method, subject to override in silent progress mon.

Parameters:
message - new message
append - whether to append

appendMessage

void appendMessage(String append)
Parameters:
append - Message to append

setProgress

public void setProgress(double progress,
                        String message)
Sets a new progress value. If the value is not in range, the old value is kept. The message is displayed.

Specified by:
setProgress in interface NodeProgressMonitor
Parameters:
progress - The value between 0 and 1.
message - A convenience message shown in the progress monitor or null.

setProgress

public void setProgress(double progress)
Sets a new progress value. If the value is not in range, the old value is kept.

Specified by:
setProgress in interface NodeProgressMonitor
Parameters:
progress - The value between 0 and 1.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.