public class AWTScheduler
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static AWTScheduler |
getInstance()
Get singleton instance.
|
int |
scheduleTask(java.lang.Runnable swingWorker)
Schedules a task for execution.
|
void |
startNextTask()
Start the next task in the list.
|
public static AWTScheduler getInstance()
public int scheduleTask(java.lang.Runnable swingWorker)
This function will always return immediately, using invokeLAter to start the task on AWT when the function calling this has completed.
swingWorker
- Prepared swing worker to executepublic void startNextTask()
If it's a SwingWorker, then run it as a scheduled worker task which will handle the disabling and re-enabling of the PAMGUARD GUI.
If it's a plain old runnable, then just send it off to the AWT thread with invoke later and go straight on to setting up the task after it.