com.jogamp.newt.impl
Class DefaultEDTUtil

java.lang.Object
  extended by com.jogamp.newt.impl.DefaultEDTUtil
All Implemented Interfaces:
EDTUtil

public class DefaultEDTUtil
extends Object
implements EDTUtil


Field Summary
static boolean DEBUG
           
 
Fields inherited from interface com.jogamp.newt.util.EDTUtil
defaultEDTPollGranularity
 
Constructor Summary
DefaultEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages)
           
 
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 task)
          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. EDTUtil.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, EDTUtil.invokeStop(java.lang.Runnable) should be used before.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
Constructor Detail

DefaultEDTUtil

public DefaultEDTUtil(ThreadGroup tg,
                      String name,
                      Runnable dispatchMessages)
Method Detail

reset

public final void reset()
Description copied from interface: EDTUtil
Create a new EDT. One should invoke reset()
after invokeStop(..) in case another start() or invoke(..) is expected.

Specified by:
reset in interface EDTUtil
See Also:
EDTUtil.start(), EDTUtil.invoke(boolean, java.lang.Runnable), EDTUtil.invokeStop(java.lang.Runnable)

start

public final void start()
Description copied from interface: EDTUtil
Start the EDT

Specified by:
start in interface EDTUtil

isCurrentThreadEDT

public final boolean isCurrentThreadEDT()
Specified by:
isCurrentThreadEDT in interface EDTUtil
Returns:
True if the current thread is the EDT thread

isRunning

public final boolean isRunning()
Specified by:
isRunning in interface EDTUtil
Returns:
True if EDT is running

invokeStop

public final void invokeStop(Runnable task)
Description copied from interface: EDTUtil
Append the final task to the EDT task queue, signals EDT to stop and wait until stopped.
Due to the nature of this method:

Specified by:
invokeStop in interface EDTUtil

invoke

public final void invoke(boolean wait,
                         Runnable task)
Description copied from interface: EDTUtil
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.

Specified by:
invoke in interface EDTUtil

waitUntilIdle

public void waitUntilIdle()
Description copied from interface: EDTUtil
Wait until the EDT task queue is empty.
The last task may still be in execution when this method returns.

Specified by:
waitUntilIdle in interface EDTUtil

waitUntilStopped

public void waitUntilStopped()
Description copied from interface: EDTUtil
Wait until EDT task is stopped.
No stop action is performed, EDTUtil.invokeStop(java.lang.Runnable) should be used before.

Specified by:
waitUntilStopped in interface EDTUtil


Copyright 2010 JogAmp Community.