Class AWTEventMulticaster
- All Implemented Interfaces:
- ActionListener,- AdjustmentListener,- ComponentListener,- ContainerListener,- FocusListener,- HierarchyBoundsListener,- HierarchyListener,- InputMethodListener,- ItemListener,- KeyListener,- MouseListener,- MouseMotionListener,- MouseWheelListener,- TextListener,- WindowFocusListener,- WindowListener,- WindowStateListener,- EventListener
AWTEventMulticaster implements efficient and thread-safe multi-cast
 event dispatching for the AWT events defined in the java.awt.event
 package.
 The following example illustrates how to use this class:
 public myComponent extends Component {
     ActionListener actionListener = null;
     public synchronized void addActionListener(ActionListener l) {
         actionListener = AWTEventMulticaster.add(actionListener, l);
     }
     public synchronized void removeActionListener(ActionListener l) {
         actionListener = AWTEventMulticaster.remove(actionListener, l);
     }
     public void processEvent(AWTEvent e) {
         // when event occurs which causes "action" semantic
         ActionListener listener = actionListener;
         if (listener != null) {
             listener.actionPerformed(new ActionEvent());
         }
     }
 }
 
 add and remove methods is the field maintaining the
 listeners. In addition you must assign the result of the add
 and remove methods to the field maintaining the listeners.
 
 AWTEventMulticaster is implemented as a pair of 
 EventListeners that are set at construction time. 
 AWTEventMulticaster is immutable. The add and 
 remove methods do not alter AWTEventMulticaster in
 anyway. If necessary, a new AWTEventMulticaster is
 created. In this way it is safe to add and remove listeners during
 the process of an event dispatching.  However, event listeners
 added during the process of an event dispatch operation are not
 notified of the event currently being dispatched.
 
 All of the add methods allow null arguments. If the
 first argument is null, the second argument is returned. If
 the first argument is not null and the second argument is
 null, the first argument is returned. If both arguments are
 non-null, a new AWTEventMulticaster is created using
 the two arguments and returned.
 
 For the remove methods that take two arguments, the following is
 returned:
 
- null, if the first argument is- null, or the arguments are equal, by way of- ==.
- the first argument, if the first argument is not an instance of
       AWTEventMulticaster.
- result of invoking remove(EventListener)on the first argument, supplying the second argument to theremove(EventListener)method.
Swing makes use of
 EventListenerList for
 similar logic. Refer to it for details.
- Since:
- 1.1
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final EventListenerA variable in the event chain (listener-a)protected final EventListenerA variable in the event chain (listener-b)
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates an event multicaster instance which chains listener-a with listener-b.
- 
Method SummaryModifier and TypeMethodDescriptionvoidHandles the actionPerformed event by invoking the actionPerformed methods on listener-a and listener-b.static ActionListeneradd(ActionListener a, ActionListener b) Adds action-listener-a with action-listener-b and returns the resulting multicast listener.static AdjustmentListenerAdds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.static ComponentListenerAdds component-listener-a with component-listener-b and returns the resulting multicast listener.static ContainerListenerAdds container-listener-a with container-listener-b and returns the resulting multicast listener.static FocusListeneradd(FocusListener a, FocusListener b) Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.static HierarchyBoundsListenerAdds hierarchy-bounds-listener-a with hierarchy-bounds-listener-b and returns the resulting multicast listener.static HierarchyListenerAdds hierarchy-listener-a with hierarchy-listener-b and returns the resulting multicast listener.static InputMethodListenerAdds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener.static ItemListeneradd(ItemListener a, ItemListener b) Adds item-listener-a with item-listener-b and returns the resulting multicast listener.static KeyListeneradd(KeyListener a, KeyListener b) Adds key-listener-a with key-listener-b and returns the resulting multicast listener.static MouseListeneradd(MouseListener a, MouseListener b) Adds mouse-listener-a with mouse-listener-b and returns the resulting multicast listener.static MouseMotionListenerAdds mouse-motion-listener-a with mouse-motion-listener-b and returns the resulting multicast listener.static MouseWheelListenerAdds mouse-wheel-listener-a with mouse-wheel-listener-b and returns the resulting multicast listener.static TextListeneradd(TextListener a, TextListener b) Adds text-listener-a with text-listener-b and returns the resulting multicast listener.static WindowFocusListenerAdds window-focus-listener-a with window-focus-listener-b and returns the resulting multicast listener.static WindowListeneradd(WindowListener a, WindowListener b) Adds window-listener-a with window-listener-b and returns the resulting multicast listener.static WindowStateListenerAdds window-state-listener-a with window-state-listener-b and returns the resulting multicast listener.protected static EventListenerReturns the resulting multicast listener from adding listener-a and listener-b together.voidHandles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.voidHandles the ancestorMoved event by invoking the ancestorMoved methods on listener-a and listener-b.voidHandles the ancestorResized event by invoking the ancestorResized methods on listener-a and listener-b.voidHandles the caretPositionChanged event by invoking the caretPositionChanged methods on listener-a and listener-b.voidHandles the componentAdded container event by invoking the componentAdded methods on listener-a and listener-b.voidHandles the componentHidden event by invoking the componentHidden methods on listener-a and listener-b.voidHandles the componentMoved event by invoking the componentMoved methods on listener-a and listener-b.voidHandles the componentRemoved container event by invoking the componentRemoved methods on listener-a and listener-b.voidHandles the componentResized event by invoking the componentResized methods on listener-a and listener-b.voidHandles the componentShown event by invoking the componentShown methods on listener-a and listener-b.voidHandles the focusGained event by invoking the focusGained methods on listener-a and listener-b.voidHandles the focusLost event by invoking the focusLost methods on listener-a and listener-b.static <T extends EventListener>
 T[]getListeners(EventListener l, Class<T> listenerType) Returns an array of all the objects chained asFooListeners by the specifiedjava.util.EventListener.voidHandles the hierarchyChanged event by invoking the hierarchyChanged methods on listener-a and listener-b.voidHandles the inputMethodTextChanged event by invoking the inputMethodTextChanged methods on listener-a and listener-b.voidHandles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.voidHandles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b.voidHandles the keyReleased event by invoking the keyReleased methods on listener-a and listener-b.voidHandles the keyTyped event by invoking the keyTyped methods on listener-a and listener-b.voidHandles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.voidHandles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.voidHandles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.voidHandles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.voidHandles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.voidHandles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.voidHandles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.voidHandles the mouseWheelMoved event by invoking the mouseWheelMoved methods on listener-a and listener-b.static ActionListenerremove(ActionListener l, ActionListener oldl) Removes the old action-listener from action-listener-l and returns the resulting multicast listener.static AdjustmentListenerremove(AdjustmentListener l, AdjustmentListener oldl) Removes the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.static ComponentListenerremove(ComponentListener l, ComponentListener oldl) Removes the old component-listener from component-listener-l and returns the resulting multicast listener.static ContainerListenerremove(ContainerListener l, ContainerListener oldl) Removes the old container-listener from container-listener-l and returns the resulting multicast listener.static FocusListenerremove(FocusListener l, FocusListener oldl) Removes the old focus-listener from focus-listener-l and returns the resulting multicast listener.static HierarchyBoundsListenerRemoves the old hierarchy-bounds-listener from hierarchy-bounds-listener-l and returns the resulting multicast listener.static HierarchyListenerremove(HierarchyListener l, HierarchyListener oldl) Removes the old hierarchy-listener from hierarchy-listener-l and returns the resulting multicast listener.static InputMethodListenerremove(InputMethodListener l, InputMethodListener oldl) Removes the old input-method-listener from input-method-listener-l and returns the resulting multicast listener.static ItemListenerremove(ItemListener l, ItemListener oldl) Removes the old item-listener from item-listener-l and returns the resulting multicast listener.static KeyListenerremove(KeyListener l, KeyListener oldl) Removes the old key-listener from key-listener-l and returns the resulting multicast listener.static MouseListenerremove(MouseListener l, MouseListener oldl) Removes the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.static MouseMotionListenerremove(MouseMotionListener l, MouseMotionListener oldl) Removes the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.static MouseWheelListenerremove(MouseWheelListener l, MouseWheelListener oldl) Removes the old mouse-wheel-listener from mouse-wheel-listener-l and returns the resulting multicast listener.static TextListenerremove(TextListener l, TextListener oldl) Removes the old text-listener from text-listener-l and returns the resulting multicast listener.static WindowFocusListenerremove(WindowFocusListener l, WindowFocusListener oldl) Removes the old window-focus-listener from window-focus-listener-l and returns the resulting multicast listener.static WindowListenerremove(WindowListener l, WindowListener oldl) Removes the old window-listener from window-listener-l and returns the resulting multicast listener.static WindowStateListenerremove(WindowStateListener l, WindowStateListener oldl) Removes the old window-state-listener from window-state-listener-l and returns the resulting multicast listener.protected EventListenerremove(EventListener oldl) Removes a listener from this multicaster.protected static EventListenerremoveInternal(EventListener l, EventListener oldl) Returns the resulting multicast listener after removing the old listener from listener-l.protected static voidsave(ObjectOutputStream s, String k, EventListener l) Saves a Serializable listener chain to a serialization stream.protected voidSerialization support.voidInvoked when the value of the text has changed.voidHandles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.voidHandles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.voidHandles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.voidHandles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.voidHandles the windowDeiconified event by invoking the windowDeiconified methods on listener-a and listener-b.voidHandles the windowGainedFocus event by invoking the windowGainedFocus methods on listener-a and listener-b.voidHandles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.voidHandles the windowLostFocus event by invoking the windowLostFocus methods on listener-a and listener-b.voidHandles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.voidHandles the windowStateChanged event by invoking the windowStateChanged methods on listener-a and listener-b.
- 
Field Details- 
aA variable in the event chain (listener-a)
- 
bA variable in the event chain (listener-b)
 
- 
- 
Constructor Details- 
AWTEventMulticasterCreates an event multicaster instance which chains listener-a with listener-b. Input parametersaandbshould not benull, though implementations may vary in choosing whether or not to throwNullPointerExceptionin that case.- Parameters:
- a- listener-a
- b- listener-b
 
 
- 
- 
Method Details- 
removeRemoves a listener from this multicaster.The returned multicaster contains all the listeners in this multicaster with the exception of all occurrences of oldl. If the resulting multicaster contains only one regular listener the regular listener may be returned. If the resulting multicaster is empty, thennullmay be returned instead.No exception is thrown if oldlisnull.- Parameters:
- oldl- the listener to be removed
- Returns:
- resulting listener
 
- 
componentResizedHandles the componentResized event by invoking the componentResized methods on listener-a and listener-b.- Specified by:
- componentResizedin interface- ComponentListener
- Parameters:
- e- the component event
 
- 
componentMovedHandles the componentMoved event by invoking the componentMoved methods on listener-a and listener-b.- Specified by:
- componentMovedin interface- ComponentListener
- Parameters:
- e- the component event
 
- 
componentShownHandles the componentShown event by invoking the componentShown methods on listener-a and listener-b.- Specified by:
- componentShownin interface- ComponentListener
- Parameters:
- e- the component event
 
- 
componentHiddenHandles the componentHidden event by invoking the componentHidden methods on listener-a and listener-b.- Specified by:
- componentHiddenin interface- ComponentListener
- Parameters:
- e- the component event
 
- 
componentAddedHandles the componentAdded container event by invoking the componentAdded methods on listener-a and listener-b.- Specified by:
- componentAddedin interface- ContainerListener
- Parameters:
- e- the component event
 
- 
componentRemovedHandles the componentRemoved container event by invoking the componentRemoved methods on listener-a and listener-b.- Specified by:
- componentRemovedin interface- ContainerListener
- Parameters:
- e- the component event
 
- 
focusGainedHandles the focusGained event by invoking the focusGained methods on listener-a and listener-b.- Specified by:
- focusGainedin interface- FocusListener
- Parameters:
- e- the focus event
 
- 
focusLostHandles the focusLost event by invoking the focusLost methods on listener-a and listener-b.- Specified by:
- focusLostin interface- FocusListener
- Parameters:
- e- the focus event
 
- 
keyTypedHandles the keyTyped event by invoking the keyTyped methods on listener-a and listener-b.- Specified by:
- keyTypedin interface- KeyListener
- Parameters:
- e- the key event
 
- 
keyPressedHandles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b.- Specified by:
- keyPressedin interface- KeyListener
- Parameters:
- e- the key event
 
- 
keyReleasedHandles the keyReleased event by invoking the keyReleased methods on listener-a and listener-b.- Specified by:
- keyReleasedin interface- KeyListener
- Parameters:
- e- the key event
 
- 
mouseClickedHandles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.- Specified by:
- mouseClickedin interface- MouseListener
- Parameters:
- e- the mouse event
 
- 
mousePressedHandles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.- Specified by:
- mousePressedin interface- MouseListener
- Parameters:
- e- the mouse event
 
- 
mouseReleasedHandles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.- Specified by:
- mouseReleasedin interface- MouseListener
- Parameters:
- e- the mouse event
 
- 
mouseEnteredHandles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.- Specified by:
- mouseEnteredin interface- MouseListener
- Parameters:
- e- the mouse event
 
- 
mouseExitedHandles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.- Specified by:
- mouseExitedin interface- MouseListener
- Parameters:
- e- the mouse event
 
- 
mouseDraggedHandles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.- Specified by:
- mouseDraggedin interface- MouseMotionListener
- Parameters:
- e- the mouse event
 
- 
mouseMovedHandles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.- Specified by:
- mouseMovedin interface- MouseMotionListener
- Parameters:
- e- the mouse event
 
- 
windowOpenedHandles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.- Specified by:
- windowOpenedin interface- WindowListener
- Parameters:
- e- the window event
 
- 
windowClosingHandles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.- Specified by:
- windowClosingin interface- WindowListener
- Parameters:
- e- the window event
 
- 
windowClosedHandles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.- Specified by:
- windowClosedin interface- WindowListener
- Parameters:
- e- the window event
 
- 
windowIconifiedHandles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.- Specified by:
- windowIconifiedin interface- WindowListener
- Parameters:
- e- the window event
- See Also:
 
- 
windowDeiconifiedHandles the windowDeiconified event by invoking the windowDeiconified methods on listener-a and listener-b.- Specified by:
- windowDeiconifiedin interface- WindowListener
- Parameters:
- e- the window event
 
- 
windowActivatedHandles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.- Specified by:
- windowActivatedin interface- WindowListener
- Parameters:
- e- the window event
 
- 
windowDeactivatedHandles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.- Specified by:
- windowDeactivatedin interface- WindowListener
- Parameters:
- e- the window event
 
- 
windowStateChangedHandles the windowStateChanged event by invoking the windowStateChanged methods on listener-a and listener-b.- Specified by:
- windowStateChangedin interface- WindowStateListener
- Parameters:
- e- the window event
- Since:
- 1.4
 
- 
windowGainedFocusHandles the windowGainedFocus event by invoking the windowGainedFocus methods on listener-a and listener-b.- Specified by:
- windowGainedFocusin interface- WindowFocusListener
- Parameters:
- e- the window event
- Since:
- 1.4
 
- 
windowLostFocusHandles the windowLostFocus event by invoking the windowLostFocus methods on listener-a and listener-b.- Specified by:
- windowLostFocusin interface- WindowFocusListener
- Parameters:
- e- the window event
- Since:
- 1.4
 
- 
actionPerformedHandles the actionPerformed event by invoking the actionPerformed methods on listener-a and listener-b.- Specified by:
- actionPerformedin interface- ActionListener
- Parameters:
- e- the action event
 
- 
itemStateChangedHandles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.- Specified by:
- itemStateChangedin interface- ItemListener
- Parameters:
- e- the item event
 
- 
adjustmentValueChangedHandles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.- Specified by:
- adjustmentValueChangedin interface- AdjustmentListener
- Parameters:
- e- the adjustment event
 
- 
textValueChangedDescription copied from interface:TextListenerInvoked when the value of the text has changed. The code written for this method performs the operations that need to occur when text changes.- Specified by:
- textValueChangedin interface- TextListener
- Parameters:
- e- the event to be processed
 
- 
inputMethodTextChangedHandles the inputMethodTextChanged event by invoking the inputMethodTextChanged methods on listener-a and listener-b.- Specified by:
- inputMethodTextChangedin interface- InputMethodListener
- Parameters:
- e- the item event
 
- 
caretPositionChangedHandles the caretPositionChanged event by invoking the caretPositionChanged methods on listener-a and listener-b.- Specified by:
- caretPositionChangedin interface- InputMethodListener
- Parameters:
- e- the item event
 
- 
hierarchyChangedHandles the hierarchyChanged event by invoking the hierarchyChanged methods on listener-a and listener-b.- Specified by:
- hierarchyChangedin interface- HierarchyListener
- Parameters:
- e- the item event
- Since:
- 1.3
- See Also:
 
- 
ancestorMovedHandles the ancestorMoved event by invoking the ancestorMoved methods on listener-a and listener-b.- Specified by:
- ancestorMovedin interface- HierarchyBoundsListener
- Parameters:
- e- the item event
- Since:
- 1.3
 
- 
ancestorResizedHandles the ancestorResized event by invoking the ancestorResized methods on listener-a and listener-b.- Specified by:
- ancestorResizedin interface- HierarchyBoundsListener
- Parameters:
- e- the item event
- Since:
- 1.3
 
- 
mouseWheelMovedHandles the mouseWheelMoved event by invoking the mouseWheelMoved methods on listener-a and listener-b.- Specified by:
- mouseWheelMovedin interface- MouseWheelListener
- Parameters:
- e- the mouse event
- Since:
- 1.4
- See Also:
 
- 
addAdds component-listener-a with component-listener-b and returns the resulting multicast listener.- Parameters:
- a- component-listener-a
- b- component-listener-b
- Returns:
- the resulting listener
 
- 
addAdds container-listener-a with container-listener-b and returns the resulting multicast listener.- Parameters:
- a- container-listener-a
- b- container-listener-b
- Returns:
- the resulting listener
 
- 
addAdds focus-listener-a with focus-listener-b and returns the resulting multicast listener.- Parameters:
- a- focus-listener-a
- b- focus-listener-b
- Returns:
- the resulting listener
 
- 
addAdds key-listener-a with key-listener-b and returns the resulting multicast listener.- Parameters:
- a- key-listener-a
- b- key-listener-b
- Returns:
- the resulting listener
 
- 
addAdds mouse-listener-a with mouse-listener-b and returns the resulting multicast listener.- Parameters:
- a- mouse-listener-a
- b- mouse-listener-b
- Returns:
- the resulting listener
 
- 
addAdds mouse-motion-listener-a with mouse-motion-listener-b and returns the resulting multicast listener.- Parameters:
- a- mouse-motion-listener-a
- b- mouse-motion-listener-b
- Returns:
- the resulting listener
 
- 
addAdds window-listener-a with window-listener-b and returns the resulting multicast listener.- Parameters:
- a- window-listener-a
- b- window-listener-b
- Returns:
- the resulting listener
 
- 
addAdds window-state-listener-a with window-state-listener-b and returns the resulting multicast listener.- Parameters:
- a- window-state-listener-a
- b- window-state-listener-b
- Returns:
- the resulting listener
- Since:
- 1.4
 
- 
addAdds window-focus-listener-a with window-focus-listener-b and returns the resulting multicast listener.- Parameters:
- a- window-focus-listener-a
- b- window-focus-listener-b
- Returns:
- the resulting listener
- Since:
- 1.4
 
- 
addAdds action-listener-a with action-listener-b and returns the resulting multicast listener.- Parameters:
- a- action-listener-a
- b- action-listener-b
- Returns:
- the resulting listener
 
- 
addAdds item-listener-a with item-listener-b and returns the resulting multicast listener.- Parameters:
- a- item-listener-a
- b- item-listener-b
- Returns:
- the resulting listener
 
- 
addAdds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.- Parameters:
- a- adjustment-listener-a
- b- adjustment-listener-b
- Returns:
- the resulting listener
 
- 
addAdds text-listener-a with text-listener-b and returns the resulting multicast listener.- Parameters:
- a- text-listener-a
- b- text-listener-b
- Returns:
- the resulting listener
 
- 
addAdds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener.- Parameters:
- a- input-method-listener-a
- b- input-method-listener-b
- Returns:
- the resulting listener
 
- 
addAdds hierarchy-listener-a with hierarchy-listener-b and returns the resulting multicast listener.- Parameters:
- a- hierarchy-listener-a
- b- hierarchy-listener-b
- Returns:
- the resulting listener
- Since:
- 1.3
 
- 
addAdds hierarchy-bounds-listener-a with hierarchy-bounds-listener-b and returns the resulting multicast listener.- Parameters:
- a- hierarchy-bounds-listener-a
- b- hierarchy-bounds-listener-b
- Returns:
- the resulting listener
- Since:
- 1.3
 
- 
addAdds mouse-wheel-listener-a with mouse-wheel-listener-b and returns the resulting multicast listener.- Parameters:
- a- mouse-wheel-listener-a
- b- mouse-wheel-listener-b
- Returns:
- the resulting listener
- Since:
- 1.4
 
- 
removeRemoves the old component-listener from component-listener-l and returns the resulting multicast listener.- Parameters:
- l- component-listener-l
- oldl- the component-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old container-listener from container-listener-l and returns the resulting multicast listener.- Parameters:
- l- container-listener-l
- oldl- the container-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old focus-listener from focus-listener-l and returns the resulting multicast listener.- Parameters:
- l- focus-listener-l
- oldl- the focus-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old key-listener from key-listener-l and returns the resulting multicast listener.- Parameters:
- l- key-listener-l
- oldl- the key-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.- Parameters:
- l- mouse-listener-l
- oldl- the mouse-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.- Parameters:
- l- mouse-motion-listener-l
- oldl- the mouse-motion-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old window-listener from window-listener-l and returns the resulting multicast listener.- Parameters:
- l- window-listener-l
- oldl- the window-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old window-state-listener from window-state-listener-l and returns the resulting multicast listener.- Parameters:
- l- window-state-listener-l
- oldl- the window-state-listener being removed
- Returns:
- the resulting listener
- Since:
- 1.4
 
- 
removeRemoves the old window-focus-listener from window-focus-listener-l and returns the resulting multicast listener.- Parameters:
- l- window-focus-listener-l
- oldl- the window-focus-listener being removed
- Returns:
- the resulting listener
- Since:
- 1.4
 
- 
removeRemoves the old action-listener from action-listener-l and returns the resulting multicast listener.- Parameters:
- l- action-listener-l
- oldl- the action-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old item-listener from item-listener-l and returns the resulting multicast listener.- Parameters:
- l- item-listener-l
- oldl- the item-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.- Parameters:
- l- adjustment-listener-l
- oldl- the adjustment-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old text-listener from text-listener-l and returns the resulting multicast listener.- Parameters:
- l- text-listener-l
- oldl- the text-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old input-method-listener from input-method-listener-l and returns the resulting multicast listener.- Parameters:
- l- input-method-listener-l
- oldl- the input-method-listener being removed
- Returns:
- the resulting listener
 
- 
removeRemoves the old hierarchy-listener from hierarchy-listener-l and returns the resulting multicast listener.- Parameters:
- l- hierarchy-listener-l
- oldl- the hierarchy-listener being removed
- Returns:
- the resulting listener
- Since:
- 1.3
 
- 
removepublic static HierarchyBoundsListener remove(HierarchyBoundsListener l, HierarchyBoundsListener oldl) Removes the old hierarchy-bounds-listener from hierarchy-bounds-listener-l and returns the resulting multicast listener.- Parameters:
- l- hierarchy-bounds-listener-l
- oldl- the hierarchy-bounds-listener being removed
- Returns:
- the resulting listener
- Since:
- 1.3
 
- 
removeRemoves the old mouse-wheel-listener from mouse-wheel-listener-l and returns the resulting multicast listener.- Parameters:
- l- mouse-wheel-listener-l
- oldl- the mouse-wheel-listener being removed
- Returns:
- the resulting listener
- Since:
- 1.4
 
- 
addInternalReturns the resulting multicast listener from adding listener-a and listener-b together. If listener-a is null, it returns listener-b; If listener-b is null, it returns listener-a If neither are null, then it creates and returns a new AWTEventMulticaster instance which chains a with b.- Parameters:
- a- event listener-a
- b- event listener-b
- Returns:
- the resulting listener
 
- 
removeInternalReturns the resulting multicast listener after removing the old listener from listener-l. If listener-l equals the old listener OR listener-l is null, returns null. Else if listener-l is an instance of AWTEventMulticaster, then it removes the old listener from it. Else, returns listener l.- Parameters:
- l- the listener being removed from
- oldl- the listener being removed
- Returns:
- the resulting listener
 
- 
saveInternalSerialization support. Saves all Serializable listeners to a serialization stream.- Parameters:
- s- the stream to save to
- k- a prefix stream to put before each serializable listener
- Throws:
- IOException- if serialization fails
 
- 
saveSaves a Serializable listener chain to a serialization stream.- Parameters:
- s- the stream to save to
- k- a prefix stream to put before each serializable listener
- l- the listener chain to save
- Throws:
- IOException- if serialization fails
 
- 
getListenersReturns an array of all the objects chained asFooListeners by the specifiedjava.util.EventListener.FooListeners are chained by theAWTEventMulticasterusing theaddFooListenermethod. If anulllistener is specified, this method returns an empty array. If the specified listener is not an instance ofAWTEventMulticaster, this method returns an array which contains only the specified listener. If no such listeners are chained, this method returns an empty array.- Type Parameters:
- T- the listener type
- Parameters:
- l- the specified- java.util.EventListener
- listenerType- the type of listeners requested; this parameter should specify an interface that descends from- java.util.EventListener
- Returns:
- an array of all objects chained as
          FooListeners by the specified multicast listener, or an empty array if no such listeners have been chained by the specified multicast listener
- Throws:
- NullPointerException- if the specified- listenerTypeparameter is- null
- ClassCastException- if- listenerTypedoesn't specify a class or interface that implements- java.util.EventListener
- Since:
- 1.4
 
 
-