Methods Summary |
---|
synchronized void | dispatchEvent(java.awt.AWTEvent event)
updateCurrentEventAndTime(event);
try {
activeQueue.dispatchEvent(event);
} finally {
currentEvent = null;
}
|
void | dispatchEventImpl(java.awt.AWTEvent event)
if (event instanceof ActiveEvent) {
updateCurrentEventAndTime(event);
try {
((ActiveEvent) event).dispatch();
} finally {
currentEvent = null;
}
return;
}
Object src = event.getSource();
if (src instanceof Component) {
if (preprocessComponentEvent(event)) {
((Component) src).dispatchEvent(event);
}
} else {
if (toolkit != null) {
toolkit.dispatchAWTEvent(event);
}
if (src instanceof MenuComponent) {
((MenuComponent) src).dispatchEvent(event);
}
}
|
synchronized java.awt.EventQueue | getActiveEventQueue()
return activeQueue;
|
synchronized java.awt.AWTEvent | getCurrentEvent()
return currentEvent;
|
synchronized long | getMostRecentEventTime()
return mostRecentEventTime;
|
synchronized java.awt.AWTEvent | getNextEvent()
while (events.isEmpty()) {
wait();
}
AWTEvent event = events.removeFirst();
// TODO: add event coalescing
return event;
|
synchronized java.awt.AWTEvent | getNextEventNoWait()
try {
return events.isEmpty() ? null : activeQueue.getNextEvent();
} catch (InterruptedException e) {
return null;
}
|
synchronized boolean | isEmpty()
return (currentEvent == null) && events.isEmpty();
|
synchronized boolean | isEmpty(long timeout)
if (!isEmpty()) {
return false;
}
try {
wait(timeout);
} catch (InterruptedException e) {}
return isEmpty();
|
synchronized boolean | isSystemEventQueue()
return toolkit != null;
|
void | notifyEventMonitor(java.awt.Toolkit t)
Object em = t.getNativeEventQueue().getEventMonitor();
synchronized (em) {
em.notifyAll();
}
|
synchronized java.awt.AWTEvent | peekEvent()
return events.isEmpty() ? null : events.getFirst();
|
synchronized java.awt.AWTEvent | peekEvent(int id)
for (AWTEvent event : events) {
if (event.getID() == id) {
return event;
}
}
return null;
|
synchronized void | pop()
EventQueue removed = queueStack.removeLast();
if (removed != activeQueue) {
// awt.6C=Event queue stack is broken
throw new IllegalStateException(Messages.getString("awt.6C")); //$NON-NLS-1$
}
activeQueue = queueStack.getLast();
removed.setCore(null);
|
synchronized void | postEvent(java.awt.AWTEvent event)
//???AWT
/*
events.addLast(event);
if ((toolkit == null) && (dispatchThread == null)) {
dispatchThread = new EventQueueThread(this);
dispatchThread.start();
}
// TODO: add event coalescing
if (toolkit != null) {
toolkit.shutdownWatchdog.setAwtQueueEmpty(false);
if (!GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {
notifyEventMonitor(toolkit);
}
}
notifyAll();
*/
|
private final boolean | preprocessComponentEvent(java.awt.AWTEvent event)
if (event instanceof MouseEvent) {
return preprocessMouseEvent((MouseEvent)event);
}
return true;
|
private final boolean | preprocessMouseEvent(java.awt.event.MouseEvent event)
//???AWT
/*
if (toolkit != null && toolkit.mouseEventPreprocessor != null) {
toolkit.lockAWT();
try {
return toolkit.mouseEventPreprocessor.preprocess(event);
} finally {
toolkit.unlockAWT();
}
}
return true;
*/
return true;
|
synchronized void | push(java.awt.EventQueue newEventQueue)
// TODO: handle incorrect situations
if (queueStack.isEmpty()) {
// awt.6B=Queue stack is empty
throw new IllegalStateException(Messages.getString("awt.6B")); //$NON-NLS-1$
}
queueStack.addLast(newEventQueue);
activeQueue = newEventQueue;
activeQueue.setCore(this);
|
private void | setToolkit(java.awt.Toolkit t)
toolkit = t;
if (toolkit != null) {
toolkit.setSystemEventQueueCore(this);
dispatchThread = toolkit.dispatchThread;
}
|
private void | updateCurrentEventAndTime(java.awt.AWTEvent event)
currentEvent = event;
long when = 0;
if (event instanceof ActionEvent) {
when = ((ActionEvent) event).getWhen();
} else if (event instanceof InputEvent) {
when = ((InputEvent) event).getWhen();
} else if (event instanceof InputMethodEvent) {
when = ((InputMethodEvent) event).getWhen();
} else if (event instanceof InvocationEvent) {
when = ((InvocationEvent) event).getWhen();
}
if (when != 0) {
mostRecentEventTime = when;
}
|