本文整理汇总了Java中java.awt.AWTEventMulticaster.getListeners方法的典型用法代码示例。如果您正苦于以下问题:Java AWTEventMulticaster.getListeners方法的具体用法?Java AWTEventMulticaster.getListeners怎么用?Java AWTEventMulticaster.getListeners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.AWTEventMulticaster
的用法示例。
在下文中一共展示了AWTEventMulticaster.getListeners方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getListeners
import java.awt.AWTEventMulticaster; //导入方法依赖的package包/类
<T extends EventListener> T[] getListeners(Class<T> listenerType) {
EventListener l = null;
if (listenerType == MouseListener.class) {
l = mouseListener;
} else if (listenerType == MouseMotionListener.class) {
l = mouseMotionListener;
} else if (listenerType == ActionListener.class) {
l = actionListener;
}
return AWTEventMulticaster.getListeners(l, listenerType);
}
示例2: test_getListeners
import java.awt.AWTEventMulticaster; //导入方法依赖的package包/类
public void test_getListeners() {
DefaultEditorKit.PasteAction pa = new DefaultEditorKit.PasteAction();
DefaultEditorKit.PasteAction[] result = AWTEventMulticaster.getListeners(pa, DefaultEditorKit.PasteAction.class);
assertNotNull(result);
}
示例3: getMouseListeners
import java.awt.AWTEventMulticaster; //导入方法依赖的package包/类
/**
* Returns an array of all the mouse listeners
* registered on this <code>TrayIcon</code>.
*
* @return all of the <code>MouseListeners</code> registered on
* this <code>TrayIcon</code> or an empty array if no mouse
* listeners are currently registered
*
* @see #addMouseListener(MouseListener)
* @see #removeMouseListener(MouseListener)
* @see java.awt.event.MouseListener
*/
public synchronized MouseListener[] getMouseListeners() {
return AWTEventMulticaster.getListeners(mouseListener, MouseListener.class);
}
示例4: getMouseMotionListeners
import java.awt.AWTEventMulticaster; //导入方法依赖的package包/类
/**
* Returns an array of all the mouse-motion listeners
* registered on this <code>TrayIcon</code>.
*
* @return all of the <code>MouseInputListeners</code> registered on
* this <code>TrayIcon</code> or an empty array if no mouse
* listeners are currently registered
*
* @see #addMouseMotionListener(MouseMotionListener)
* @see #removeMouseMotionListener(MouseMotionListener)
* @see java.awt.event.MouseMotionListener
*/
public synchronized MouseMotionListener[] getMouseMotionListeners() {
return AWTEventMulticaster.getListeners(mouseMotionListener, MouseMotionListener.class);
}
示例5: getActionListeners
import java.awt.AWTEventMulticaster; //导入方法依赖的package包/类
/**
* Returns an array of all the action listeners
* registered on this <code>TrayIcon</code>.
*
* @return all of the <code>ActionListeners</code> registered on
* this <code>TrayIcon</code> or an empty array if no action
* listeners are currently registered
*
* @see #addActionListener(ActionListener)
* @see #removeActionListener(ActionListener)
* @see java.awt.event.ActionListener
*/
public synchronized ActionListener[] getActionListeners() {
return AWTEventMulticaster.getListeners(actionListener, ActionListener.class);
}