API java : AWTEventMulticaster


java.awt
Class AWTEventMulticaster

java.lang.Object
  extended by java.awt.AWTEventMulticaster
All Implemented Interfaces:
ActionListener, AdjustmentListener, ComponentListener, ContainerListener, FocusListener, HierarchyBoundsListener, HierarchyListener, InputMethodListener, ItemListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, TextListener, WindowFocusListener, WindowListener, WindowStateListener, EventListener

public class AWTEventMulticaster
extends Object
implements ComponentListener, ContainerListener, FocusListener, KeyListener, MouseListener, MouseMotionListener, WindowListener, WindowFocusListener, WindowStateListener, ActionListener, ItemListener, AdjustmentListener, TextListener, InputMethodListener, HierarchyListener, HierarchyBoundsListener, MouseWheelListener

A class which implements efficient and thread-safe multi-cast event dispatching for the AWT events defined in the java.awt.event package. This class will manage an immutable structure consisting of a chain of event listeners and will dispatch events to those listeners. Because the structure is immutable, it is safe to use this API to add/remove listeners during the process of an event dispatch operation. However, event listeners added during the process of an event dispatch operation will not be notified of the event currently being dispatched. An example of how this class could be used to implement a new component which fires "action" events:

  1. <code>
  2. public myComponent extends Component {
  3. ActionListener actionListener = null;
  4.  
  5. public synchronized void addActionListener(ActionListener l) {
  6. actionListener = AWTEventMulticaster.add(actionListener, l);
  7. }
  8. public synchronized void removeActionListener(ActionListener l) {
  9. actionListener = AWTEventMulticaster.remove(actionListener, l);
  10. }
  11. public void processEvent(AWTEvent e) {
  12. // when event occurs which causes "action" semantic
  13. ActionListener listener = actionListener;
  14. if (listener != null) {
  15. listener.actionPerformed(new ActionEvent());
  16. }
  17. }
  18. }
  19. </code>

Since:
1.1

Field Summary
protected EventListener a
protected EventListener b
Constructor Summary
protected AWTEventMulticaster(EventListenera, EventListenerb)
Creates an event multicaster instance which chains listener-a with listener-b.
Method Summary
void actionPerformed(ActionEvente)
Handles the actionPerformed event by invoking the actionPerformed methods on listener-a and listener-b.
staticActionListener add(ActionListenera, ActionListenerb)
Adds action-listener-a with action-listener-b and returns the resulting multicast listener.
staticAdjustmentListener add(AdjustmentListenera, AdjustmentListenerb)
Adds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.
staticComponentListener add(ComponentListenera, ComponentListenerb)
Adds component-listener-a with component-listener-b and returns the resulting multicast listener.
staticContainerListener add(ContainerListenera, ContainerListenerb)
Adds container-listener-a with container-listener-b and returns the resulting multicast listener.
staticFocusListener add(FocusListenera, FocusListenerb)
Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.
staticHierarchyBoundsListener add(HierarchyBoundsListenera, HierarchyBoundsListenerb)
Adds hierarchy-bounds-listener-a with hierarchy-bounds-listener-b and returns the resulting multicast listener.
staticHierarchyListener add(HierarchyListenera, HierarchyListenerb)
Adds hierarchy-listener-a with hierarchy-listener-b and returns the resulting multicast listener.
staticInputMethodListener add(InputMethodListenera, InputMethodListenerb)
Adds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener.
staticItemListener add(ItemListenera, ItemListenerb)
Adds item-listener-a with item-listener-b and returns the resulting multicast listener.
staticKeyListener add(KeyListenera, KeyListenerb)
Adds key-listener-a with key-listener-b and returns the resulting multicast listener.
staticMouseListener add(MouseListenera, MouseListenerb)
Adds mouse-listener-a with mouse-listener-b and returns the resulting multicast listener.
staticMouseMotionListener add(MouseMotionListenera, MouseMotionListenerb)
Adds mouse-motion-listener-a with mouse-motion-listener-b and returns the resulting multicast listener.
staticMouseWheelListener add(MouseWheelListenera, MouseWheelListenerb)
Adds mouse-wheel-listener-a with mouse-wheel-listener-b and returns the resulting multicast listener.
staticTextListener add(TextListenera, TextListenerb)
staticWindowFocusListener add(WindowFocusListenera, WindowFocusListenerb)
Adds window-focus-listener-a with window-focus-listener-b and returns the resulting multicast listener.
staticWindowListener add(WindowListenera, WindowListenerb)
Adds window-listener-a with window-listener-b and returns the resulting multicast listener.
staticWindowStateListener add(WindowStateListenera, WindowStateListenerb)
Adds window-state-listener-a with window-state-listener-b and returns the resulting multicast listener.
protected staticEventListener addInternal(EventListenera, EventListenerb)
Returns the resulting multicast listener from adding listener-a and listener-b together.
void adjustmentValueChanged(AdjustmentEvente)
Handles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.
void ancestorMoved(HierarchyEvente)
Handles the ancestorMoved event by invoking the ancestorMoved methods on listener-a and listener-b.
void ancestorResized(HierarchyEvente)
Handles the ancestorResized event by invoking the ancestorResized methods on listener-a and listener-b.
void caretPositionChanged(InputMethodEvente)
Handles the caretPositionChanged event by invoking the caretPositionChanged methods on listener-a and listener-b.
void componentAdded(ContainerEvente)
Handles the componentAdded container event by invoking the componentAdded methods on listener-a and listener-b.
void componentHidden(ComponentEvente)
Handles the componentHidden event by invoking the componentHidden methods on listener-a and listener-b.
void componentMoved(ComponentEvente)
Handles the componentMoved event by invoking the componentMoved methods on listener-a and listener-b.
void componentRemoved(ContainerEvente)
Handles the componentRemoved container event by invoking the componentRemoved methods on listener-a and listener-b.
void componentResized(ComponentEvente)
Handles the componentResized event by invoking the componentResized methods on listener-a and listener-b.
void componentShown(ComponentEvente)
Handles the componentShown event by invoking the componentShown methods on listener-a and listener-b.
void focusGained(FocusEvente)
Handles the focusGained event by invoking the focusGained methods on listener-a and listener-b.
void focusLost(FocusEvente)
Handles the focusLost event by invoking the focusLost methods on listener-a and listener-b.
static
EventListener>
T[]
getListeners(EventListenerl, ClasslistenerType)
Returns an array of all the objects chained as FooListeners by the specified java.util.EventListener.
void hierarchyChanged(HierarchyEvente)
Handles the hierarchyChanged event by invoking the hierarchyChanged methods on listener-a and listener-b.
void inputMethodTextChanged(InputMethodEvente)
Handles the inputMethodTextChanged event by invoking the inputMethodTextChanged methods on listener-a and listener-b.
void itemStateChanged(ItemEvente)
Handles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.
void keyPressed(KeyEvente)
Handles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b.
void keyReleased(KeyEvente)
Handles the keyReleased event by invoking the keyReleased methods on listener-a and listener-b.
void keyTyped(KeyEvente)
Handles the keyTyped event by invoking the keyTyped methods on listener-a and listener-b.
void mouseClicked(MouseEvente)
Handles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.
void mouseDragged(MouseEvente)
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.
void mouseEntered(MouseEvente)
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.
void mouseExited(MouseEvente)
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.
void mouseMoved(MouseEvente)
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.
void mousePressed(MouseEvente)
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.
void mouseReleased(MouseEvente)
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.
void mouseWheelMoved(MouseWheelEvente)
Handles the mouseWheelMoved event by invoking the mouseWheelMoved methods on listener-a and listener-b.
staticActionListener remove(ActionListenerl, ActionListeneroldl)
Removes the old action-listener from action-listener-l and returns the resulting multicast listener.
staticAdjustmentListener remove(AdjustmentListenerl, AdjustmentListeneroldl)
Removes the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.
staticComponentListener remove(ComponentListenerl, ComponentListeneroldl)
Removes the old component-listener from component-listener-l and returns the resulting multicast listener.
staticContainerListener remove(ContainerListenerl, ContainerListeneroldl)
Removes the old container-listener from container-listener-l and returns the resulting multicast listener.
protected EventListener remove(EventListeneroldl)
Removes a listener from this multicaster and returns the resulting multicast listener.
staticFocusListener remove(FocusListenerl, FocusListeneroldl)
Removes the old focus-listener from focus-listener-l and returns the resulting multicast listener.
staticHierarchyBoundsListener remove(HierarchyBoundsListenerl, HierarchyBoundsListeneroldl)
Removes the old hierarchy-bounds-listener from hierarchy-bounds-listener-l and returns the resulting multicast listener.
staticHierarchyListener remove(HierarchyListenerl, HierarchyListeneroldl)
Removes the old hierarchy-listener from hierarchy-listener-l and returns the resulting multicast listener.
staticInputMethodListener remove(InputMethodListenerl, InputMethodListeneroldl)
Removes the old input-method-listener from input-method-listener-l and returns the resulting multicast listener.
staticItemListener remove(ItemListenerl, ItemListeneroldl)
Removes the old item-listener from item-listener-l and returns the resulting multicast listener.
staticKeyListener remove(KeyListenerl, KeyListeneroldl)
Removes the old key-listener from key-listener-l and returns the resulting multicast listener.
staticMouseListener remove(MouseListenerl, MouseListeneroldl)
Removes the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.
staticMouseMotionListener remove(MouseMotionListenerl, MouseMotionListeneroldl)
Removes the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.
staticMouseWheelListener remove(MouseWheelListenerl, MouseWheelListeneroldl)
Removes the old mouse-wheel-listener from mouse-wheel-listener-l and returns the resulting multicast listener.
staticTextListener remove(TextListenerl, TextListeneroldl)
staticWindowFocusListener remove(WindowFocusListenerl, WindowFocusListeneroldl)
Removes the old window-focus-listener from window-focus-listener-l and returns the resulting multicast listener.
staticWindowListener remove(WindowListenerl, WindowListeneroldl)
Removes the old window-listener from window-listener-l and returns the resulting multicast listener.
staticWindowStateListener remove(WindowStateListenerl, WindowStateListeneroldl)
Removes the old window-state-listener from window-state-listener-l and returns the resulting multicast listener.
protected staticEventListener removeInternal(EventListenerl, EventListeneroldl)
Returns the resulting multicast listener after removing the old listener from listener-l.
protected staticvoid save(ObjectOutputStreams, Stringk, EventListenerl)
protected void saveInternal(ObjectOutputStreams, Stringk)
void textValueChanged(TextEvente)
Invoked when the value of the text has changed.
void windowActivated(WindowEvente)
Handles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.
void windowClosed(WindowEvente)
Handles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.
void windowClosing(WindowEvente)
Handles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.
void windowDeactivated(WindowEvente)
Handles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.
void windowDeiconified(WindowEvente)
Handles the windowDeiconfied event by invoking the windowDeiconified methods on listener-a and listener-b.
void windowGainedFocus(WindowEvente)
Handles the windowGainedFocus event by invoking the windowGainedFocus methods on listener-a and listener-b.
void windowIconified(WindowEvente)
Handles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.
void windowLostFocus(WindowEvente)
Handles the windowLostFocus event by invoking the windowLostFocus methods on listener-a and listener-b.
void windowOpened(WindowEvente)
Handles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.
void windowStateChanged(WindowEvente)
Handles the windowStateChanged event by invoking the windowStateChanged methods on listener-a and listener-b.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

a

protected final EventListener a

b

protected final EventListener b
Constructor Detail

AWTEventMulticaster

protected AWTEventMulticaster(EventListenera,
                              EventListenerb)
Creates an event multicaster instance which chains listener-a with listener-b. Input parameters a and b should not be null, though implementations may vary in choosing whether or not to throw NullPointerException in that case.

Parameters:
a - listener-a
b - listener-b
Method Detail

remove

protected EventListener remove(EventListeneroldl)
Removes a listener from this multicaster and returns the resulting multicast listener.

Parameters:
oldl - the listener to be removed

componentResized

public void componentResized(ComponentEvente)
Handles the componentResized event by invoking the componentResized methods on listener-a and listener-b.

Specified by:
componentResized in interface ComponentListener
Parameters:
e - the component event

componentMoved

public void componentMoved(ComponentEvente)
Handles the componentMoved event by invoking the componentMoved methods on listener-a and listener-b.

Specified by:
componentMoved in interface ComponentListener
Parameters:
e - the component event

componentShown

public void componentShown(ComponentEvente)
Handles the componentShown event by invoking the componentShown methods on listener-a and listener-b.

Specified by:
componentShown in interface ComponentListener
Parameters:
e - the component event

componentHidden

public void componentHidden(ComponentEvente)
Handles the componentHidden event by invoking the componentHidden methods on listener-a and listener-b.

Specified by:
componentHidden in interface ComponentListener
Parameters:
e - the component event

componentAdded

public void componentAdded(ContainerEvente)
Handles the componentAdded container event by invoking the componentAdded methods on listener-a and listener-b.

Specified by:
componentAdded in interface ContainerListener
Parameters:
e - the component event

componentRemoved

public void componentRemoved(ContainerEvente)
Handles the componentRemoved container event by invoking the componentRemoved methods on listener-a and listener-b.

Specified by:
componentRemoved in interface ContainerListener
Parameters:
e - the component event

focusGained

public void focusGained(FocusEvente)
Handles the focusGained event by invoking the focusGained methods on listener-a and listener-b.

Specified by:
focusGained in interface FocusListener
Parameters:
e - the focus event

focusLost

public void focusLost(FocusEvente)
Handles the focusLost event by invoking the focusLost methods on listener-a and listener-b.

Specified by:
focusLost in interface FocusListener
Parameters:
e - the focus event

keyTyped

public void keyTyped(KeyEvente)
Handles the keyTyped event by invoking the keyTyped methods on listener-a and listener-b.

Specified by:
keyTyped in interface KeyListener
Parameters:
e - the key event

keyPressed

public void keyPressed(KeyEvente)
Handles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b.

Specified by:
keyPressed in interface KeyListener
Parameters:
e - the key event

keyReleased

public void keyReleased(KeyEvente)
Handles the keyReleased event by invoking the keyReleased methods on listener-a and listener-b.

Specified by:
keyReleased in interface KeyListener
Parameters:
e - the key event

mouseClicked

public void mouseClicked(MouseEvente)
Handles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - the mouse event

mousePressed

public void mousePressed(MouseEvente)
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the mouse event

mouseReleased

public void mouseReleased(MouseEvente)
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - the mouse event

mouseEntered

public void mouseEntered(MouseEvente)
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - the mouse event

mouseExited

public void mouseExited(MouseEvente)
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.

Specified by:
mouseExited in interface MouseListener
Parameters:
e - the mouse event

mouseDragged

public void mouseDragged(MouseEvente)
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - the mouse event

mouseMoved

public void mouseMoved(MouseEvente)
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - the mouse event

windowOpened

public void windowOpened(WindowEvente)
Handles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.

Specified by:
windowOpened in interface WindowListener
Parameters:
e - the window event

windowClosing

public void windowClosing(WindowEvente)
Handles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.

Specified by:
windowClosing in interface WindowListener
Parameters:
e - the window event

windowClosed

public void windowClosed(WindowEvente)
Handles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.

Specified by:
windowClosed in interface WindowListener
Parameters:
e - the window event

windowIconified

public void windowIconified(WindowEvente)
Handles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.

Specified by:
windowIconified in interface WindowListener
Parameters:
e - the window event
See Also:
Frame.setIconImage(java.awt.Image)

windowDeiconified

public void windowDeiconified(WindowEvente)
Handles the windowDeiconfied event by invoking the windowDeiconified methods on listener-a and listener-b.

Specified by:
windowDeiconified in interface WindowListener
Parameters:
e - the window event

windowActivated

public void windowActivated(WindowEvente)
Handles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.

Specified by:
windowActivated in interface WindowListener
Parameters:
e - the window event

windowDeactivated

public void windowDeactivated(WindowEvente)
Handles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.

Specified by:
windowDeactivated in interface WindowListener
Parameters:
e - the window event

windowStateChanged

public void windowStateChanged(WindowEvente)
Handles the windowStateChanged event by invoking the windowStateChanged methods on listener-a and listener-b.

Specified by:
windowStateChanged in interface WindowStateListener
Parameters:
e - the window event

windowGainedFocus

public void windowGainedFocus(WindowEvente)
Handles the windowGainedFocus event by invoking the windowGainedFocus methods on listener-a and listener-b.

Specified by:
windowGainedFocus in interface WindowFocusListener
Parameters:
e - the window event

windowLostFocus

public void windowLostFocus(WindowEvente)
Handles the windowLostFocus event by invoking the windowLostFocus methods on listener-a and listener-b.

Specified by:
windowLostFocus in interface WindowFocusListener
Parameters:
e - the window event

actionPerformed

public void actionPerformed(ActionEvente)
Handles the actionPerformed event by invoking the actionPerformed methods on listener-a and listener-b.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - the action event

itemStateChanged

public void itemStateChanged(ItemEvente)
Handles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
e - the item event

adjustmentValueChanged

public void adjustmentValueChanged(AdjustmentEvente)
Handles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.

Specified by:
adjustmentValueChanged in interface AdjustmentListener
Parameters:
e - the adjustment event

textValueChanged

public void textValueChanged(TextEvente)
Description copied from interface: TextListener
Invoked 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:
textValueChanged in interface TextListener

inputMethodTextChanged

public void inputMethodTextChanged(InputMethodEvente)
Handles the inputMethodTextChanged event by invoking the inputMethodTextChanged methods on listener-a and listener-b.

Specified by:
inputMethodTextChanged in interface InputMethodListener
Parameters:
e - the item event

caretPositionChanged

public void caretPositionChanged(InputMethodEvente)
Handles the caretPositionChanged event by invoking the caretPositionChanged methods on listener-a and listener-b.

Specified by:
caretPositionChanged in interface InputMethodListener
Parameters:
e - the item event

hierarchyChanged

public void hierarchyChanged(HierarchyEvente)
Handles the hierarchyChanged event by invoking the hierarchyChanged methods on listener-a and listener-b.

Specified by:
hierarchyChanged in interface HierarchyListener
Parameters:
e - the item event
See Also:
HierarchyEvent.getChangeFlags()

ancestorMoved

public void ancestorMoved(HierarchyEvente)
Handles the ancestorMoved event by invoking the ancestorMoved methods on listener-a and listener-b.

Specified by:
ancestorMoved in interface HierarchyBoundsListener
Parameters:
e - the item event

ancestorResized

public void ancestorResized(HierarchyEvente)
Handles the ancestorResized event by invoking the ancestorResized methods on listener-a and listener-b.

Specified by:
ancestorResized in interface HierarchyBoundsListener
Parameters:
e - the item event

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvente)
Handles the mouseWheelMoved event by invoking the mouseWheelMoved methods on listener-a and listener-b.

Specified by:
mouseWheelMoved in interface MouseWheelListener
Parameters:
e - the mouse event
Since:
1.4
See Also:
MouseWheelEvent

add

public static ComponentListener add(ComponentListenera,
                                    ComponentListenerb)
Adds component-listener-a with component-listener-b and returns the resulting multicast listener.

Parameters:
a - component-listener-a
b - component-listener-b

add

public static ContainerListener add(ContainerListenera,
                                    ContainerListenerb)
Adds container-listener-a with container-listener-b and returns the resulting multicast listener.

Parameters:
a - container-listener-a
b - container-listener-b

add

public static FocusListener add(FocusListenera,
                                FocusListenerb)
Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.

Parameters:
a - focus-listener-a
b - focus-listener-b

add

public static KeyListener add(KeyListenera,
                              KeyListenerb)
Adds key-listener-a with key-listener-b and returns the resulting multicast listener.

Parameters:
a - key-listener-a
b - key-listener-b

add

public static MouseListener add(MouseListenera,
                                MouseListenerb)
Adds mouse-listener-a with mouse-listener-b and returns the resulting multicast listener.

Parameters:
a - mouse-listener-a
b - mouse-listener-b

add

public static MouseMotionListener add(MouseMotionListenera,
                                      MouseMotionListenerb)
Adds 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

add

public static WindowListener add(WindowListenera,
                                 WindowListenerb)
Adds window-listener-a with window-listener-b and returns the resulting multicast listener.

Parameters:
a - window-listener-a
b - window-listener-b

add

public static WindowStateListener add(WindowStateListenera,
                                      WindowStateListenerb)
Adds 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

add

public static WindowFocusListener add(WindowFocusListenera,
                                      WindowFocusListenerb)
Adds 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

add

public static ActionListener add(ActionListenera,
                                 ActionListenerb)
Adds action-listener-a with action-listener-b and returns the resulting multicast listener.

Parameters:
a - action-listener-a
b - action-listener-b

add

public static ItemListener add(ItemListenera,
                               ItemListenerb)
Adds item-listener-a with item-listener-b and returns the resulting multicast listener.

Parameters:
a - item-listener-a
b - item-listener-b

add

public static AdjustmentListener add(AdjustmentListenera,
                                     AdjustmentListenerb)
Adds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.

Parameters:
a - adjustment-listener-a
b - adjustment-listener-b

add

public static TextListener add(TextListenera,
                               TextListenerb)

add

public static InputMethodListener add(InputMethodListenera,
                                      InputMethodListenerb)
Adds 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

add

public static HierarchyListener add(HierarchyListenera,
                                    HierarchyListenerb)
Adds hierarchy-listener-a with hierarchy-listener-b and returns the resulting multicast listener.

Parameters:
a - hierarchy-listener-a
b - hierarchy-listener-b

add

public static HierarchyBoundsListener add(HierarchyBoundsListenera,
                                          HierarchyBoundsListenerb)
Adds 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

add

public static MouseWheelListener add(MouseWheelListenera,
                                     MouseWheelListenerb)
Adds 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
Since:
1.4

remove

public static ComponentListener remove(ComponentListenerl,
                                       ComponentListeneroldl)
Removes 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

remove

public static ContainerListener remove(ContainerListenerl,
                                       ContainerListeneroldl)
Removes 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

remove

public static FocusListener remove(FocusListenerl,
                                   FocusListeneroldl)
Removes 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

remove

public static KeyListener remove(KeyListenerl,
                                 KeyListeneroldl)
Removes 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

remove

public static MouseListener remove(MouseListenerl,
                                   MouseListeneroldl)
Removes 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

remove

public static MouseMotionListener remove(MouseMotionListenerl,
                                         MouseMotionListeneroldl)
Removes 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

remove

public static WindowListener remove(WindowListenerl,
                                    WindowListeneroldl)
Removes 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

remove

public static WindowStateListener remove(WindowStateListenerl,
                                         WindowStateListeneroldl)
Removes 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

remove

public static WindowFocusListener remove(WindowFocusListenerl,
                                         WindowFocusListeneroldl)
Removes 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

remove

public static ActionListener remove(ActionListenerl,
                                    ActionListeneroldl)
Removes 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

remove

public static ItemListener remove(ItemListenerl,
                                  ItemListeneroldl)
Removes 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

remove

public static AdjustmentListener remove(AdjustmentListenerl,
                                        AdjustmentListeneroldl)
Removes 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

remove

public static TextListener remove(TextListenerl,
                                  TextListeneroldl)

remove

public static InputMethodListener remove(InputMethodListenerl,
                                         InputMethodListeneroldl)
Removes 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

remove

public static HierarchyListener remove(HierarchyListenerl,
                                       HierarchyListeneroldl)
Removes 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

remove

public static HierarchyBoundsListener remove(HierarchyBoundsListenerl,
                                             HierarchyBoundsListeneroldl)
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

remove

public static MouseWheelListener remove(MouseWheelListenerl,
                                        MouseWheelListeneroldl)
Removes 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
Since:
1.4

addInternal

protected static EventListener addInternal(EventListenera,
                                           EventListenerb)
Returns 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

removeInternal

protected static EventListener removeInternal(EventListenerl,
                                              EventListeneroldl)
Returns 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

saveInternal

protected void saveInternal(ObjectOutputStreams,
                            Stringk)
                     throws IOException
Throws:
IOException

save

protected static void save(ObjectOutputStreams,
                           Stringk,
                           EventListenerl)
                    throws IOException
Throws:
IOException

getListeners

public static EventListener> T[] getListeners(EventListenerl,
                                                         ClasslistenerType)
Returns an array of all the objects chained as FooListeners by the specified java.util.EventListener. FooListeners are chained by the AWTEventMulticaster using the addFooListener method. If a null listener is specified, this method returns an empty array. If the specified listener is not an instance of AWTEventMulticaster, this method returns an array which contains only the specified listener. If no such listeners are chanined, this method returns an empty array.

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:
ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
Since:
1.4

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

6 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1412
Document créé le 29/08/06 21:40, dernière modification le Vendredi 17 Juin 2011, 11:12
Source du document imprimé : http:///www.gaudry.be/java-api-rf-java/awt/AWTEventMulticaster.html
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
15838 documents
455 astuces.
550 niouzes.
3107 definitions.
447 membres.
8121 messages.

Document genere en :
0,25 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
If we can't name a variable or a function appropriately, it may be a sign we've not yet understood its true purpose.

Venkat Subramaniam [devoxx 2016]
 
l'infobrol
Nous sommes le Mercredi 22 Novembre 2017, 10:26, toutes les heures sont au format GMT+1.00 Heure, heure d'hiver