com.jogamp.newt.util
Interface EDTUtil


public interface EDTUtil

EDT stands for Event Dispatch Thread.

EDTUtil comprises the functionality of:

The EDT pattern is a common tool to comply with todays windowing toolkits, where the common denominator in regards to multithreading is to: Note: This is not true on MacOSX, where all these actions have to be performed by a unique, so called main thread.


Field Summary
static long defaultEDTPollGranularity
           
 
Method Summary
 void invoke(boolean wait, Runnable task)
          Append task to the EDT task queue.
Wait until execution is finished if wait == true.
Shall start the thread if not running.
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()
           
 boolean isRunning()
           
 void reset()
          Create a new EDT.
 void start()
          Start the EDT
 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.
 

Field Detail

defaultEDTPollGranularity

static final long defaultEDTPollGranularity
See Also:
Constant Field Values
Method Detail

reset

void reset()
Create a new EDT. One should invoke reset()
after invokeStop(..) in case another start() or invoke(..) is expected.

See Also:
start(), invoke(boolean, java.lang.Runnable), invokeStop(java.lang.Runnable)

start

void start()
Start the EDT


isCurrentThreadEDT

boolean isCurrentThreadEDT()
Returns:
True if the current thread is the EDT thread

isRunning

boolean isRunning()
Returns:
True if EDT is running

invokeStop

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:


invoke

void invoke(boolean wait,
            Runnable task)
Append task to the EDT task queue.
Wait until execution is finished if wait == true.
Shall start the thread if not running.
Can be issued from within EDT, ie from within an enqueued task.

Throws:
RuntimeException - in case EDT is stopped and not reset()

waitUntilIdle

void waitUntilIdle()
Wait until the EDT task queue is empty.
The last task may still be in execution when this method returns.


waitUntilStopped

void waitUntilStopped()
Wait until EDT task is stopped.
No stop action is performed, invokeStop(java.lang.Runnable) should be used before.



Copyright 2010 JogAmp Community.