|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.SwingWorker<ExitStatus,java.lang.Integer>
com.xinapse.util.MonitorWorker
public abstract class MonitorWorker
A class to implement a SwingWorker that can pop up a ProgressMonitor to allow user cancellation. It is up to the MonitorWorker's doInBackground method to check whether cancellation has occured using either the setMonitorProgress(int progress) method, which throws a CancelledException, or directly with the isCancelled() method.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.SwingWorker |
|---|
javax.swing.SwingWorker.StateValue |
| Field Summary | |
|---|---|
java.lang.String |
errorMessage
An error message set when an error occurs. |
IndeterminateProgressMonitor |
indeterminateMonitor
An IndeterminateProgressMonitor which may pop up. |
javax.swing.ProgressMonitor |
monitor
A ProgressMonitor which may pop up. |
| Constructor Summary | |
|---|---|
protected |
MonitorWorker(java.awt.Component c,
java.lang.String progName)
Creates a new MonitorWorker with a parent component and a program name. |
| Method Summary | |
|---|---|
void |
checkCancelled()
Tests whether this CancellableWorker has been cancelled. |
void |
checkCancelled(java.lang.Integer progress)
Tests whether this CancellableWorker has been cancelled, and sets the progress through this operation. |
void |
checkCancelled(java.lang.String message)
Tests whether this CancellableWorker has been cancelled. |
void |
checkCancelled(java.lang.String message,
java.lang.Integer progress)
Tests whether this CancellableWorker has been cancelled, and sets the progress through this operation. |
abstract ExitStatus |
doInBackground()
Overrides the doInBackground() method. |
void |
done()
Overrides the done() method. |
java.awt.Component |
getComponent()
Returns the component from which this MonitorWorker was launched. |
java.lang.String |
getProgName()
Returns the program name for this MonitorWorker. |
void |
setAction(java.lang.String descr)
Set the action description for the Progress monitor or IndeterminateProgressMonitor. |
void |
setAction(java.lang.String descr,
int min,
int max)
Set the action description for the ProgressMonitor. |
| Methods inherited from class javax.swing.SwingWorker |
|---|
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public javax.swing.ProgressMonitor monitor
public IndeterminateProgressMonitor indeterminateMonitor
public java.lang.String errorMessage
| Constructor Detail |
|---|
protected MonitorWorker(java.awt.Component c,
java.lang.String progName)
c - a Component which may be able to show status messages, if non-null.progName - program name for the program that is running this MonitorWorker.| Method Detail |
|---|
public java.awt.Component getComponent()
public java.lang.String getProgName()
public void setAction(java.lang.String descr,
int min,
int max)
descr - the action description.min - the minimum for the ProgressMonitor.max - the maximum for the ProgressMonitor.public void setAction(java.lang.String descr)
descr - the action description.
public void checkCancelled()
throws CancelledException
CancelledException - if the operation has been cancelled.
public void checkCancelled(java.lang.String message)
throws CancelledException
message - a message to put to the IndeterminateProgressMonitor.
CancelledException - if the operation has been cancelled.
public void checkCancelled(java.lang.Integer progress)
throws CancelledException
progress - the progress of the ProgressMonitor.
CancelledException - if the operation has been cancelled.
public void checkCancelled(java.lang.String message,
java.lang.Integer progress)
throws CancelledException
message - a message to put to the IndeterminateProgressMonitor.progress - the progress of the ProgressMonitor.
CancelledException - if the operation has been cancelled.public abstract ExitStatus doInBackground()
doInBackground in class javax.swing.SwingWorker<ExitStatus,java.lang.Integer>public void done()
done in class javax.swing.SwingWorker<ExitStatus,java.lang.Integer>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||