jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java
author serb
Wed, 17 Sep 2014 16:14:12 +0400
changeset 26749 b6598aa90114
parent 25859 3317bb8137f4
child 29886 545c0c3809b8
permissions -rw-r--r--
8055326: Fix typos in client-related packages Reviewed-by: prr, azvegint, alexsch Contributed-by: pavel.rappo@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
     2
 * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package java.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.lang.reflect.Array;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.EventListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.ObjectOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.util.EventListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * {@code AWTEventMulticaster} implements efficient and thread-safe multi-cast
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * event dispatching for the AWT events defined in the {@code java.awt.event}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * The following example illustrates how to use this class:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <pre><code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * public myComponent extends Component {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *     ActionListener actionListener = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *     public synchronized void addActionListener(ActionListener l) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *         actionListener = AWTEventMulticaster.add(actionListener, l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *     public synchronized void removeActionListener(ActionListener l) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *         actionListener = AWTEventMulticaster.remove(actionListener, l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *     public void processEvent(AWTEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *         // when event occurs which causes "action" semantic
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *         ActionListener listener = actionListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *         if (listener != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *             listener.actionPerformed(new ActionEvent());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * </code></pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * The important point to note is the first argument to the {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * add} and {@code remove} methods is the field maintaining the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * listeners. In addition you must assign the result of the {@code add}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * and {@code remove} methods to the field maintaining the listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * {@code AWTEventMulticaster} is implemented as a pair of {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * EventListeners} that are set at construction time. {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * AWTEventMulticaster} is immutable. The {@code add} and {@code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * remove} methods do not alter {@code AWTEventMulticaster} in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * anyway. If necessary, a new {@code AWTEventMulticaster} is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * created. In this way it is safe to add and remove listeners during
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * the process of an event dispatching.  However, event listeners
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * added during the process of an event dispatch operation are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * notified of the event currently being dispatched.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * All of the {@code add} methods allow {@code null} arguments. If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * first argument is {@code null}, the second argument is returned. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * the first argument is not {@code null} and the second argument is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * {@code null}, the first argument is returned. If both arguments are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * {@code non-null}, a new {@code AWTEventMulticaster} is created using
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * the two arguments and returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * For the {@code remove} methods that take two arguments, the following is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * returned:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *   <li>{@code null}, if the first argument is {@code null}, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *       the arguments are equal, by way of {@code ==}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 *   <li>the first argument, if the first argument is not an instance of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 *       {@code AWTEventMulticaster}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 *   <li>result of invoking {@code remove(EventListener)} on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 *       first argument, supplying the second argument to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 *       {@code remove(EventListener)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * <p>Swing makes use of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * {@link javax.swing.event.EventListenerList EventListenerList} for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * similar logic. Refer to it for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * @see javax.swing.event.EventListenerList
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * @author      John Rose
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * @author      Amy Fowler
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * @since       1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
public class AWTEventMulticaster implements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    ComponentListener, ContainerListener, FocusListener, KeyListener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    MouseListener, MouseMotionListener, WindowListener, WindowFocusListener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    WindowStateListener, ActionListener, ItemListener, AdjustmentListener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    TextListener, InputMethodListener, HierarchyListener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    HierarchyBoundsListener, MouseWheelListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   113
    /**
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   114
     * A variable in the event chain (listener-a)
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   115
     */
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   116
    protected final EventListener a;
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   117
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   118
    /**
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   119
     * A variable in the event chain (listener-b)
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   120
     */
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   121
    protected final EventListener b;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * Creates an event multicaster instance which chains listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * with listener-b. Input parameters <code>a</code> and <code>b</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * should not be <code>null</code>, though implementations may vary in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * choosing whether or not to throw <code>NullPointerException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * in that case.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @param a listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @param b listener-b
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    protected AWTEventMulticaster(EventListener a, EventListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        this.a = a; this.b = b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * Removes a listener from this multicaster.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * The returned multicaster contains all the listeners in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * multicaster with the exception of all occurrences of {@code oldl}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * If the resulting multicaster contains only one regular listener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * the regular listener may be returned.  If the resulting multicaster
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * is empty, then {@code null} may be returned instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * No exception is thrown if {@code oldl} is {@code null}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @param oldl the listener to be removed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @return resulting listener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    protected EventListener remove(EventListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        if (oldl == a)  return b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        if (oldl == b)  return a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        EventListener a2 = removeInternal(a, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        EventListener b2 = removeInternal(b, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        if (a2 == a && b2 == b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            return this;        // it's not here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        return addInternal(a2, b2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * Handles the componentResized event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * componentResized methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @param e the component event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    public void componentResized(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        ((ComponentListener)a).componentResized(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        ((ComponentListener)b).componentResized(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * Handles the componentMoved event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * componentMoved methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @param e the component event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public void componentMoved(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        ((ComponentListener)a).componentMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        ((ComponentListener)b).componentMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * Handles the componentShown event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * componentShown methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * @param e the component event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    public void componentShown(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        ((ComponentListener)a).componentShown(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        ((ComponentListener)b).componentShown(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * Handles the componentHidden event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * componentHidden methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @param e the component event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    public void componentHidden(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        ((ComponentListener)a).componentHidden(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        ((ComponentListener)b).componentHidden(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * Handles the componentAdded container event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * componentAdded methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @param e the component event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    public void componentAdded(ContainerEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        ((ContainerListener)a).componentAdded(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        ((ContainerListener)b).componentAdded(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * Handles the componentRemoved container event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * componentRemoved methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @param e the component event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    public void componentRemoved(ContainerEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        ((ContainerListener)a).componentRemoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        ((ContainerListener)b).componentRemoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * Handles the focusGained event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * focusGained methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @param e the focus event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public void focusGained(FocusEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        ((FocusListener)a).focusGained(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        ((FocusListener)b).focusGained(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * Handles the focusLost event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * focusLost methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @param e the focus event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public void focusLost(FocusEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        ((FocusListener)a).focusLost(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        ((FocusListener)b).focusLost(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * Handles the keyTyped event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * keyTyped methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @param e the key event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    public void keyTyped(KeyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        ((KeyListener)a).keyTyped(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        ((KeyListener)b).keyTyped(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * Handles the keyPressed event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * keyPressed methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * @param e the key event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    public void keyPressed(KeyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        ((KeyListener)a).keyPressed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        ((KeyListener)b).keyPressed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * Handles the keyReleased event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * keyReleased methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * @param e the key event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    public void keyReleased(KeyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        ((KeyListener)a).keyReleased(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        ((KeyListener)b).keyReleased(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * Handles the mouseClicked event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * mouseClicked methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    public void mouseClicked(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        ((MouseListener)a).mouseClicked(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        ((MouseListener)b).mouseClicked(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * Handles the mousePressed event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * mousePressed methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    public void mousePressed(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        ((MouseListener)a).mousePressed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        ((MouseListener)b).mousePressed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * Handles the mouseReleased event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * mouseReleased methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    public void mouseReleased(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        ((MouseListener)a).mouseReleased(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
        ((MouseListener)b).mouseReleased(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * Handles the mouseEntered event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * mouseEntered methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    public void mouseEntered(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        ((MouseListener)a).mouseEntered(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        ((MouseListener)b).mouseEntered(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * Handles the mouseExited event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * mouseExited methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    public void mouseExited(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        ((MouseListener)a).mouseExited(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        ((MouseListener)b).mouseExited(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * Handles the mouseDragged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * mouseDragged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    public void mouseDragged(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        ((MouseMotionListener)a).mouseDragged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        ((MouseMotionListener)b).mouseDragged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * Handles the mouseMoved event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * mouseMoved methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    public void mouseMoved(MouseEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        ((MouseMotionListener)a).mouseMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        ((MouseMotionListener)b).mouseMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * Handles the windowOpened event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * windowOpened methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    public void windowOpened(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        ((WindowListener)a).windowOpened(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        ((WindowListener)b).windowOpened(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * Handles the windowClosing event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * windowClosing methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    public void windowClosing(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        ((WindowListener)a).windowClosing(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        ((WindowListener)b).windowClosing(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * Handles the windowClosed event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * windowClosed methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    public void windowClosed(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        ((WindowListener)a).windowClosed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        ((WindowListener)b).windowClosed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * Handles the windowIconified event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * windowIconified methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    public void windowIconified(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        ((WindowListener)a).windowIconified(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
        ((WindowListener)b).windowIconified(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    /**
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
   382
     * Handles the windowDeiconified event by invoking the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * windowDeiconified methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    public void windowDeiconified(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        ((WindowListener)a).windowDeiconified(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        ((WindowListener)b).windowDeiconified(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * Handles the windowActivated event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * windowActivated methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    public void windowActivated(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        ((WindowListener)a).windowActivated(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        ((WindowListener)b).windowActivated(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * Handles the windowDeactivated event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * windowDeactivated methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    public void windowDeactivated(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        ((WindowListener)a).windowDeactivated(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        ((WindowListener)b).windowDeactivated(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * Handles the windowStateChanged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * windowStateChanged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    public void windowStateChanged(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
        ((WindowStateListener)a).windowStateChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        ((WindowStateListener)b).windowStateChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * Handles the windowGainedFocus event by invoking the windowGainedFocus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    public void windowGainedFocus(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
        ((WindowFocusListener)a).windowGainedFocus(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        ((WindowFocusListener)b).windowGainedFocus(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * Handles the windowLostFocus event by invoking the windowLostFocus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * @param e the window event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    public void windowLostFocus(WindowEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        ((WindowFocusListener)a).windowLostFocus(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        ((WindowFocusListener)b).windowLostFocus(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * Handles the actionPerformed event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * actionPerformed methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * @param e the action event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    public void actionPerformed(ActionEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
        ((ActionListener)a).actionPerformed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        ((ActionListener)b).actionPerformed(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * Handles the itemStateChanged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * itemStateChanged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * @param e the item event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    public void itemStateChanged(ItemEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
        ((ItemListener)a).itemStateChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
        ((ItemListener)b).itemStateChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * Handles the adjustmentValueChanged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * adjustmentValueChanged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * @param e the adjustment event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    public void adjustmentValueChanged(AdjustmentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
        ((AdjustmentListener)a).adjustmentValueChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
        ((AdjustmentListener)b).adjustmentValueChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    public void textValueChanged(TextEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
        ((TextListener)a).textValueChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
        ((TextListener)b).textValueChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * Handles the inputMethodTextChanged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * inputMethodTextChanged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * @param e the item event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
    public void inputMethodTextChanged(InputMethodEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
       ((InputMethodListener)a).inputMethodTextChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
       ((InputMethodListener)b).inputMethodTextChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * Handles the caretPositionChanged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * caretPositionChanged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @param e the item event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    public void caretPositionChanged(InputMethodEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
       ((InputMethodListener)a).caretPositionChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
       ((InputMethodListener)b).caretPositionChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * Handles the hierarchyChanged event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * hierarchyChanged methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * @param e the item event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
    public void hierarchyChanged(HierarchyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
        ((HierarchyListener)a).hierarchyChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
        ((HierarchyListener)b).hierarchyChanged(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * Handles the ancestorMoved event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * ancestorMoved methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @param e the item event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
    public void ancestorMoved(HierarchyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
        ((HierarchyBoundsListener)a).ancestorMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
        ((HierarchyBoundsListener)b).ancestorMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * Handles the ancestorResized event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * ancestorResized methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * @param e the item event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    public void ancestorResized(HierarchyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
        ((HierarchyBoundsListener)a).ancestorResized(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
        ((HierarchyBoundsListener)b).ancestorResized(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * Handles the mouseWheelMoved event by invoking the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * mouseWheelMoved methods on listener-a and listener-b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * @param e the mouse event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
    public void mouseWheelMoved(MouseWheelEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
        ((MouseWheelListener)a).mouseWheelMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
        ((MouseWheelListener)b).mouseWheelMoved(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * Adds component-listener-a with component-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * @param a component-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * @param b component-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   548
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
    public static ComponentListener add(ComponentListener a, ComponentListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
        return (ComponentListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * Adds container-listener-a with container-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @param a container-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * @param b container-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   559
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    public static ContainerListener add(ContainerListener a, ContainerListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
        return (ContainerListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * Adds focus-listener-a with focus-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * @param a focus-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * @param b focus-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   570
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
    public static FocusListener add(FocusListener a, FocusListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
        return (FocusListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * Adds key-listener-a with key-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * @param a key-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * @param b key-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   581
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
    public static KeyListener add(KeyListener a, KeyListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
        return (KeyListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * Adds mouse-listener-a with mouse-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * @param a mouse-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * @param b mouse-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   592
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
    public static MouseListener add(MouseListener a, MouseListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
        return (MouseListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * Adds mouse-motion-listener-a with mouse-motion-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * @param a mouse-motion-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * @param b mouse-motion-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   603
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
    public static MouseMotionListener add(MouseMotionListener a, MouseMotionListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
        return (MouseMotionListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * Adds window-listener-a with window-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * @param a window-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * @param b window-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   614
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
    public static WindowListener add(WindowListener a, WindowListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
        return (WindowListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * Adds window-state-listener-a with window-state-listener-b
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * and returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * @param a window-state-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * @param b window-state-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   625
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   628
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
    public static WindowStateListener add(WindowStateListener a,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                                          WindowStateListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
        return (WindowStateListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * Adds window-focus-listener-a with window-focus-listener-b
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     * and returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * @param a window-focus-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * @param b window-focus-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   639
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    public static WindowFocusListener add(WindowFocusListener a,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
                                          WindowFocusListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
        return (WindowFocusListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * Adds action-listener-a with action-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * @param a action-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @param b action-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   652
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   654
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
    public static ActionListener add(ActionListener a, ActionListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
        return (ActionListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * Adds item-listener-a with item-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * @param a item-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * @param b item-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   664
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   666
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
    public static ItemListener add(ItemListener a, ItemListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
        return (ItemListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     * Adds adjustment-listener-a with adjustment-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * @param a adjustment-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     * @param b adjustment-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   676
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   678
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
    public static AdjustmentListener add(AdjustmentListener a, AdjustmentListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
        return (AdjustmentListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
    }
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   682
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   683
    /**
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   684
     * Adds text-listener-a with text-listener-b and
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   685
     * returns the resulting multicast listener.
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   686
     *
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   687
     * @param  a text-listener-a
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   688
     * @param  b text-listener-b
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   689
     * @return the resulting listener
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   690
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   691
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
    public static TextListener add(TextListener a, TextListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
        return (TextListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     * Adds input-method-listener-a with input-method-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * @param a input-method-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * @param b input-method-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   701
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     public static InputMethodListener add(InputMethodListener a, InputMethodListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
        return (InputMethodListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * Adds hierarchy-listener-a with hierarchy-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * @param a hierarchy-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * @param b hierarchy-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   712
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   715
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     public static HierarchyListener add(HierarchyListener a, HierarchyListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
        return (HierarchyListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * Adds hierarchy-bounds-listener-a with hierarchy-bounds-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * @param a hierarchy-bounds-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * @param b hierarchy-bounds-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   725
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     public static HierarchyBoundsListener add(HierarchyBoundsListener a, HierarchyBoundsListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
        return (HierarchyBoundsListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * Adds mouse-wheel-listener-a with mouse-wheel-listener-b and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     * @param a mouse-wheel-listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * @param b mouse-wheel-listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   737
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   740
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
    public static MouseWheelListener add(MouseWheelListener a,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
                                         MouseWheelListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
        return (MouseWheelListener)addInternal(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * Removes the old component-listener from component-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * @param l component-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * @param oldl the component-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   751
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
    public static ComponentListener remove(ComponentListener l, ComponentListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
        return (ComponentListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     * Removes the old container-listener from container-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * @param l container-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * @param oldl the container-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   762
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
    public static ContainerListener remove(ContainerListener l, ContainerListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
        return (ContainerListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * Removes the old focus-listener from focus-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * @param l focus-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * @param oldl the focus-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   773
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
    public static FocusListener remove(FocusListener l, FocusListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
        return (FocusListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * Removes the old key-listener from key-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * @param l key-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     * @param oldl the key-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   784
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
    public static KeyListener remove(KeyListener l, KeyListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
        return (KeyListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * Removes the old mouse-listener from mouse-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * @param l mouse-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * @param oldl the mouse-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   795
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
    public static MouseListener remove(MouseListener l, MouseListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
        return (MouseListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * Removes the old mouse-motion-listener from mouse-motion-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     * and returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     * @param l mouse-motion-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     * @param oldl the mouse-motion-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   806
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
    public static MouseMotionListener remove(MouseMotionListener l, MouseMotionListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
        return (MouseMotionListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * Removes the old window-listener from window-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * @param l window-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * @param oldl the window-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   817
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
    public static WindowListener remove(WindowListener l, WindowListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
        return (WindowListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * Removes the old window-state-listener from window-state-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * and returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * @param l window-state-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * @param oldl the window-state-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   828
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   831
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
    public static WindowStateListener remove(WindowStateListener l,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
                                             WindowStateListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
        return (WindowStateListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * Removes the old window-focus-listener from window-focus-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * and returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * @param l window-focus-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     * @param oldl the window-focus-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   842
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
    public static WindowFocusListener remove(WindowFocusListener l,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
                                             WindowFocusListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
        return (WindowFocusListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     * Removes the old action-listener from action-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * @param l action-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @param oldl the action-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   855
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   857
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
    public static ActionListener remove(ActionListener l, ActionListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
        return (ActionListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * Removes the old item-listener from item-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     * @param l item-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     * @param oldl the item-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   867
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   869
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
    public static ItemListener remove(ItemListener l, ItemListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
        return (ItemListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * Removes the old adjustment-listener from adjustment-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * @param l adjustment-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     * @param oldl the adjustment-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   879
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   881
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
    public static AdjustmentListener remove(AdjustmentListener l, AdjustmentListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
        return (AdjustmentListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
    }
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   885
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   886
    /**
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   887
     * Removes the old text-listener from text-listener-l and
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   888
     * returns the resulting multicast listener.
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   889
     *
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   890
     * @param  l text-listener-l
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   891
     * @param  oldl the text-listener being removed
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   892
     * @return the resulting listener
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   893
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   894
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
    public static TextListener remove(TextListener l, TextListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
        return (TextListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     * Removes the old input-method-listener from input-method-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     * @param l input-method-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     * @param oldl the input-method-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   904
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
    public static InputMethodListener remove(InputMethodListener l, InputMethodListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
        return (InputMethodListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * Removes the old hierarchy-listener from hierarchy-listener-l and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
     * @param l hierarchy-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     * @param oldl the hierarchy-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   915
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   918
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
    public static HierarchyListener remove(HierarchyListener l, HierarchyListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
        return (HierarchyListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     * Removes the old hierarchy-bounds-listener from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     * hierarchy-bounds-listener-l and returns the resulting multicast
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * @param l hierarchy-bounds-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * @param oldl the hierarchy-bounds-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   929
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
    public static HierarchyBoundsListener remove(HierarchyBoundsListener l, HierarchyBoundsListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
        return (HierarchyBoundsListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * Removes the old mouse-wheel-listener from mouse-wheel-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     * and returns the resulting multicast listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     * @param l mouse-wheel-listener-l
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     * @param oldl the mouse-wheel-listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   941
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     */
22282
cf7ce8b79a25 8031550: Fix overloads lint warnings in client code
darcy
parents: 21278
diff changeset
   944
    @SuppressWarnings("overloads")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
    public static MouseWheelListener remove(MouseWheelListener l,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
                                            MouseWheelListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
      return (MouseWheelListener) removeInternal(l, oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * Returns the resulting multicast listener from adding listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     * and listener-b together.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     * If listener-a is null, it returns listener-b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     * If listener-b is null, it returns listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * If neither are null, then it creates and returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * a new AWTEventMulticaster instance which chains a with b.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * @param a event listener-a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     * @param b event listener-b
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   959
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
    protected static EventListener addInternal(EventListener a, EventListener b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
        if (a == null)  return b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
        if (b == null)  return a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
        return new AWTEventMulticaster(a, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * Returns the resulting multicast listener after removing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * old listener from listener-l.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * If listener-l equals the old listener OR listener-l is null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     * returns null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * Else if listener-l is an instance of AWTEventMulticaster,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     * then it removes the old listener from it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     * Else, returns listener l.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * @param l the listener being removed from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * @param oldl the listener being removed
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   977
     * @return the resulting listener
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
    protected static EventListener removeInternal(EventListener l, EventListener oldl) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
        if (l == oldl || l == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
        } else if (l instanceof AWTEventMulticaster) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
            return ((AWTEventMulticaster)l).remove(oldl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
            return l;           // it's not here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   990
   /**
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   991
    * Serialization support. Saves all Serializable listeners
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   992
    * to a serialization stream.
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   993
    *
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   994
    * @param  s the stream to save to
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   995
    * @param  k a prefix stream to put before each serializable listener
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   996
    * @throws IOException if serialization fails
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
   997
    */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
    protected void saveInternal(ObjectOutputStream s, String k) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
        if (a instanceof AWTEventMulticaster) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
            ((AWTEventMulticaster)a).saveInternal(s, k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
        else if (a instanceof Serializable) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
            s.writeObject(k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
            s.writeObject(a);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
        if (b instanceof AWTEventMulticaster) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
            ((AWTEventMulticaster)b).saveInternal(s, k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
        else if (b instanceof Serializable) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
            s.writeObject(k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
            s.writeObject(b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
25162
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1016
   /**
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1017
    * Saves a Serializable listener chain to a serialization stream.
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1018
    *
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1019
    * @param  s the stream to save to
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1020
    * @param  k a prefix stream to put before each serializable listener
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1021
    * @param  l the listener chain to save
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1022
    * @throws IOException if serialization fails
c388078278d4 8043967: Fix doclint warnings for java.awt
yan
parents: 22282
diff changeset
  1023
    */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
    protected static void save(ObjectOutputStream s, String k, EventListener l) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
      if (l == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
          return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
      else if (l instanceof AWTEventMulticaster) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
          ((AWTEventMulticaster)l).saveInternal(s, k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
      else if (l instanceof Serializable) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
           s.writeObject(k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
           s.writeObject(l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     * Recursive method which returns a count of the number of listeners in
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     * EventListener, handling the (common) case of l actually being an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
     * AWTEventMulticaster.  Additionally, only listeners of type listenerType
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     * are counted.  Method modified to fix bug 4513402.  -bchristi
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
     */
11270
d7b0b63bd082 7117334: Warnings cleanup day: reduce number of javac warnings in the java.awt package
bagiras
parents: 5506
diff changeset
  1043
    private static int getListenerCount(EventListener l, Class<?> listenerType) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
        if (l instanceof AWTEventMulticaster) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
            AWTEventMulticaster mc = (AWTEventMulticaster)l;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
            return getListenerCount(mc.a, listenerType) +
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
             getListenerCount(mc.b, listenerType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
        else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
            // Only count listeners of correct type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
            return listenerType.isInstance(l) ? 1 : 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
    /*
26749
b6598aa90114 8055326: Fix typos in client-related packages
serb
parents: 25859
diff changeset
  1056
     * Recursive method which populates EventListener array a with EventListeners
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
     * from l.  l is usually an AWTEventMulticaster.  Bug 4513402 revealed that
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
     * if l differed in type from the element type of a, an ArrayStoreException
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
     * would occur.  Now l is only inserted into a if it's of the appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     * type.  -bchristi
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
    private static int populateListenerArray(EventListener[] a, EventListener l, int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
        if (l instanceof AWTEventMulticaster) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
            AWTEventMulticaster mc = (AWTEventMulticaster)l;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
            int lhs = populateListenerArray(a, mc.a, index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
            return populateListenerArray(a, mc.b, lhs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
        else if (a.getClass().getComponentType().isInstance(l)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
            a[index] = l;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
            return index + 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
        // Skip nulls, instances of wrong class
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
        else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
            return index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
     * Returns an array of all the objects chained as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
     * <code><em>Foo</em>Listener</code>s by the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
     * <code>java.util.EventListener</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
     * <code><em>Foo</em>Listener</code>s are chained by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
     * <code>AWTEventMulticaster</code> using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
     * <code>add<em>Foo</em>Listener</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
     * If a <code>null</code> listener is specified, this method returns an
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
     * empty array. If the specified listener is not an instance of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
     * <code>AWTEventMulticaster</code>, this method returns an array which
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 11270
diff changeset
  1088
     * contains only the specified listener. If no such listeners are chained,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
     * this method returns an empty array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
     * @param l the specified <code>java.util.EventListener</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
     * @param listenerType the type of listeners requested; this parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
     *          should specify an interface that descends from
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
     *          <code>java.util.EventListener</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
     * @return an array of all objects chained as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
     *          <code><em>Foo</em>Listener</code>s by the specified multicast
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
     *          listener, or an empty array if no such listeners have been
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
     *          chained by the specified multicast listener
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
     * @exception NullPointerException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
     *             {@code listenertype} parameter is {@code null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
     * @exception ClassCastException if <code>listenerType</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
     *          doesn't specify a class or interface that implements
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
     *          <code>java.util.EventListener</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
     */
11270
d7b0b63bd082 7117334: Warnings cleanup day: reduce number of javac warnings in the java.awt package
bagiras
parents: 5506
diff changeset
  1107
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
    public static <T extends EventListener> T[]
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
        getListeners(EventListener l, Class<T> listenerType)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
        if (listenerType == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
            throw new NullPointerException ("Listener type should not be null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
        int n = getListenerCount(l, listenerType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
        T[] result = (T[])Array.newInstance(listenerType, n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
        populateListenerArray(result, l, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
}