<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); }
public void addLocalMouseListenerFirst(MouseListener l) { multicaster = AWTEventMulticaster.add(l, multicaster); }
public void removeLocalMouseListener(MouseListener l) { multicaster = AWTEventMulticaster.remove(multicaster, l); }
protected static void save(ObjectOutputStream s, String k, EventListener l) throws IOException { AWTEventMulticaster.save(s, k, l); }
public void addActionListener (ActionListener actionListener) { actionListenerList = AWTEventMulticaster.add (actionListenerList, actionListener); }
public void removeActionListener (ActionListener actionListener) { actionListenerList = AWTEventMulticaster.remove (actionListenerList, actionListener); }
@Override public void addActionListener (ActionListener actionListener) { actionListenerList = AWTEventMulticaster.add (actionListenerList, actionListener); }
@Override public void removeActionListener (ActionListener actionListener) { actionListenerList = AWTEventMulticaster.remove (actionListenerList, actionListener); }
public synchronized void addActionListener(ActionListener l) { _listener = AWTEventMulticaster.add(_listener, l); }
public synchronized void removeActionListener(ActionListener l) { _listener = AWTEventMulticaster.remove(_listener, l); }
public void addActionListener( ActionListener l ) { synchronized( sync ) { actionListener = AWTEventMulticaster.add( actionListener, l ); } }
public void removeActionListener( ActionListener l ) { synchronized( sync ) { actionListener = AWTEventMulticaster.remove( actionListener, l ); } }
public void test_getListeners() { DefaultEditorKit.PasteAction pa = new DefaultEditorKit.PasteAction(); DefaultEditorKit.PasteAction[] result = AWTEventMulticaster.getListeners(pa, DefaultEditorKit.PasteAction.class); assertNotNull(result); }
/** * Adds the specified mouse listener to receive mouse events from * this <code>TrayIcon</code>. Calling this method with a * <code>null</code> value has no effect. * * <p><b>Note</b>: The {@code MouseEvent}'s coordinates (received * from the {@code TrayIcon}) are relative to the screen, not the * {@code TrayIcon}. * * <p> <b>Note: </b>The <code>MOUSE_ENTERED</code> and * <code>MOUSE_EXITED</code> mouse events are not supported. * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param listener the mouse listener * @see java.awt.event.MouseEvent * @see java.awt.event.MouseListener * @see #removeMouseListener(MouseListener) * @see #getMouseListeners */ public synchronized void addMouseListener(MouseListener listener) { if (listener == null) { return; } mouseListener = AWTEventMulticaster.add(mouseListener, listener); }
/** * Removes the specified mouse listener. Calling this method with * <code>null</code> or an invalid value has no effect. * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param listener the mouse listener * @see java.awt.event.MouseEvent * @see java.awt.event.MouseListener * @see #addMouseListener(MouseListener) * @see #getMouseListeners */ public synchronized void removeMouseListener(MouseListener listener) { if (listener == null) { return; } mouseListener = AWTEventMulticaster.remove(mouseListener, listener); }
/** * Adds the specified mouse listener to receive mouse-motion * events from this <code>TrayIcon</code>. Calling this method * with a <code>null</code> value has no effect. * * <p><b>Note</b>: The {@code MouseEvent}'s coordinates (received * from the {@code TrayIcon}) are relative to the screen, not the * {@code TrayIcon}. * * <p> <b>Note: </b>The <code>MOUSE_DRAGGED</code> mouse event is not supported. * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param listener the mouse listener * @see java.awt.event.MouseEvent * @see java.awt.event.MouseMotionListener * @see #removeMouseMotionListener(MouseMotionListener) * @see #getMouseMotionListeners */ public synchronized void addMouseMotionListener(MouseMotionListener listener) { if (listener == null) { return; } mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener); }
/** * Removes the specified mouse-motion listener. Calling this method with * <code>null</code> or an invalid value has no effect. * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param listener the mouse listener * @see java.awt.event.MouseEvent * @see java.awt.event.MouseMotionListener * @see #addMouseMotionListener(MouseMotionListener) * @see #getMouseMotionListeners */ public synchronized void removeMouseMotionListener(MouseMotionListener listener) { if (listener == null) { return; } mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, listener); }
/** * Adds the specified action listener to receive * <code>ActionEvent</code>s from this <code>TrayIcon</code>. * Action events usually occur when a user selects the tray icon, * using either the mouse or keyboard. The conditions in which * action events are generated are platform-dependent. * * <p>Calling this method with a <code>null</code> value has no * effect. * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param listener the action listener * @see #removeActionListener * @see #getActionListeners * @see java.awt.event.ActionListener * @see #setActionCommand(String) */ public synchronized void addActionListener(ActionListener listener) { if (listener == null) { return; } actionListener = AWTEventMulticaster.add(actionListener, listener); }
/** * Removes the specified action listener. Calling this method with * <code>null</code> or an invalid value has no effect. * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param listener the action listener * @see java.awt.event.ActionEvent * @see java.awt.event.ActionListener * @see #addActionListener(ActionListener) * @see #getActionListeners * @see #setActionCommand(String) */ public synchronized void removeActionListener(ActionListener listener) { if (listener == null) { return; } actionListener = AWTEventMulticaster.remove(actionListener, listener); }