public interface EDTUtil
EDTUtil comprises the functionality of:
Modifier and Type | Field and Description |
---|---|
static long |
defaultEDTPollPeriod |
Modifier and Type | Method and Description |
---|---|
long |
getPollPeriod() |
void |
invoke(boolean wait,
Runnable task)
Shall start the thread if not running.
Append task to the EDT task queue. Wait until execution is finished if wait == true .Can be issued from within EDT, ie from within an enqueued task. |
void |
invokeStop(Runnable finalTask)
Append the final task to the EDT task queue,
signals EDT to stop and wait until stopped.
Due to the nature of this method: All previous queued tasks will be finished. No new tasks are allowed, an Exception is thrown. Can be issued from within EDT, ie from within an enqueued task. reset() may follow immediately, ie creating a new EDT
|
boolean |
isCurrentThreadEDT()
Returns true if the current thread is the event dispatch thread (EDT).
|
boolean |
isCurrentThreadEDTorNEDT()
|
boolean |
isCurrentThreadNEDT()
Returns true if the current thread is the internal NEWT event dequeue thread (NEDT).
|
boolean |
isRunning() |
void |
reset()
Create a new EDT.
|
void |
setPollPeriod(long ms) |
void |
waitUntilIdle()
Wait until the EDT task queue is empty.
The last task may still be in execution when this method returns. |
void |
waitUntilStopped()
Wait until EDT task is stopped.
No stop action is performed, invokeStop(java.lang.Runnable) should be used before. |
static final long defaultEDTPollPeriod
long getPollPeriod()
void setPollPeriod(long ms)
ms
- poll period in millisecondsvoid reset()
reset()
invokeStop(..)
in case another start via invoke(..)
is expected.boolean isCurrentThreadEDT()
The EDT is the platform specific thread dispatching toolkit-events
and executing toolkit-tasks enqueued via invoke(boolean, Runnable)
.
Usually it is the same thread as used to dequeue informal NEWTEvent
s (NEDT), see isCurrentThreadNEDT()
,
however, this may differ, e.g. SWT and AWT implementation.
boolean isCurrentThreadNEDT()
The NEDT is the NEWT thread used to dequeue informal NEWTEvent
s enqueued internally
via DisplayImpl.enqueueEvent(boolean, NEWTEvent)
.
Usually it is the same thread as the EDT, see isCurrentThreadEDT()
,
however, this may differ, e.g. SWT and AWT implementation.
boolean isCurrentThreadEDTorNEDT()
boolean isRunning()
void invokeStop(Runnable finalTask)
reset()
may follow immediately, ie creating a new EDTvoid invoke(boolean wait, Runnable task)
wait == true
.RuntimeException
- in case EDT is stopped and not reset()
void waitUntilIdle()
void waitUntilStopped()
stop
action is performed, invokeStop(java.lang.Runnable)
should be used before.Copyright 2010 JogAmp Community.