edu.neu.ccs.gui
Interface SupportsPropertyChange

All Known Subinterfaces:
Paintable
All Known Implementing Classes:
AbstractPaintable, BaseShape, JPTComponent

public interface SupportsPropertyChange

SupportsPropertyChange is an interface for objects that can add PropertyChangeListener objects, can fire PropertyChangeEvent events directly to those listeners, and can forward internal PropertyChangeEvent events to those listeners as well.

Many of the methods in this interface are identical to methods found in one or more of the following Java classes:

The documentation below will indicate which of these classes has the particular method.

Since:
2.3
Version:
2.3

Method Summary
 void addForwardingListener(Object object)
          Add the forwarding listener as a property change listener for the given object if the object supports property change.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list for a specific property.
 void addPropertyChangeListeners(PropertyChangeListener[] listeners)
          Add all items in the given PropertyChangeListener array to the listener list.
 void addPropertyChangeListeners(String propertyName, PropertyChangeListener[] listeners)
          Add all items in the given PropertyChangeListener array to the listener list for a specific property.
 void firePropertyChange(PropertyChangeEvent evt)
          Fire an existing PropertyChangeEvent to any registered listeners.
 void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, byte oldValue, byte newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, char oldValue, char newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, double oldValue, double newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, float oldValue, float newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, int oldValue, int newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, long oldValue, long newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, short oldValue, short newValue)
          Report a bound property update to any registered listeners.
 PropertyChangeForwardingListener getForwardingListener()
          Returns the PropertyChangeForwardingListener that will forward the property change events it receives to this object.
 PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all listeners that were added to this object.
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
          Returns an array of all listeners that were added to this object and associated with the named property.
 boolean hasListeners(String propertyName)
          Check if there are any listeners for a specific property.
 void removeAndAddForwardingListener(Object oldobject, Object newobject)
          Remove the forwarding listener as a property change listener for the old object if the old object supports property change and add the forwarding listener as a property change listener for the new object if the new object supports property change.
 void removeForwardingListener(Object object)
          Remove the forwarding listener as a property change listener for the given object if the object supports property change.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)

Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

This method is found in:

  • Component
  • JComponent
  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
listener - the PropertyChangeListener to be added

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)

Add a PropertyChangeListener to the listener list for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

This method is found in:

  • Component
  • JComponent
  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
propertyName - the name of the property to listen on
listener - the PropertyChangeListener to be added

addPropertyChangeListeners

public void addPropertyChangeListeners(PropertyChangeListener[] listeners)

Add all items in the given PropertyChangeListener array to the listener list. These items are registered for all properties.

Parameters:
listeners - the PropertyChangeListener array to be added

addPropertyChangeListeners

public void addPropertyChangeListeners(String propertyName,
                                       PropertyChangeListener[] listeners)

Add all items in the given PropertyChangeListener array to the listener list for a specific property. These items will be invoked only when a call on firePropertyChange names that specific property.

Parameters:
listeners - the PropertyChangeListener array to be added

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)

Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

This method is found in:

  • Component
  • JComponent
  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
listener - the PropertyChangeListener to be removed

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)

Remove a PropertyChangeListener for a specific property.

This method is found in:

  • Component
  • JComponent
  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
propertyName - the name of the property that was listened on
listener - the PropertyChangeListener to be removed

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()

Returns an array of all listeners that were added to this object.

This method is found in:

  • Component
  • JComponent
  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Returns:
an array with all listeners

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)

Returns an array of all listeners that were added to this object and associated with the named property.

This method is found in:

  • Component
  • JComponent
  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
propertyName - the name of the property to seek
Returns:
an array with all listeners for the given named property

hasListeners

public boolean hasListeners(String propertyName)

Check if there are any listeners for a specific property.

This method is found in:

  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
propertyName - the name of the property to check
Returns:
whether or not there are any listeners for a specific property

firePropertyChange

public void firePropertyChange(String propertyName,
                               Object oldValue,
                               Object newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal and non-null.

This method is found in:

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               boolean oldValue,
                               boolean newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               char oldValue,
                               char newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

  • JComponent

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               byte oldValue,
                               byte newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

  • JComponent

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               short oldValue,
                               short newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

  • JComponent

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               int oldValue,
                               int newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               long oldValue,
                               long newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

  • JComponent

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               float oldValue,
                               float newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

  • JComponent

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

firePropertyChange

public void firePropertyChange(String propertyName,
                               double oldValue,
                               double newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

This is merely a convenience wrapper around the more general firePropertyChange method that takes Object values.

This method is found in:

  • JComponent

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

firePropertyChange

public void firePropertyChange(PropertyChangeEvent evt)

Fire an existing PropertyChangeEvent to any registered listeners. No event is fired if the given event's old and new values are equal and non-null.

This method is found in:

  • PropertyChangeSupport
  • SwingPropertyChangeSupport

Parameters:
evt - the PropertyChangeEvent object

getForwardingListener

public PropertyChangeForwardingListener getForwardingListener()

Returns the PropertyChangeForwardingListener that will forward the property change events it receives to this object.

Returns:
the forwarding listener

addForwardingListener

public void addForwardingListener(Object object)
Add the forwarding listener as a property change listener for the given object if the object supports property change.

Parameters:
object - the object that should add the forwarding listener

removeForwardingListener

public void removeForwardingListener(Object object)
Remove the forwarding listener as a property change listener for the given object if the object supports property change.

Parameters:
object - the object that should remove the forwarding listener

removeAndAddForwardingListener

public void removeAndAddForwardingListener(Object oldobject,
                                           Object newobject)
Remove the forwarding listener as a property change listener for the old object if the old object supports property change and add the forwarding listener as a property change listener for the new object if the new object supports property change.

Parameters:
oldobject - the old object that should remove the forwarding listener
newobject - the new object that should add the forwarding listener