当前位置: 首页>>代码示例>>Java>>正文


Java EventQueueDelegate类代码示例

本文整理汇总了Java中sun.awt.EventQueueDelegate的典型用法代码示例。如果您正苦于以下问题:Java EventQueueDelegate类的具体用法?Java EventQueueDelegate怎么用?Java EventQueueDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EventQueueDelegate类属于sun.awt包,在下文中一共展示了EventQueueDelegate类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import sun.awt.EventQueueDelegate; //导入依赖的package包/类
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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:bug6638195.java

示例2: pumpOneEventForFilters

import sun.awt.EventQueueDelegate; //导入依赖的package包/类
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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:63,代码来源:EventDispatchThread.java

示例3: setEventQueueDelegate

import sun.awt.EventQueueDelegate; //导入依赖的package包/类
public static void setEventQueueDelegate(
        Map<String, Map<String, Object>> map) {
    EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:SwingUtilities3.java

示例4: pumpOneEventForFilters

import sun.awt.EventQueueDelegate; //导入依赖的package包/类
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);
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:63,代码来源:EventDispatchThread.java

示例5: pumpOneEventForFilters

import sun.awt.EventQueueDelegate; //导入依赖的package包/类
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;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:69,代码来源:EventDispatchThread.java


注:本文中的sun.awt.EventQueueDelegate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。