本文整理匯總了Java中javax.swing.event.EventListenerList.getListeners方法的典型用法代碼示例。如果您正苦於以下問題:Java EventListenerList.getListeners方法的具體用法?Java EventListenerList.getListeners怎麽用?Java EventListenerList.getListeners使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.event.EventListenerList
的用法示例。
在下文中一共展示了EventListenerList.getListeners方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processEvent
import javax.swing.event.EventListenerList; //導入方法依賴的package包/類
/**
* Process Events - Give each node in the pick path, starting at the bottom
* most one, a chance to handle the event.
*
* @param event event to be processed
* @param eventType the type of event being processed
*/
public void processEvent(final PInputEvent event, final int eventType) {
event.setPath(this);
for (int i = nodeStack.size() - 1; i >= 0; i--) {
final PNode each = (PNode) nodeStack.get(i);
final EventListenerList list = each.getListenerList();
if (list != null) {
final Object[] listeners = list.getListeners(PInputEventListener.class);
for (int j = 0; j < listeners.length; j++) {
final PInputEventListener listener = (PInputEventListener) listeners[j];
listener.processEvent(event, eventType);
if (event.isHandled()) {
return;
}
}
}
}
}