Package com.bc.ceres.swing.progress
Class ProgressMonitorSwingWorker<T,V>
java.lang.Object
javax.swing.SwingWorker<T,V>
com.bc.ceres.swing.progress.ProgressMonitorSwingWorker<T,V>
- All Implemented Interfaces:
Runnable
,Future<T>
,RunnableFuture<T>
A swing worker which may pop-up a progress monitor dialog.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ProgressMonitorSwingWorker
(Component parentComponent, String title) -
Method Summary
Modifier and TypeMethodDescriptionprotected final T
Overridden in order to call thedoInBackground
method with aProgressMonitor
.protected abstract T
Computes a result, or throws an exception if unable to do so.final void
Similar to theSwingWorker.execute()
method, but blocks the current thread until this worker computed its result.Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, done, 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
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
ProgressMonitorSwingWorker
-
-
Method Details
-
doInBackground
Overridden in order to call thedoInBackground
method with aProgressMonitor
.- Specified by:
doInBackground
in classSwingWorker<T,
V> - Returns:
- the computed result
- Throws:
Exception
- if unable to compute a result
-
doInBackground
Computes a result, or throws an exception if unable to do so.Note that this method is executed only once in a background thread.
- Parameters:
pm
- the progress monitor- Returns:
- the computed result
- Throws:
Exception
- if unable to compute a result
-
executeWithBlocking
public final void executeWithBlocking()Similar to theSwingWorker.execute()
method, but blocks the current thread until this worker computed its result. However, this method will not block the Event Dispatch Thread. -
getDialogProgressMonitor
-