本文整理汇总了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);
}
示例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);
}
}
示例3: setEventQueueDelegate
import sun.awt.EventQueueDelegate; //导入依赖的package包/类
public static void setEventQueueDelegate(
Map<String, Map<String, Object>> map) {
EventQueueDelegate.setDelegate(new EventQueueDelegateFromMap(map));
}
示例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);
}
}
示例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;
}