Copyright 2012-02-25 Werner Randelshofer

ch.randelshofer.gui
Interface ProgressObserver

All Known Implementing Classes:
GlassPaneProgressView

public interface ProgressObserver

ProgressObserver.

Version:
1.1 2007-11-19 Added method setWarning and setError.
1.0 September 18, 2006 Created.
Author:
Werner Randelshofer

Method Summary
 void cancel()
          Cancels the operation.
 void close()
          Closes the progress observer.
 void complete()
          Indicate that the operation is complete.
 java.lang.String getError()
          Specifies the error message that is displayed along with the progress message.
 int getMaximum()
          Returns the maximum value -- the higher end of the progress value.
 int getMinimum()
          Returns the minimum value -- the lower end of the progress value.
 javax.swing.BoundedRangeModel getModel()
           
 java.lang.String getNote()
          Specifies the additional note that is displayed along with the progress message.
 int getProgress()
          Returns the progress of the operation being monitored.
 java.lang.String getWarning()
          Specifies the warning message that is displayed along with the progress message.
 boolean isCanceled()
          Returns true if the user has hit the Cancel button in the progress dialog.
 boolean isClosed()
          Returns true if the progress observer is closed.
 boolean isCompleted()
          Returns true if the operation is completed.
 boolean isIndeterminate()
          Returns true if the progress observer is set to indeterminate.
 void setCancelable(boolean b)
          Set cancelable to false if the operation can not be canceled.
 void setDoCancel(java.lang.Runnable doCancel)
          The specified Runnable is executed when the user presses the cancel button.
 void setError(java.lang.String message)
          Specifies the additional error message that is displayed along with the progress message.
 void setIndeterminate(boolean newValue)
          Sets the progress observer to indeterminate.
 void setMaximum(int m)
          Specifies the maximum value.
 void setMinimum(int m)
          Specifies the minimum value.
 void setModel(javax.swing.BoundedRangeModel brm)
           
 void setNote(java.lang.String note)
          Specifies the additional note that is displayed along with the progress message.
 void setProgress(int nv)
          Indicate the progress of the operation being monitored.
 void setWarning(java.lang.String message)
          Specifies the additional warning message that is displayed along with the progress message.
 

Method Detail

setModel

void setModel(javax.swing.BoundedRangeModel brm)

getModel

javax.swing.BoundedRangeModel getModel()

setCancelable

void setCancelable(boolean b)
Set cancelable to false if the operation can not be canceled.


setDoCancel

void setDoCancel(java.lang.Runnable doCancel)
The specified Runnable is executed when the user presses the cancel button.


setProgress

void setProgress(int nv)
Indicate the progress of the operation being monitored. If the specified value is >= the maximum, the progress monitor is closed.

Parameters:
nv - an int specifying the current value, between the maximum and minimum specified for this component
See Also:
setMinimum(int), setMaximum(int), close()

getProgress

int getProgress()
Returns the progress of the operation being monitored.


getMinimum

int getMinimum()
Returns the minimum value -- the lower end of the progress value.

Returns:
an int representing the minimum value
See Also:
setMinimum(int)

setMinimum

void setMinimum(int m)
Specifies the minimum value.

Parameters:
m - an int specifying the minimum value
See Also:
getMinimum()

getMaximum

int getMaximum()
Returns the maximum value -- the higher end of the progress value.

Returns:
an int representing the maximum value
See Also:
setMaximum(int)

setMaximum

void setMaximum(int m)
Specifies the maximum value.

Parameters:
m - an int specifying the maximum value
See Also:
getMaximum()

setIndeterminate

void setIndeterminate(boolean newValue)
Sets the progress observer to indeterminate.


isIndeterminate

boolean isIndeterminate()
Returns true if the progress observer is set to indeterminate.


complete

void complete()
Indicate that the operation is complete. This happens automatically when the value set by setProgress is >= max, but it may be called earlier if the operation ends early.


isCompleted

boolean isCompleted()
Returns true if the operation is completed.


cancel

void cancel()
Cancels the operation. This method must be invoked from the user event dispatch thread.


isCanceled

boolean isCanceled()
Returns true if the user has hit the Cancel button in the progress dialog.


close

void close()
Closes the progress observer.


isClosed

boolean isClosed()
Returns true if the progress observer is closed.


setNote

void setNote(java.lang.String note)
Specifies the additional note that is displayed along with the progress message. Used, for example, to show which file is currently being copied during a multiple-file copy.

Parameters:
note - a String specifying the note to display
See Also:
getNote()

getNote

java.lang.String getNote()
Specifies the additional note that is displayed along with the progress message.

Returns:
a String specifying the note to display
See Also:
setNote(java.lang.String)

setWarning

void setWarning(java.lang.String message)
Specifies the additional warning message that is displayed along with the progress message. Used, for example, to show which files couldn't be copied during a multiple-file copy..

Parameters:
message - a String specifying the message to display, or null if there is no warning.
See Also:
getWarning()

getWarning

java.lang.String getWarning()
Specifies the warning message that is displayed along with the progress message.

Returns:
a String specifying the message to display, or null if there is no warning.

setError

void setError(java.lang.String message)
Specifies the additional error message that is displayed along with the progress message. Used, for example, to show which files couldn't be copied during a multiple-file copy..

Parameters:
message - a String specifying the message to display, or null if there is no error.
See Also:
getWarning()

getError

java.lang.String getError()
Specifies the error message that is displayed along with the progress message.

Returns:
a String specifying the message to display, or null if there is no error.

Copyright 2012-02-25 Werner Randelshofer