Define a handy-dandy public static RunQueue implementation that posts

Runnables to the AWT dispatch thread.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1718 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2008-08-25 08:06:09 +00:00
parent 9ad9d4deb4
commit 7a73ee5fb1
@@ -3,11 +3,29 @@
package com.samskivert.util;
import java.awt.EventQueue;
/**
* An interface for a service that queues up execution of Runnables.
*/
public interface RunQueue
{
/**
* A useful RunQueue that uses the AWT dispatch thread.
*/
public static final RunQueue AWT = new RunQueue()
{
public void postRunnable (Runnable r)
{
return EventQueue.invokeLater(r);
}
public boolean isDispatchThread ()
{
return EventQueue.isDispatchThread();
}
};
/**
* Post the specified Runnable to be run on the RunQueue.
*/