コード例 #1
0
ファイル: JEditTextArea.java プロジェクト: zeph/grinder
 protected void fireCaretEvent() {
   Object[] listeners = listenerList.getListenerList();
   for (int i = listeners.length - 2; i >= 0; i--) {
     if (listeners[i] == CaretListener.class) {
       ((CaretListener) listeners[i + 1]).caretUpdate(caretEvent);
     }
   }
 }
コード例 #2
0
 protected void fireEditingStopped() {
   Object[] listeners = listenerList.getListenerList();
   // Process the listeners last to first, notifying
   // those that are interested in this event
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == CellEditorListener.class) {
       // Lazily create the event:
       if (changeEvent == null) changeEvent = new ChangeEvent(this);
       ((CellEditorListener) listeners[i + 1]).editingStopped(changeEvent);
     }
   }
 }
コード例 #3
0
ファイル: TLangTextField.java プロジェクト: ambro2/popeye
 protected void fireFocusGained(boolean temporary) {
   FocusEvent foo = new FocusEvent(this, this.getID(), temporary);
   // Guaranteed to return a non-null array
   Object[] listeners = listenerList.getListenerList();
   // Process the listeners last to first, notifying
   // those that are interested in this event
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == FocusListener.class) {
       ((FocusListener) listeners[i + 1]).focusGained(foo);
     }
   }
 }
コード例 #4
0
 /**
  * Notifies all listeners that have registered interest for notification on this event type. The
  * event instance is created lazily.
  *
  * @see EventListenerList
  */
 protected void fireStateChanged() {
   // Guaranteed to return a non-null array
   Object[] listeners = listenerList.getListenerList();
   // Process the listeners last to first, notifying
   // those that are interested in this event
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == ChangeListener.class) {
       // Lazily create the event:
       if (changeEvent == null) changeEvent = new ChangeEvent(this);
       ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);
     }
   }
 }
コード例 #5
0
ファイル: TLangTextField.java プロジェクト: ambro2/popeye
  protected void fireActionPerformed(String command) {
    ActionEvent foo = new ActionEvent(this, this.getID(), command);

    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();

    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == ActionListener.class) {
        ((ActionListener) listeners[i + 1]).actionPerformed(foo);
      }
    }
  }
コード例 #6
0
 /**
  * Notifies all listeners that have registered interest for notification on this event type.
  *
  * @param e the <code>ActionEvent</code> to deliver to listeners
  * @see EventListenerList
  */
 protected void fireActionPerformed(ActionEvent e) {
   // Guaranteed to return a non-null array
   Object[] listeners = listenerList.getListenerList();
   // Process the listeners last to first, notifying
   // those that are interested in this event
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == ActionListener.class) {
       // Lazily create the event:
       // if (changeEvent == null)
       // changeEvent = new ChangeEvent(this);
       ((ActionListener) listeners[i + 1]).actionPerformed(e);
     }
   }
 }
コード例 #7
0
 /**
  * Returns an array of all the action listeners registered on this <code>DefaultButtonModel</code>
  * .
  *
  * @return all of this model's <code>ActionListener</code>s or an empty array if no action
  *     listeners are currently registered
  * @see #addActionListener
  * @see #removeActionListener
  * @since 1.4
  */
 public ActionListener[] getActionListeners() {
   return (ActionListener[]) listenerList.getListeners(ActionListener.class);
 }
コード例 #8
0
 /** {@inheritDoc} */
 public void removeActionListener(ActionListener l) {
   listenerList.remove(ActionListener.class, l);
 }
コード例 #9
0
 /** {@inheritDoc} */
 public void addActionListener(ActionListener l) {
   listenerList.add(ActionListener.class, l);
 }
コード例 #10
0
ファイル: TLangTextField.java プロジェクト: ambro2/popeye
 public void removeActionListener(ActionListener listener) {
   if (listenerList != null) {
     listenerList.remove(ActionListener.class, listener);
   }
 }
コード例 #11
0
 /**
  * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s
  * upon this model. <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>DefaultButtonModel</code>
  * instance <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 model,
  *     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
  * @see #getChangeListeners
  * @see #getItemListeners
  * @since 1.3
  */
 public <T extends EventListener> T[] getListeners(Class<T> listenerType) {
   return listenerList.getListeners(listenerType);
 }
コード例 #12
0
 /** {@inheritDoc} */
 public void removeItemListener(ItemListener l) {
   listenerList.remove(ItemListener.class, l);
 }
コード例 #13
0
 public void removeCellEditorListener(CellEditorListener l) {
   listenerList.remove(CellEditorListener.class, l);
 }
コード例 #14
0
 public void addCellEditorListener(CellEditorListener l) {
   listenerList.add(CellEditorListener.class, l);
 }
コード例 #15
0
ファイル: TLangTextField.java プロジェクト: ambro2/popeye
 public void removeFocusListener(FocusListener listener) {
   if (listenerList != null) {
     listenerList.remove(FocusListener.class, listener);
   }
 }
コード例 #16
0
ファイル: TLangTextField.java プロジェクト: ambro2/popeye
 public void addFocusListener(FocusListener listener) {
   if (listenerList != null) {
     listenerList.add(FocusListener.class, listener);
   }
 }
コード例 #17
0
 /** {@inheritDoc} */
 public void addItemListener(ItemListener l) {
   listenerList.add(ItemListener.class, l);
 }
コード例 #18
0
 /** {@inheritDoc} */
 public void addChangeListener(ChangeListener l) {
   listenerList.add(ChangeListener.class, l);
 }
コード例 #19
0
 /**
  * Returns an array of all the item listeners registered on this <code>DefaultButtonModel</code>.
  *
  * @return all of this model's <code>ItemListener</code>s or an empty array if no item listeners
  *     are currently registered
  * @see #addItemListener
  * @see #removeItemListener
  * @since 1.4
  */
 public ItemListener[] getItemListeners() {
   return (ItemListener[]) listenerList.getListeners(ItemListener.class);
 }
コード例 #20
0
 /** {@inheritDoc} */
 public void removeChangeListener(ChangeListener l) {
   listenerList.remove(ChangeListener.class, l);
 }
コード例 #21
0
 /**
  * Returns an array of all the change listeners registered on this <code>DefaultButtonModel</code>
  * .
  *
  * @return all of this model's <code>ChangeListener</code>s or an empty array if no change
  *     listeners are currently registered
  * @see #addChangeListener
  * @see #removeChangeListener
  * @since 1.4
  */
 public ChangeListener[] getChangeListeners() {
   return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
 }
コード例 #22
0
ファイル: TLangTextField.java プロジェクト: ambro2/popeye
 public void addActionListener(ActionListener listener) {
   if (listenerList != null) {
     listenerList.add(ActionListener.class, listener);
   }
 }