151 |
* Posts a new event to the queue. |
* Posts a new event to the queue. |
152 |
* |
* |
153 |
* @param event The event to post to the queue. |
* @param event The event to post to the queue. |
154 |
|
* |
155 |
|
* @exception NullPointerException If event is null. |
156 |
*/ |
*/ |
157 |
public synchronized void postEvent(AWTEvent evt) |
public synchronized void postEvent(AWTEvent evt) |
158 |
{ |
{ |
211 |
notify(); |
notify(); |
212 |
} |
} |
213 |
|
|
214 |
/** @since JDK1.2 */ |
/** |
215 |
|
* Causes runnable to have its run method called in the dispatch thread of the |
216 |
|
* EventQueue. This will happen after all pending events are processed. The |
217 |
|
* call blocks until this has happened. This method will throw an Error if |
218 |
|
* called from the event dispatcher thread. |
219 |
|
* |
220 |
|
* @exception InterruptedException If another thread has interrupted |
221 |
|
* this thread. |
222 |
|
* @exception InvocationTargetException If an exception is thrown when running |
223 |
|
* runnable. |
224 |
|
* |
225 |
|
* @since 1.2 |
226 |
|
*/ |
227 |
public static void invokeAndWait(Runnable runnable) |
public static void invokeAndWait(Runnable runnable) |
228 |
throws InterruptedException, InvocationTargetException |
throws InterruptedException, InvocationTargetException |
229 |
{ |
{ |
268 |
* All pending events are transferred to the new queue. Calls to postEvent, |
* All pending events are transferred to the new queue. Calls to postEvent, |
269 |
* getNextEvent, and peekEvent are forwarded to the pushed queue until it |
* getNextEvent, and peekEvent are forwarded to the pushed queue until it |
270 |
* is removed with a pop(). |
* is removed with a pop(). |
271 |
|
* |
272 |
|
* @exception NullPointerException if newEventQueue is null. |
273 |
*/ |
*/ |
274 |
public synchronized void push(EventQueue newEventQueue) |
public synchronized void push(EventQueue newEventQueue) |
275 |
{ |
{ |
287 |
} |
} |
288 |
|
|
289 |
/** Transfer any pending events from this queue back to the parent queue that |
/** Transfer any pending events from this queue back to the parent queue that |
290 |
* was previously push()ed. Event dispatch from this queue is suspended. */ |
* was previously push()ed. Event dispatch from this queue is suspended. |
291 |
|
* |
292 |
|
* @exception EmptyStackException If no previous push was made on this |
293 |
|
* EventQueue. |
294 |
|
*/ |
295 |
protected void pop() throws EmptyStackException |
protected void pop() throws EmptyStackException |
296 |
{ |
{ |
297 |
if (prev == null) |
if (prev == null) |
317 |
} |
} |
318 |
} |
} |
319 |
|
|
320 |
|
/** |
321 |
|
* Dispatches an event. The manner in which the event is dispatched depends |
322 |
|
* upon the type of the event and the type of the event's source object. |
323 |
|
* |
324 |
|
* @exception NullPointerException If event is null. |
325 |
|
*/ |
326 |
protected void dispatchEvent(AWTEvent evt) |
protected void dispatchEvent(AWTEvent evt) |
327 |
{ |
{ |
328 |
if (evt instanceof ActiveEvent) |
if (evt instanceof ActiveEvent) |