public interface ThreadedPlugIn extends PlugIn
First, #execute is called on the AWT event dispatch thread (the "GUI thread"). Here, the user can be prompted with a dialog.
Then, #run(TaskMonitor) is called, on a new thread. Here, a long operation can be performed. The TaskMonitor can be used to report progress (messages will appear on a modal progress dialog). Because the thread is not the GUI thread, the GUI will remain responsive.
Thus, to run a PlugIn on a separate thread with progress reporting:
Modifier and Type | Method and Description |
---|---|
void |
run(TaskMonitor monitor,
PlugInContext context)
Runs the task.
|
execute, getName, initialize
void run(TaskMonitor monitor, PlugInContext context) throws java.lang.Exception
monitor
- context to which this task can report its progress and
check whether a party has requested its cancellationjava.lang.Exception