< prev index next >

src/share/classes/javax/swing/JProgressBar.java

Print this page
rev 1527 : 6727662: Code improvement and warnings removing from swing packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: malenkov


 682     }
 683 
 684     /**
 685      * Removes a <code>ChangeListener</code> from the progress bar.
 686      *
 687      * @param l the <code>ChangeListener</code> to remove
 688      */
 689     public void removeChangeListener(ChangeListener l) {
 690         listenerList.remove(ChangeListener.class, l);
 691     }
 692 
 693     /**
 694      * Returns an array of all the <code>ChangeListener</code>s added
 695      * to this progress bar with <code>addChangeListener</code>.
 696      *
 697      * @return all of the <code>ChangeListener</code>s added or an empty
 698      *         array if no listeners have been added
 699      * @since 1.4
 700      */
 701     public ChangeListener[] getChangeListeners() {
 702         return (ChangeListener[])listenerList.getListeners(
 703                 ChangeListener.class);
 704     }
 705 
 706     /**
 707      * Send a {@code ChangeEvent}, whose source is this {@code JProgressBar}, to
 708      * all {@code ChangeListener}s that have registered interest in
 709      * {@code ChangeEvent}s.
 710      * This method is called each time a {@code ChangeEvent} is received from
 711      * the model.
 712      * <p>
 713      *
 714      * The event instance is created if necessary, and stored in
 715      * {@code changeEvent}.
 716      *
 717      * @see #addChangeListener
 718      * @see EventListenerList
 719      */
 720     protected void fireStateChanged() {
 721         // Guaranteed to return a non-null array
 722         Object[] listeners = listenerList.getListenerList();
 723         // Process the listeners last to first, notifying




 682     }
 683 
 684     /**
 685      * Removes a <code>ChangeListener</code> from the progress bar.
 686      *
 687      * @param l the <code>ChangeListener</code> to remove
 688      */
 689     public void removeChangeListener(ChangeListener l) {
 690         listenerList.remove(ChangeListener.class, l);
 691     }
 692 
 693     /**
 694      * Returns an array of all the <code>ChangeListener</code>s added
 695      * to this progress bar with <code>addChangeListener</code>.
 696      *
 697      * @return all of the <code>ChangeListener</code>s added or an empty
 698      *         array if no listeners have been added
 699      * @since 1.4
 700      */
 701     public ChangeListener[] getChangeListeners() {
 702         return listenerList.getListeners(ChangeListener.class);

 703     }
 704 
 705     /**
 706      * Send a {@code ChangeEvent}, whose source is this {@code JProgressBar}, to
 707      * all {@code ChangeListener}s that have registered interest in
 708      * {@code ChangeEvent}s.
 709      * This method is called each time a {@code ChangeEvent} is received from
 710      * the model.
 711      * <p>
 712      *
 713      * The event instance is created if necessary, and stored in
 714      * {@code changeEvent}.
 715      *
 716      * @see #addChangeListener
 717      * @see EventListenerList
 718      */
 719     protected void fireStateChanged() {
 720         // Guaranteed to return a non-null array
 721         Object[] listeners = listenerList.getListenerList();
 722         // Process the listeners last to first, notifying


< prev index next >