本文整理汇总了Java中java.awt.event.AWTEventListenerProxy.getEventMask方法的典型用法代码示例。如果您正苦于以下问题:Java AWTEventListenerProxy.getEventMask方法的具体用法?Java AWTEventListenerProxy.getEventMask怎么用?Java AWTEventListenerProxy.getEventMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.AWTEventListenerProxy
的用法示例。
在下文中一共展示了AWTEventListenerProxy.getEventMask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: globalDispatchEvent
import java.awt.event.AWTEventListenerProxy; //导入方法依赖的package包/类
/**
* Dispatches events to listeners registered to this Toolkit. This is called
* by {@link Component#dispatchEventImpl(AWTEvent)} in order to dispatch
* events globally.
*
* @param ev the event to dispatch
*/
void globalDispatchEvent(AWTEvent ev)
{
// We do not use the accessor methods here because they create new
// arrays each time. We must be very efficient, so we access this directly.
for (int i = 0; i < awtEventListeners.length; ++i)
{
AWTEventListenerProxy proxy = awtEventListeners[i];
if ((proxy.getEventMask() & AWTEvent.eventIdToMask(ev.getID())) != 0)
proxy.eventDispatched(ev);
}
}
示例2: getAWTEventListeners
import java.awt.event.AWTEventListenerProxy; //导入方法依赖的package包/类
AWTEventListener[] getAWTEventListeners(long eventMask) {
HashSet<EventListener> listenersSet = new HashSet<EventListener>();
for (AWTEventListenerProxy proxy : listeners.getUserListeners()) {
if ((proxy.getEventMask() & eventMask) == eventMask) {
listenersSet.add(proxy.getListener());
}
}
return listenersSet.toArray(new AWTEventListener[listenersSet.size()]);
}
示例3: dispatchAWTEvent
import java.awt.event.AWTEventListenerProxy; //导入方法依赖的package包/类
void dispatchAWTEvent(AWTEvent event) {
AWTEvent.EventDescriptor descriptor = eventTypeLookup.getEventDescriptor(event);
if (descriptor == null) {
return;
}
for (AWTEventListenerProxy proxy : listeners.getUserListeners()) {
if ((proxy.getEventMask() & descriptor.eventMask) != 0) {
proxy.eventDispatched(event);
}
}
}