es.unex.sextante.gui.core
Class DefaultTaskMonitor

java.lang.Object
  extended by es.unex.sextante.gui.core.DefaultTaskMonitor
All Implemented Interfaces:
ITaskMonitor

public class DefaultTaskMonitor
extends java.lang.Object
implements ITaskMonitor

A simple task monitor, which just shows a progress monitor

Author:
volaya

Constructor Summary
DefaultTaskMonitor(java.lang.String sText, boolean bDeterminate, javax.swing.JDialog parent)
          Creates a new task monitor
 
Method Summary
 void close()
          Closes the monitor.
 boolean isCanceled()
          Returns rue is the task that is being monitored has been canceled using this monitor
 void setDeterminate(boolean bDeterminate)
          Set whether the process is determinate or not
 void setProcessDescription(java.lang.String sDescription)
          Sets the description of the process being monitored
 void setProgress(int iStep)
          Sets the current progress
 void setProgress(int iStep, int iTotalNumberOfSteps)
          Sets the current progress
 void setProgressText(java.lang.String sText)
          Sets the current text to display by this task monitor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTaskMonitor

public DefaultTaskMonitor(java.lang.String sText,
                          boolean bDeterminate,
                          javax.swing.JDialog parent)
Creates a new task monitor

Parameters:
sText - the text to show in the top bar of the progress monitor
bDeterminate - whether the process to monitor is determinate (the number of total steps to complete is known)
parent - the parent component. If null, the main frame will be used
Method Detail

isCanceled

public boolean isCanceled()
Description copied from interface: ITaskMonitor
Returns rue is the task that is being monitored has been canceled using this monitor

Specified by:
isCanceled in interface ITaskMonitor
Returns:
true is the task that is being monitored has been canceled using this monitor

setProgress

public void setProgress(int iStep)
Description copied from interface: ITaskMonitor
Sets the current progress

Specified by:
setProgress in interface ITaskMonitor
Parameters:
iStep - the current progress, in percentage (0-100)

setProgressText

public void setProgressText(java.lang.String sText)
Description copied from interface: ITaskMonitor
Sets the current text to display by this task monitor

Specified by:
setProgressText in interface ITaskMonitor
Parameters:
sText - The text to display

close

public void close()
Description copied from interface: ITaskMonitor
Closes the monitor. This is called once the task has been finished

Specified by:
close in interface ITaskMonitor

setProgress

public void setProgress(int iStep,
                        int iTotalNumberOfSteps)
Description copied from interface: ITaskMonitor
Sets the current progress

Specified by:
setProgress in interface ITaskMonitor
Parameters:
iStep - the current step
iTotalNumberOfSteps - the total number of steps in the task

setDeterminate

public void setDeterminate(boolean bDeterminate)
Description copied from interface: ITaskMonitor
Set whether the process is determinate or not

Specified by:
setDeterminate in interface ITaskMonitor
Parameters:
bDeterminate - whether the process to monitor is determinate (the number of total steps to complete is known)

setProcessDescription

public void setProcessDescription(java.lang.String sDescription)
Description copied from interface: ITaskMonitor
Sets the description of the process being monitored

Specified by:
setProcessDescription in interface ITaskMonitor
Parameters:
sDescription - the description of the process being monitored