Cytoscape 2.8.0 API

cytoscape.util
Interface MonitoredTask

All Known Subinterfaces:
LayoutAlgorithm

public interface MonitoredTask


Method Summary
 void cancel()
          Gets called by the CytoscapeProgressMonitor when the user click on the Cancel button.
 boolean done()
          Returns true if the task is done.
 int getCurrent()
          Returns the currentProgress parameter.
 int getLengthOfTask()
          Returns the lenghtOfTask parameter.
 String getMessage()
          Returns a String, possibly the message to be printed on a dialog.
 String getTaskName()
          Returns a String, possibly the message that describes the task being performed.
 void go(boolean wait)
          Initializes currentProgress (generally to zero) and then spawns a SwingWorker to start doing the work.
 void incrementProgress()
          Increments the progress by one
 void stop()
          Stops the task by simply setting currentProgress to lengthOfTask, or if a boolean "done" variable is used, setting it to true.
 boolean wasCanceled()
           
 

Method Detail

done

boolean done()
Returns true if the task is done. Otherwise false. This can be done by either returning (currentProgress == lengthOfTask) or having a boolean "done" variable that is set to true in the code whenever the task is done, and returning it here.


getCurrent

int getCurrent()
Returns the currentProgress parameter.


getLengthOfTask

int getLengthOfTask()
Returns the lenghtOfTask parameter.


getMessage

String getMessage()
Returns a String, possibly the message to be printed on a dialog. Example: "Completed 12%"


getTaskName

String getTaskName()
Returns a String, possibly the message that describes the task being performed. Example: "Calculating connecting paths."


go

void go(boolean wait)
Initializes currentProgress (generally to zero) and then spawns a SwingWorker to start doing the work.

Parameters:
wait - whether or not the method should wait for the task to be done before returning if true, should call SwingWorker.get() before returning

incrementProgress

void incrementProgress()
Increments the progress by one


stop

void stop()
Stops the task by simply setting currentProgress to lengthOfTask, or if a boolean "done" variable is used, setting it to true.


cancel

void cancel()
Gets called by the CytoscapeProgressMonitor when the user click on the Cancel button.


wasCanceled

boolean wasCanceled()
Returns:
whether the task was canceled while running or not.

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.