JSR-209 (Final Release)

javax.swing.event
Class SwingPropertyChangeSupport

java.lang.Object
  extended byjava.beans.PropertyChangeSupport
      extended byjavax.swing.event.SwingPropertyChangeSupport
All Implemented Interfaces:
java.io.Serializable

public final class SwingPropertyChangeSupport
extends java.beans.PropertyChangeSupport

This subclass of java.beans.PropertyChangeSupport is identical in functionality -- it sacrifices thread-safety (not a Swing concern) for reduce memory consumption, which helps performance (both big Swing concerns). Most of the overridden methods are only necessary because all of PropertyChangeSupport's instance data is private, without accessor methods.


Constructor Summary
SwingPropertyChangeSupport(java.lang.Object sourceBean)
          Constructs a SwingPropertyChangeSupport object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Report a bound property update to any registered listeners.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all the listeners that were added to the SwingPropertyChangeSupport object with addPropertyChangeListener().
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingPropertyChangeSupport

public SwingPropertyChangeSupport(java.lang.Object sourceBean)
Constructs a SwingPropertyChangeSupport object.

Parameters:
sourceBean - The bean to be given as the source for any events.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

Parameters:
listener - The PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - The PropertyChangeListener to be removed

getPropertyChangeListeners

public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the listeners that were added to the SwingPropertyChangeSupport object with addPropertyChangeListener().

Returns:
all of the PropertyChangeListeners added or an empty array if no listeners have been added
Since:
1.4
See Also:
PropertyChangeSupport.getPropertyChangeListeners()

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.

Parameters:
propertyName - The programmatic name of the property that was changed.
oldValue - The old value of the property.
newValue - The new value of the property.

JSR-209 (Final Release)

Java and Java 2D are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Copyright 1993 - 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All Rights Reserved.
Use of this specification is subject to this license.