de.schlichtherle.awt
Class EventQueue
java.lang.Object
java.awt.EventQueue
de.schlichtherle.awt.EventQueue
public class EventQueue
- extends EventQueue
Subclasses EventQueue in order to provide utility methods
for dealing with the AWT Event Queue.
- Since:
- TrueZIP 6.1
- Author:
- Christian Schlichtherle
| Methods inherited from class java.awt.EventQueue |
dispatchEvent, getCurrentEvent, getMostRecentEventTime, getNextEvent, invokeAndWait, invokeLater, isDispatchThread, peekEvent, peekEvent, pop, postEvent, push |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RESET
private static final byte RESET
- See Also:
- Constant Field Values
CANCELLED
private static final byte CANCELLED
- See Also:
- Constant Field Values
STARTED
private static final byte STARTED
- See Also:
- Constant Field Values
DONE
private static final byte DONE
- See Also:
- Constant Field Values
EventQueue
public EventQueue()
invokeAndWaitUninterruptibly
public static void invokeAndWaitUninterruptibly(Runnable task)
throws InvocationTargetException
- Equivalent to
invokeAndWaitUninterruptibly(task, 0), but cannot throw an
EventDispatchTimeoutException.
- Throws:
InvocationTargetException
invokeAndWaitUninterruptibly
public static void invokeAndWaitUninterruptibly(Runnable task,
long startTimeout)
throws EventDispatchTimeoutException,
InvocationTargetException
- Invokes the given
task on the AWT Event Dispatching Thread
(EDT) and waits until it's finished.
If this method is called on the EDT itself, it will just invoke the
given task.
If the current thread gets interrupted while waiting for the EDT to
finish the task, then waiting is continued normally, but the current
thread's interrupt status is set upon return.
- Parameters:
task - The Runnable whose run
method should be executed synchronously in the EDT.startTimeout - If positive, then this parameter specifies the
maximum time to wait before the EDT starts to process
task in milliseconds.
- Throws:
IllegalArgumentException - If startTimeout is
negative.
EventDispatchTimeoutException - If startTimeout is
positive and waiting for the EDT to start processing the
task timed out.
The task has been cancelled, i.e. it will not be executed.
InvocationTargetException - If an exception is thrown when
running task.
getCause() yields the cause of this exception,
which must be a RuntimeException or an Error.- See Also:
Thread.interrupted()
invokeAndWait
public static void invokeAndWait(Runnable task,
boolean interruptibly,
long startTimeout)
throws EventDispatchTimeoutException,
InterruptedException,
InvocationTargetException
- Throws:
EventDispatchTimeoutException
InterruptedException
InvocationTargetException
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.