FileDocCategorySizeDatePackage
AWTEventMulticaster.javaAPI DocJava SE 6 API35567Tue Jun 10 00:25:12 BST 2008java.awt

AWTEventMulticaster

public class AWTEventMulticaster extends Object implements ComponentListener, WindowListener, HierarchyBoundsListener, WindowStateListener, TextListener, MouseWheelListener, MouseMotionListener, HierarchyListener, MouseListener, ActionListener, AdjustmentListener, ContainerListener, InputMethodListener, KeyListener, ItemListener, FocusListener, WindowFocusListener
{@code AWTEventMulticaster} implements efficient and thread-safe multi-cast event dispatching for the AWT events defined in the {@code 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());
}
}
}
The important point to note is the first argument to the {@code add} and {@code remove} methods is the field maintaining the listeners. In addition you must assign the result of the {@code add} and {@code remove} methods to the field maintaining the listeners.

{@code AWTEventMulticaster} is implemented as a pair of {@code EventListeners} that are set at construction time. {@code AWTEventMulticaster} is immutable. The {@code add} and {@code remove} methods do not alter {@code AWTEventMulticaster} in anyway. If necessary, a new {@code 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 {@code add} methods allow {@code null} arguments. If the first argument is {@code null}, the second argument is returned. If the first argument is not {@code null} and the second argument is {@code null}, the first argument is returned. If both arguments are {@code non-null}, a new {@code AWTEventMulticaster} is created using the two arguments and returned.

For the {@code remove} methods that take two arguments, the following is returned:

  • {@code null}, if the first argument is {@code null}, or the arguments are equal, by way of {@code ==}.
  • the first argument, if the first argument is not an instance of {@code AWTEventMulticaster}.
  • result of invoking {@code remove(EventListener)} on the first argument, supplying the second argument to the {@code remove(EventListener)} method.

Swing makes use of {@link javax.swing.event.EventListenerList EventListenerList} for similar logic. Refer to it for details.

see
javax.swing.event.EventListenerList
author
John Rose
author
Amy Fowler
version
1.41, 08/16/06
since
1.1

Fields Summary
protected final EventListener
a
protected final EventListener
b
Constructors Summary
protected AWTEventMulticaster(EventListener a, EventListener b)
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.

param
a listener-a
param
b listener-b

	this.a = a; this.b = b;
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent e)
Handles the actionPerformed event by invoking the actionPerformed methods on listener-a and listener-b.

param
e the action event

        ((ActionListener)a).actionPerformed(e);
        ((ActionListener)b).actionPerformed(e);
    
public static java.awt.event.ComponentListeneradd(java.awt.event.ComponentListener a, java.awt.event.ComponentListener b)
Adds component-listener-a with component-listener-b and returns the resulting multicast listener.

param
a component-listener-a
param
b component-listener-b

        return (ComponentListener)addInternal(a, b);
    
public static java.awt.event.ContainerListeneradd(java.awt.event.ContainerListener a, java.awt.event.ContainerListener b)
Adds container-listener-a with container-listener-b and returns the resulting multicast listener.

param
a container-listener-a
param
b container-listener-b

        return (ContainerListener)addInternal(a, b);
    
public static java.awt.event.FocusListeneradd(java.awt.event.FocusListener a, java.awt.event.FocusListener b)
Adds focus-listener-a with focus-listener-b and returns the resulting multicast listener.

param
a focus-listener-a
param
b focus-listener-b

        return (FocusListener)addInternal(a, b);
    
public static java.awt.event.KeyListeneradd(java.awt.event.KeyListener a, java.awt.event.KeyListener b)
Adds key-listener-a with key-listener-b and returns the resulting multicast listener.

param
a key-listener-a
param
b key-listener-b

        return (KeyListener)addInternal(a, b);
    
public static java.awt.event.MouseListeneradd(java.awt.event.MouseListener a, java.awt.event.MouseListener b)
Adds mouse-listener-a with mouse-listener-b and returns the resulting multicast listener.

param
a mouse-listener-a
param
b mouse-listener-b

        return (MouseListener)addInternal(a, b);
    
public static java.awt.event.MouseMotionListeneradd(java.awt.event.MouseMotionListener a, java.awt.event.MouseMotionListener b)
Adds mouse-motion-listener-a with mouse-motion-listener-b and returns the resulting multicast listener.

param
a mouse-motion-listener-a
param
b mouse-motion-listener-b

        return (MouseMotionListener)addInternal(a, b);
    
public static java.awt.event.WindowListeneradd(java.awt.event.WindowListener a, java.awt.event.WindowListener b)
Adds window-listener-a with window-listener-b and returns the resulting multicast listener.

param
a window-listener-a
param
b window-listener-b

        return (WindowListener)addInternal(a, b);
    
public static java.awt.event.WindowStateListeneradd(java.awt.event.WindowStateListener a, java.awt.event.WindowStateListener b)
Adds window-state-listener-a with window-state-listener-b and returns the resulting multicast listener.

param
a window-state-listener-a
param
b window-state-listener-b
since
1.4

        return (WindowStateListener)addInternal(a, b);
    
public static java.awt.event.WindowFocusListeneradd(java.awt.event.WindowFocusListener a, java.awt.event.WindowFocusListener b)
Adds window-focus-listener-a with window-focus-listener-b and returns the resulting multicast listener.

param
a window-focus-listener-a
param
b window-focus-listener-b
since
1.4

        return (WindowFocusListener)addInternal(a, b);
    
public static java.awt.event.ActionListeneradd(java.awt.event.ActionListener a, java.awt.event.ActionListener b)
Adds action-listener-a with action-listener-b and returns the resulting multicast listener.

param
a action-listener-a
param
b action-listener-b

        return (ActionListener)addInternal(a, b);
    
public static java.awt.event.ItemListeneradd(java.awt.event.ItemListener a, java.awt.event.ItemListener b)
Adds item-listener-a with item-listener-b and returns the resulting multicast listener.

param
a item-listener-a
param
b item-listener-b

        return (ItemListener)addInternal(a, b);
    
public static java.awt.event.AdjustmentListeneradd(java.awt.event.AdjustmentListener a, java.awt.event.AdjustmentListener b)
Adds adjustment-listener-a with adjustment-listener-b and returns the resulting multicast listener.

param
a adjustment-listener-a
param
b adjustment-listener-b

        return (AdjustmentListener)addInternal(a, b);
    
public static java.awt.event.TextListeneradd(java.awt.event.TextListener a, java.awt.event.TextListener b)

        return (TextListener)addInternal(a, b);
    
public static java.awt.event.InputMethodListeneradd(java.awt.event.InputMethodListener a, java.awt.event.InputMethodListener b)
Adds input-method-listener-a with input-method-listener-b and returns the resulting multicast listener.

param
a input-method-listener-a
param
b input-method-listener-b

        return (InputMethodListener)addInternal(a, b);
     
public static java.awt.event.HierarchyListeneradd(java.awt.event.HierarchyListener a, java.awt.event.HierarchyListener b)
Adds hierarchy-listener-a with hierarchy-listener-b and returns the resulting multicast listener.

param
a hierarchy-listener-a
param
b hierarchy-listener-b
since
1.3

        return (HierarchyListener)addInternal(a, b);
     
public static java.awt.event.HierarchyBoundsListeneradd(java.awt.event.HierarchyBoundsListener a, java.awt.event.HierarchyBoundsListener b)
Adds hierarchy-bounds-listener-a with hierarchy-bounds-listener-b and returns the resulting multicast listener.

param
a hierarchy-bounds-listener-a
param
b hierarchy-bounds-listener-b
since
1.3

        return (HierarchyBoundsListener)addInternal(a, b);
     
public static java.awt.event.MouseWheelListeneradd(java.awt.event.MouseWheelListener a, java.awt.event.MouseWheelListener b)
Adds mouse-wheel-listener-a with mouse-wheel-listener-b and returns the resulting multicast listener.

param
a mouse-wheel-listener-a
param
b mouse-wheel-listener-b
since
1.4

        return (MouseWheelListener)addInternal(a, b);
    
protected static java.util.EventListeneraddInternal(java.util.EventListener a, java.util.EventListener b)
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.

param
a event listener-a
param
b event listener-b

	if (a == null)  return b;
	if (b == null)  return a;
	return new AWTEventMulticaster(a, b);
    
public voidadjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Handles the adjustmentValueChanged event by invoking the adjustmentValueChanged methods on listener-a and listener-b.

param
e the adjustment event

        ((AdjustmentListener)a).adjustmentValueChanged(e);
        ((AdjustmentListener)b).adjustmentValueChanged(e);
    
public voidancestorMoved(java.awt.event.HierarchyEvent e)
Handles the ancestorMoved event by invoking the ancestorMoved methods on listener-a and listener-b.

param
e the item event
since
1.3

        ((HierarchyBoundsListener)a).ancestorMoved(e);
        ((HierarchyBoundsListener)b).ancestorMoved(e);
    
public voidancestorResized(java.awt.event.HierarchyEvent e)
Handles the ancestorResized event by invoking the ancestorResized methods on listener-a and listener-b.

param
e the item event
since
1.3

        ((HierarchyBoundsListener)a).ancestorResized(e);
        ((HierarchyBoundsListener)b).ancestorResized(e);
    
public voidcaretPositionChanged(java.awt.event.InputMethodEvent e)
Handles the caretPositionChanged event by invoking the caretPositionChanged methods on listener-a and listener-b.

param
e the item event

       ((InputMethodListener)a).caretPositionChanged(e);
       ((InputMethodListener)b).caretPositionChanged(e);
    
public voidcomponentAdded(java.awt.event.ContainerEvent e)
Handles the componentAdded container event by invoking the componentAdded methods on listener-a and listener-b.

param
e the component event

        ((ContainerListener)a).componentAdded(e);
        ((ContainerListener)b).componentAdded(e);
    
public voidcomponentHidden(java.awt.event.ComponentEvent e)
Handles the componentHidden event by invoking the componentHidden methods on listener-a and listener-b.

param
e the component event

        ((ComponentListener)a).componentHidden(e);
        ((ComponentListener)b).componentHidden(e);
    
public voidcomponentMoved(java.awt.event.ComponentEvent e)
Handles the componentMoved event by invoking the componentMoved methods on listener-a and listener-b.

param
e the component event

        ((ComponentListener)a).componentMoved(e);
        ((ComponentListener)b).componentMoved(e);
    
public voidcomponentRemoved(java.awt.event.ContainerEvent e)
Handles the componentRemoved container event by invoking the componentRemoved methods on listener-a and listener-b.

param
e the component event

        ((ContainerListener)a).componentRemoved(e);
        ((ContainerListener)b).componentRemoved(e);
    
public voidcomponentResized(java.awt.event.ComponentEvent e)
Handles the componentResized event by invoking the componentResized methods on listener-a and listener-b.

param
e the component event

        ((ComponentListener)a).componentResized(e);
        ((ComponentListener)b).componentResized(e);
    
public voidcomponentShown(java.awt.event.ComponentEvent e)
Handles the componentShown event by invoking the componentShown methods on listener-a and listener-b.

param
e the component event

        ((ComponentListener)a).componentShown(e);
        ((ComponentListener)b).componentShown(e);
    
public voidfocusGained(java.awt.event.FocusEvent e)
Handles the focusGained event by invoking the focusGained methods on listener-a and listener-b.

param
e the focus event

        ((FocusListener)a).focusGained(e);
        ((FocusListener)b).focusGained(e);
    
public voidfocusLost(java.awt.event.FocusEvent e)
Handles the focusLost event by invoking the focusLost methods on listener-a and listener-b.

param
e the focus event

        ((FocusListener)a).focusLost(e);
        ((FocusListener)b).focusLost(e);
    
private static intgetListenerCount(java.util.EventListener l, java.lang.Class listenerType)

 
        if (l instanceof AWTEventMulticaster) {
            AWTEventMulticaster mc = (AWTEventMulticaster)l; 
            return getListenerCount(mc.a, listenerType) +
             getListenerCount(mc.b, listenerType); 
        }
        else {
            // Only count listeners of correct type
            return listenerType.isInstance(l) ? 1 : 0;
        } 
    
public static T[]getListeners(java.util.EventListener l, java.lang.Class listenerType)
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.

param
l the specified java.util.EventListener
param
listenerType the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
return
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
exception
NullPointerException if the specified {@code listenertype} parameter is {@code null}
exception
ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener
since
1.4

        if (listenerType == null) {
            throw new NullPointerException ("Listener type should not be null");
        }

        int n = getListenerCount(l, listenerType); 
        T[] result = (T[])Array.newInstance(listenerType, n);
        populateListenerArray(result, l, 0);
        return result;
    
public voidhierarchyChanged(java.awt.event.HierarchyEvent e)
Handles the hierarchyChanged event by invoking the hierarchyChanged methods on listener-a and listener-b.

param
e the item event
since
1.3

        ((HierarchyListener)a).hierarchyChanged(e);
        ((HierarchyListener)b).hierarchyChanged(e);
    
public voidinputMethodTextChanged(java.awt.event.InputMethodEvent e)
Handles the inputMethodTextChanged event by invoking the inputMethodTextChanged methods on listener-a and listener-b.

param
e the item event

       ((InputMethodListener)a).inputMethodTextChanged(e);
       ((InputMethodListener)b).inputMethodTextChanged(e);
    
public voiditemStateChanged(java.awt.event.ItemEvent e)
Handles the itemStateChanged event by invoking the itemStateChanged methods on listener-a and listener-b.

param
e the item event

        ((ItemListener)a).itemStateChanged(e);
        ((ItemListener)b).itemStateChanged(e);
    
public voidkeyPressed(java.awt.event.KeyEvent e)
Handles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b.

param
e the key event

        ((KeyListener)a).keyPressed(e);
        ((KeyListener)b).keyPressed(e);
    
public voidkeyReleased(java.awt.event.KeyEvent e)
Handles the keyReleased event by invoking the keyReleased methods on listener-a and listener-b.

param
e the key event

        ((KeyListener)a).keyReleased(e);
        ((KeyListener)b).keyReleased(e);
    
public voidkeyTyped(java.awt.event.KeyEvent e)
Handles the keyTyped event by invoking the keyTyped methods on listener-a and listener-b.

param
e the key event

        ((KeyListener)a).keyTyped(e);
        ((KeyListener)b).keyTyped(e);
    
public voidmouseClicked(java.awt.event.MouseEvent e)
Handles the mouseClicked event by invoking the mouseClicked methods on listener-a and listener-b.

param
e the mouse event

        ((MouseListener)a).mouseClicked(e);
        ((MouseListener)b).mouseClicked(e);
    
public voidmouseDragged(java.awt.event.MouseEvent e)
Handles the mouseDragged event by invoking the mouseDragged methods on listener-a and listener-b.

param
e the mouse event

        ((MouseMotionListener)a).mouseDragged(e);
        ((MouseMotionListener)b).mouseDragged(e);
    
public voidmouseEntered(java.awt.event.MouseEvent e)
Handles the mouseEntered event by invoking the mouseEntered methods on listener-a and listener-b.

param
e the mouse event

        ((MouseListener)a).mouseEntered(e);
        ((MouseListener)b).mouseEntered(e);
    
public voidmouseExited(java.awt.event.MouseEvent e)
Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b.

param
e the mouse event

        ((MouseListener)a).mouseExited(e);
        ((MouseListener)b).mouseExited(e);
    
public voidmouseMoved(java.awt.event.MouseEvent e)
Handles the mouseMoved event by invoking the mouseMoved methods on listener-a and listener-b.

param
e the mouse event

        ((MouseMotionListener)a).mouseMoved(e);
        ((MouseMotionListener)b).mouseMoved(e);
    
public voidmousePressed(java.awt.event.MouseEvent e)
Handles the mousePressed event by invoking the mousePressed methods on listener-a and listener-b.

param
e the mouse event

        ((MouseListener)a).mousePressed(e);
        ((MouseListener)b).mousePressed(e);
    
public voidmouseReleased(java.awt.event.MouseEvent e)
Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and listener-b.

param
e the mouse event

        ((MouseListener)a).mouseReleased(e);
        ((MouseListener)b).mouseReleased(e);
    
public voidmouseWheelMoved(java.awt.event.MouseWheelEvent e)
Handles the mouseWheelMoved event by invoking the mouseWheelMoved methods on listener-a and listener-b.

param
e the mouse event
since
1.4

        ((MouseWheelListener)a).mouseWheelMoved(e);
        ((MouseWheelListener)b).mouseWheelMoved(e);
    
private static intpopulateListenerArray(java.util.EventListener[] a, java.util.EventListener l, int index)

 
        if (l instanceof AWTEventMulticaster) { 
            AWTEventMulticaster mc = (AWTEventMulticaster)l; 
            int lhs = populateListenerArray(a, mc.a, index); 
            return populateListenerArray(a, mc.b, lhs); 
        }
        else if (a.getClass().getComponentType().isInstance(l)) { 
            a[index] = l; 
            return index + 1; 
        } 
        // Skip nulls, instances of wrong class
        else { 
            return index; 
        }
    
protected java.util.EventListenerremove(java.util.EventListener oldl)
Removes a listener from this multicaster.

The returned multicaster contains all the listeners in this multicaster with the exception of all occurrences of {@code oldl}. If the resulting multicaster contains only one regular listener the regular listener may be returned. If the resulting multicaster is empty, then {@code null} may be returned instead.

No exception is thrown if {@code oldl} is {@code null}.

param
oldl the listener to be removed
return
resulting listener

	if (oldl == a)  return b;
	if (oldl == b)  return a;
	EventListener a2 = removeInternal(a, oldl);
	EventListener b2 = removeInternal(b, oldl);
	if (a2 == a && b2 == b) {
	    return this;	// it's not here
	}
	return addInternal(a2, b2);
    
public static java.awt.event.ComponentListenerremove(java.awt.event.ComponentListener l, java.awt.event.ComponentListener oldl)
Removes the old component-listener from component-listener-l and returns the resulting multicast listener.

param
l component-listener-l
param
oldl the component-listener being removed

	return (ComponentListener) removeInternal(l, oldl);
    
public static java.awt.event.ContainerListenerremove(java.awt.event.ContainerListener l, java.awt.event.ContainerListener oldl)
Removes the old container-listener from container-listener-l and returns the resulting multicast listener.

param
l container-listener-l
param
oldl the container-listener being removed

	return (ContainerListener) removeInternal(l, oldl);
    
public static java.awt.event.FocusListenerremove(java.awt.event.FocusListener l, java.awt.event.FocusListener oldl)
Removes the old focus-listener from focus-listener-l and returns the resulting multicast listener.

param
l focus-listener-l
param
oldl the focus-listener being removed

	return (FocusListener) removeInternal(l, oldl);
    
public static java.awt.event.KeyListenerremove(java.awt.event.KeyListener l, java.awt.event.KeyListener oldl)
Removes the old key-listener from key-listener-l and returns the resulting multicast listener.

param
l key-listener-l
param
oldl the key-listener being removed

	return (KeyListener) removeInternal(l, oldl);
    
public static java.awt.event.MouseListenerremove(java.awt.event.MouseListener l, java.awt.event.MouseListener oldl)
Removes the old mouse-listener from mouse-listener-l and returns the resulting multicast listener.

param
l mouse-listener-l
param
oldl the mouse-listener being removed

	return (MouseListener) removeInternal(l, oldl);
    
public static java.awt.event.MouseMotionListenerremove(java.awt.event.MouseMotionListener l, java.awt.event.MouseMotionListener oldl)
Removes the old mouse-motion-listener from mouse-motion-listener-l and returns the resulting multicast listener.

param
l mouse-motion-listener-l
param
oldl the mouse-motion-listener being removed

	return (MouseMotionListener) removeInternal(l, oldl);
    
public static java.awt.event.WindowListenerremove(java.awt.event.WindowListener l, java.awt.event.WindowListener oldl)
Removes the old window-listener from window-listener-l and returns the resulting multicast listener.

param
l window-listener-l
param
oldl the window-listener being removed

	return (WindowListener) removeInternal(l, oldl);
    
public static java.awt.event.WindowStateListenerremove(java.awt.event.WindowStateListener l, java.awt.event.WindowStateListener oldl)
Removes the old window-state-listener from window-state-listener-l and returns the resulting multicast listener.

param
l window-state-listener-l
param
oldl the window-state-listener being removed
since
1.4

        return (WindowStateListener) removeInternal(l, oldl);
    
public static java.awt.event.WindowFocusListenerremove(java.awt.event.WindowFocusListener l, java.awt.event.WindowFocusListener oldl)
Removes the old window-focus-listener from window-focus-listener-l and returns the resulting multicast listener.

param
l window-focus-listener-l
param
oldl the window-focus-listener being removed
since
1.4

        return (WindowFocusListener) removeInternal(l, oldl);
    
public static java.awt.event.ActionListenerremove(java.awt.event.ActionListener l, java.awt.event.ActionListener oldl)
Removes the old action-listener from action-listener-l and returns the resulting multicast listener.

param
l action-listener-l
param
oldl the action-listener being removed

	return (ActionListener) removeInternal(l, oldl);
    
public static java.awt.event.ItemListenerremove(java.awt.event.ItemListener l, java.awt.event.ItemListener oldl)
Removes the old item-listener from item-listener-l and returns the resulting multicast listener.

param
l item-listener-l
param
oldl the item-listener being removed

	return (ItemListener) removeInternal(l, oldl);
    
public static java.awt.event.AdjustmentListenerremove(java.awt.event.AdjustmentListener l, java.awt.event.AdjustmentListener oldl)
Removes the old adjustment-listener from adjustment-listener-l and returns the resulting multicast listener.

param
l adjustment-listener-l
param
oldl the adjustment-listener being removed

	return (AdjustmentListener) removeInternal(l, oldl);
    
public static java.awt.event.TextListenerremove(java.awt.event.TextListener l, java.awt.event.TextListener oldl)

	return (TextListener) removeInternal(l, oldl);
    
public static java.awt.event.InputMethodListenerremove(java.awt.event.InputMethodListener l, java.awt.event.InputMethodListener oldl)
Removes the old input-method-listener from input-method-listener-l and returns the resulting multicast listener.

param
l input-method-listener-l
param
oldl the input-method-listener being removed

        return (InputMethodListener) removeInternal(l, oldl);
    
public static java.awt.event.HierarchyListenerremove(java.awt.event.HierarchyListener l, java.awt.event.HierarchyListener oldl)
Removes the old hierarchy-listener from hierarchy-listener-l and returns the resulting multicast listener.

param
l hierarchy-listener-l
param
oldl the hierarchy-listener being removed
since
1.3

        return (HierarchyListener) removeInternal(l, oldl);
    
public static java.awt.event.HierarchyBoundsListenerremove(java.awt.event.HierarchyBoundsListener l, java.awt.event.HierarchyBoundsListener oldl)
Removes the old hierarchy-bounds-listener from hierarchy-bounds-listener-l and returns the resulting multicast listener.

param
l hierarchy-bounds-listener-l
param
oldl the hierarchy-bounds-listener being removed
since
1.3

        return (HierarchyBoundsListener) removeInternal(l, oldl);
    
public static java.awt.event.MouseWheelListenerremove(java.awt.event.MouseWheelListener l, java.awt.event.MouseWheelListener oldl)
Removes the old mouse-wheel-listener from mouse-wheel-listener-l and returns the resulting multicast listener.

param
l mouse-wheel-listener-l
param
oldl the mouse-wheel-listener being removed
since
1.4

      return (MouseWheelListener) removeInternal(l, oldl);
    
protected static java.util.EventListenerremoveInternal(java.util.EventListener l, java.util.EventListener oldl)
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.

param
l the listener being removed from
param
oldl the listener being removed

	if (l == oldl || l == null) {
	    return null;
	} else if (l instanceof AWTEventMulticaster) {
	    return ((AWTEventMulticaster)l).remove(oldl);
	} else {
	    return l;		// it's not here
	}
    
protected static voidsave(java.io.ObjectOutputStream s, java.lang.String k, java.util.EventListener l)

      if (l == null) {
          return;
      } 
      else if (l instanceof AWTEventMulticaster) {
          ((AWTEventMulticaster)l).saveInternal(s, k);
      }
      else if (l instanceof Serializable) {
           s.writeObject(k);
           s.writeObject(l);
      }
    
protected voidsaveInternal(java.io.ObjectOutputStream s, java.lang.String k)

        if (a instanceof AWTEventMulticaster) {
	    ((AWTEventMulticaster)a).saveInternal(s, k);
        }
        else if (a instanceof Serializable) {
            s.writeObject(k);
            s.writeObject(a);
        }
        
        if (b instanceof AWTEventMulticaster) {
	    ((AWTEventMulticaster)b).saveInternal(s, k);
        }
        else if (b instanceof Serializable) {
            s.writeObject(k);
            s.writeObject(b);
        }
    
public voidtextValueChanged(java.awt.event.TextEvent e)

        ((TextListener)a).textValueChanged(e);
        ((TextListener)b).textValueChanged(e);
    
public voidwindowActivated(java.awt.event.WindowEvent e)
Handles the windowActivated event by invoking the windowActivated methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowActivated(e);
        ((WindowListener)b).windowActivated(e);
    
public voidwindowClosed(java.awt.event.WindowEvent e)
Handles the windowClosed event by invoking the windowClosed methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowClosed(e);
        ((WindowListener)b).windowClosed(e);
    
public voidwindowClosing(java.awt.event.WindowEvent e)
Handles the windowClosing event by invoking the windowClosing methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowClosing(e);
        ((WindowListener)b).windowClosing(e);
    
public voidwindowDeactivated(java.awt.event.WindowEvent e)
Handles the windowDeactivated event by invoking the windowDeactivated methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowDeactivated(e);
        ((WindowListener)b).windowDeactivated(e);
    
public voidwindowDeiconified(java.awt.event.WindowEvent e)
Handles the windowDeiconfied event by invoking the windowDeiconified methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowDeiconified(e);
        ((WindowListener)b).windowDeiconified(e);
    
public voidwindowGainedFocus(java.awt.event.WindowEvent e)
Handles the windowGainedFocus event by invoking the windowGainedFocus methods on listener-a and listener-b.

param
e the window event
since
1.4

        ((WindowFocusListener)a).windowGainedFocus(e);
        ((WindowFocusListener)b).windowGainedFocus(e);
    
public voidwindowIconified(java.awt.event.WindowEvent e)
Handles the windowIconified event by invoking the windowIconified methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowIconified(e);
        ((WindowListener)b).windowIconified(e);
    
public voidwindowLostFocus(java.awt.event.WindowEvent e)
Handles the windowLostFocus event by invoking the windowLostFocus methods on listener-a and listener-b.

param
e the window event
since
1.4

        ((WindowFocusListener)a).windowLostFocus(e);
        ((WindowFocusListener)b).windowLostFocus(e);
    
public voidwindowOpened(java.awt.event.WindowEvent e)
Handles the windowOpened event by invoking the windowOpened methods on listener-a and listener-b.

param
e the window event

        ((WindowListener)a).windowOpened(e);
        ((WindowListener)b).windowOpened(e);
    
public voidwindowStateChanged(java.awt.event.WindowEvent e)
Handles the windowStateChanged event by invoking the windowStateChanged methods on listener-a and listener-b.

param
e the window event
since
1.4

        ((WindowStateListener)a).windowStateChanged(e);
        ((WindowStateListener)b).windowStateChanged(e);