protected void saveInternal(ObjectOutputStream s, String k) throws IOException {
    if (a instanceof AWTEventMulticaster) {
      ((AWTEventMulticaster) a).saveInternal(s, k);
    } else if (a instanceof Serializable) {
      s.writeObject(k);
      s.writeObject(a);
    }

    if (b instanceof AWTEventMulticaster) {
      ((AWTEventMulticaster) b).saveInternal(s, k);
    } else if (b instanceof Serializable) {
      s.writeObject(k);
      s.writeObject(b);
    }
  }
예제 #2
0
 @Override
 public synchronized void removeAdjustmentListener(final AdjustmentListener l) {
   if (l == null) {
     return;
   }
   adjustmentListener = AWTEventMulticaster.remove(adjustmentListener, l);
 }
예제 #3
0
 /**
  * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s
  * upon this <code>MenuItem</code>. <code><em>Foo</em>Listener</code>s are registered using the
  * <code>add<em>Foo</em>Listener</code> method.
  *
  * <p>You can specify the <code>listenerType</code> argument with a class literal, such as <code>
  * <em>Foo</em>Listener.class</code>. For example, you can query a <code>MenuItem</code> <code>m
  * </code> for its action listeners with the following code:
  *
  * <pre>ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));</pre>
  *
  * If no such listeners exist, this method returns an empty array.
  *
  * @param listenerType the type of listeners requested; this parameter should specify an interface
  *     that descends from <code>java.util.EventListener</code>
  * @return an array of all objects registered as <code><em>Foo</em>Listener</code>s on this menu
  *     item, or an empty array if no such listeners have been added
  * @exception ClassCastException if <code>listenerType</code> doesn't specify a class or interface
  *     that implements <code>java.util.EventListener</code>
  * @see #getActionListeners
  * @since 1.3
  */
 public <T extends EventListener> T[] getListeners(Class<T> listenerType) {
   EventListener l = null;
   if (listenerType == ActionListener.class) {
     l = actionListener;
   }
   return AWTEventMulticaster.getListeners(l, listenerType);
 }
예제 #4
0
 /**
  * Adds the specified action listener to receive action events from this text field. If l is null,
  * no exception is thrown and no action is performed.
  *
  * @param l the action listener.
  * @see #removeActionListener
  * @see #getActionListeners
  * @see java.awt.event.ActionListener
  * @since JDK1.1
  */
 public synchronized void addActionListener(ActionListener l) {
   if (l == null) {
     return;
   }
   actionListener = AWTEventMulticaster.add(actionListener, l);
   newEventsOnly = true;
 }
 protected static void save(ObjectOutputStream s, String k, EventListener l) throws IOException {
   if (l == null) {
     return;
   } else if (l instanceof AWTEventMulticaster) {
     ((AWTEventMulticaster) l).saveInternal(s, k);
   } else if (l instanceof Serializable) {
     s.writeObject(k);
     s.writeObject(l);
   }
 }
 /**
  * Returns an array of all the adjustment listeners registered on this scrollbar.
  *
  * @return all of this scrollbar's <code>AdjustmentListener</code>s or an empty array if no
  *     adjustment listeners are currently registered
  * @see #addAdjustmentListener
  * @see #removeAdjustmentListener
  * @see java.awt.event.AdjustmentEvent
  * @see java.awt.event.AdjustmentListener
  * @since 1.4
  */
 public synchronized AdjustmentListener[] getAdjustmentListeners() {
   return (AdjustmentListener[])
       AWTEventMulticaster.getListeners(
           (EventListener) adjustmentListener, AdjustmentListener.class);
 }
예제 #7
0
 public void addActionListener(ActionListener l) {
   selectionListener = AWTEventMulticaster.add(selectionListener, l);
 }
예제 #8
0
 /**
  * Removes the specified <code>ActionListener</code> from the list of registers listeners for this
  * object.
  *
  * @param listener The listener to remove.
  */
 public synchronized void removeActionListener(ActionListener listener) {
   action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
 }
예제 #9
0
 /**
  * Removes the specified action listener so that it no longer receives action events from this
  * text field. If l is null, no exception is thrown and no action is performed.
  *
  * @param l the action listener.
  * @see #addActionListener
  * @see #getActionListeners
  * @see java.awt.event.ActionListener
  * @since JDK1.1
  */
 public synchronized void removeActionListener(ActionListener l) {
   if (l == null) {
     return;
   }
   actionListener = AWTEventMulticaster.remove(actionListener, l);
 }
예제 #10
0
 public void removeContainerListener(ContainerListener listener) {
   cntrListener = AWTEventMulticaster.remove(cntrListener, listener);
 }
예제 #11
0
 synchronized void removeWindowListener(WindowListener l) {
   windowListener = AWTEventMulticaster.remove(windowListener, l);
 }
예제 #12
0
 synchronized void addWindowListener(WindowListener l) {
   windowListener = AWTEventMulticaster.add(windowListener, l);
 }
예제 #13
0
 /**
  * Removes the specified <code>ItemListener</code> from the list of registers listeners for this
  * object.
  *
  * @param listener The listener to remove.
  */
 public synchronized void removeItemListener(ItemListener listener) {
   item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
 }
예제 #14
0
 /**
  * Adds the specified <code>ItemListener</code> to the list of registered listeners for this
  * object.
  *
  * @param listener The listener to add.
  */
 public synchronized void addItemListener(ItemListener listener) {
   item_listeners = AWTEventMulticaster.add(item_listeners, listener);
 }
예제 #15
0
 /** Adds an action listener. */
 public synchronized void addActionListener(ActionListener l) {
   if (l != null) {
     actionListener = AWTEventMulticaster.add(actionListener, l);
   }
 }
예제 #16
0
 public void addContainerListener(ContainerListener newListener) {
   cntrListener = AWTEventMulticaster.add(cntrListener, newListener);
 }
예제 #17
0
 public void removeActionListener(ActionListener l) {
   selectionListener = AWTEventMulticaster.remove(selectionListener, l);
 }
예제 #18
0
 public void addTextListener(TextListener l) {
   textListener = AWTEventMulticaster.add(textListener, l);
 }
예제 #19
0
 public void removeTextListener(TextListener l) {
   textListener = AWTEventMulticaster.remove(textListener, l);
 }
예제 #20
0
  /**
   * Writes default serializable fields to stream. Writes a list of serializable ActionListener(s)
   * as optional data. The non-serializable ActionListener(s) are detected and no attempt is made to
   * serialize them.
   *
   * @serialData Null terminated sequence of zero or more pairs. A pair consists of a String and
   *     Object. The String indicates the type of object and is one of the following :
   *     ActionListenerK indicating and ActionListener object.
   * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
   * @see java.awt.Component#actionListenerK
   */
  private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();

    AWTEventMulticaster.save(s, actionListenerK, actionListener);
    s.writeObject(null);
  }
예제 #21
0
 /**
  * Adds the specified <code>ActionListener</code> to the list of registered listeners for this
  * object.
  *
  * @param listener The listener to add.
  */
 public synchronized void addActionListener(ActionListener listener) {
   action_listeners = AWTEventMulticaster.add(action_listeners, listener);
 }