Search in sources :

Example 1 with MenuComponent

use of java.awt.MenuComponent in project hackpad by dropbox.

the class RunProxy method dispatchNextGuiEvent.

/**
     * Processes the next GUI event.
     */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent) event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component) source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent) source).dispatchEvent(event);
        }
    }
}
Also used : ActiveEvent(java.awt.ActiveEvent) AWTEvent(java.awt.AWTEvent) EventObject(java.util.EventObject) MenuComponent(java.awt.MenuComponent) Component(java.awt.Component) MenuComponent(java.awt.MenuComponent) EventQueue(java.awt.EventQueue)

Aggregations

AWTEvent (java.awt.AWTEvent)1 ActiveEvent (java.awt.ActiveEvent)1 Component (java.awt.Component)1 EventQueue (java.awt.EventQueue)1 MenuComponent (java.awt.MenuComponent)1 EventObject (java.util.EventObject)1