Java 类sun.awt.EventQueueDelegate 实例源码

项目:jdk8u-jdk    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:jdk8u_jdk    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:lookaside_java-1.8.0-openjdk    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:infobip-open-jdk-8    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:jdk8u-dev-jdk    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:jdk7-jdk    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:openjdk-source-code-learn    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:OLD-OpenJDK8    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:JAVA_UNIT    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:openjdk-jdk7u-jdk    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:openjdk-icedtea7    文件:bug6638195.java   
public static void main(String[] args) throws Exception {
    MyEventQueueDelegate delegate = new MyEventQueueDelegate();
    EventQueueDelegate.setDelegate(delegate);
    runTest(delegate);

    delegate = new MyEventQueueDelegate();
    SwingUtilities3.setEventQueueDelegate(getObjectMap(delegate));
    runTest(delegate);
}
项目:OpenJSharp    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:OpenJSharp    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:jdk8u-jdk    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:jdk8u-jdk    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:Java8CN    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:jdk8u_jdk    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:jdk8u_jdk    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:lookaside_java-1.8.0-openjdk    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:jdk-1.7-annotated    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:infobip-open-jdk-8    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:infobip-open-jdk-8    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:jdk8u-dev-jdk    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:jdk8u-dev-jdk    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:jdk7-jdk    文件:EventDispatchThread.java   
boolean pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }

        return true;
    }
    catch (ThreadDeath death) {
        threadDeathCaught = true;
        return false;

    }
    catch (InterruptedException interruptedException) {
        return false; // AppContext.dispose() interrupts all
                      // Threads in the AppContext

    }
    catch (Throwable e) {
        processException(e);
    }

    return true;
}
项目:jdk7-jdk    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:openjdk-source-code-learn    文件:EventDispatchThread.java   
boolean pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }

        return true;
    }
    catch (ThreadDeath death) {
        threadDeathCaught = true;
        return false;

    }
    catch (InterruptedException interruptedException) {
        return false; // AppContext.dispose() interrupts all
                      // Threads in the AppContext

    }
    catch (Throwable e) {
        processException(e);
    }

    return true;
}
项目:openjdk-source-code-learn    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:OLD-OpenJDK8    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:OLD-OpenJDK8    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:openjdk-jdk7u-jdk    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:openjdk-jdk7u-jdk    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
项目:openjdk-icedtea7    文件:EventDispatchThread.java   
void pumpOneEventForFilters(int id) {
    AWTEvent event = null;
    boolean eventOK = false;
    try {
        EventQueue eq = null;
        EventQueueDelegate.Delegate delegate = null;
        do {
            // EventQueue may change during the dispatching
            eq = getEventQueue();
            delegate = EventQueueDelegate.getDelegate();

            if (delegate != null && id == ANY_EVENT) {
                event = delegate.getNextEvent(eq);
            } else {
                event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
            }

            eventOK = true;
            synchronized (eventFilters) {
                for (int i = eventFilters.size() - 1; i >= 0; i--) {
                    EventFilter f = eventFilters.get(i);
                    EventFilter.FilterAction accept = f.acceptEvent(event);
                    if (accept == EventFilter.FilterAction.REJECT) {
                        eventOK = false;
                        break;
                    } else if (accept == EventFilter.FilterAction.ACCEPT_IMMEDIATELY) {
                        break;
                    }
                }
            }
            eventOK = eventOK && SunDragSourceContextPeer.checkEvent(event);
            if (!eventOK) {
                event.consume();
            }
        }
        while (eventOK == false);

        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
            eventLog.finest("Dispatching: " + event);
        }

        Object handle = null;
        if (delegate != null) {
            handle = delegate.beforeDispatch(event);
        }
        eq.dispatchEvent(event);
        if (delegate != null) {
            delegate.afterDispatch(event, handle);
        }
    }
    catch (ThreadDeath death) {
        doDispatch = false;
        throw death;
    }
    catch (InterruptedException interruptedException) {
        doDispatch = false; // AppContext.dispose() interrupts all
                            // Threads in the AppContext
    }
    catch (Throwable e) {
        processException(e);
    }
}
项目:openjdk-icedtea7    文件:SwingUtilities3.java   
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}