本文整理汇总了Java中sun.awt.EventQueueDelegate.getDelegate方法的典型用法代码示例。如果您正苦于以下问题:Java EventQueueDelegate.getDelegate方法的具体用法?Java EventQueueDelegate.getDelegate怎么用?Java EventQueueDelegate.getDelegate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.awt.EventQueueDelegate
的用法示例。
在下文中一共展示了EventQueueDelegate.getDelegate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例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.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: 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;
}