Ejemplo n.º 1
0
 /**
  * Runs each <code>ChangeListener</code>'s <code>stateChanged</code> method.
  * <!-- @see #setRangeProperties    //bad link-->
  *
  * @see EventListenerList
  */
 protected void fireStateChanged() {
   Object[] listeners = listenerList.getListenerList();
   for (int i = listeners.length - 2; i >= 0; i -= 2) {
     if (listeners[i] == ChangeListener.class) {
       if (changeEvent == null) {
         changeEvent = new ChangeEvent(this);
       }
       ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);
     }
   }
 }
Ejemplo n.º 2
0
 /**
  * Adds a <code>ChangeListener</code> to the model.
  *
  * @param l the <code>ChangeListener</code> to be added
  */
 public void addChangeListener(ChangeListener l) {
   listenerList.add(ChangeListener.class, l);
 }
Ejemplo n.º 3
0
 /**
  * Returns an array of all the <code>ChangeListener</code>s added to this <code>
  * DefaultColorSelectionModel</code> with <code>addChangeListener</code>.
  *
  * @return all of the <code>ChangeListener</code>s added, or an empty array if no listeners have
  *     been added
  * @since 1.4
  */
 public ChangeListener[] getChangeListeners() {
   return listenerList.getListeners(ChangeListener.class);
 }
Ejemplo n.º 4
0
 /**
  * Removes a <code>ChangeListener</code> from the model.
  *
  * @param l the <code>ChangeListener</code> to be removed
  */
 public void removeChangeListener(ChangeListener l) {
   listenerList.remove(ChangeListener.class, l);
 }