edu.neu.ccs.gui
Class PropertyChangeActionAdapter

java.lang.Object
  extended byedu.neu.ccs.gui.PropertyChangeActionAdapter
All Implemented Interfaces:
Cloneable, EventListener, PropertyChangeListener, Serializable

public class PropertyChangeActionAdapter
extends Object
implements PropertyChangeListener, Cloneable, Serializable

An adapter class for receiving property change events, and performing action listeners in response to those events.

Since:
1.0.1
Version:
2.3.3
See Also:
Serialized Form

Field Summary
protected  ActionSequence changeActions
          List of action listeners to be performed upon the notification of property change events.
 
Constructor Summary
PropertyChangeActionAdapter()
          Constructs a property change action adapter.
PropertyChangeActionAdapter(Component target)
          Constructs a property change action adapter listening for property change events generated by the given component.
 
Method Summary
 void addPropertyChangeAction(ActionListener a)
          Adds an action listener to this adapter so that it will be performed when a property is changed.
 ActionSequence getPropertyChangeActions()
          Returns the action sequence for property change events.
 void propertyChange(PropertyChangeEvent evt)
          Performs the stored action sequence when a property has been changed.
 void removePropertyChangeAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when a property is changed.
 void setPropertyChangeActions(ActionSequence sequence)
          Sets the action sequence for property change events to the provided action sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changeActions

protected ActionSequence changeActions
List of action listeners to be performed upon the notification of property change events.

Constructor Detail

PropertyChangeActionAdapter

public PropertyChangeActionAdapter()
Constructs a property change action adapter.


PropertyChangeActionAdapter

public PropertyChangeActionAdapter(Component target)
Constructs a property change action adapter listening for property change events generated by the given component. If null, this adapter does not listen to a particular component by default.

Parameters:
target - the source component to listen to
Method Detail

propertyChange

public final void propertyChange(PropertyChangeEvent evt)
Performs the stored action sequence when a property has been changed.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
evt - the property change event to be handled

addPropertyChangeAction

public void addPropertyChangeAction(ActionListener a)
Adds an action listener to this adapter so that it will be performed when a property is changed.

Parameters:
a - the action listener to be performed
See Also:
removePropertyChangeAction(ActionListener), setPropertyChangeActions(ActionSequence), getPropertyChangeActions()

removePropertyChangeAction

public void removePropertyChangeAction(ActionListener a)
Removes the given action listener from this adapter so that it will be no longer be performed when a property is changed.

Parameters:
a - the action listener to be removed
See Also:
addPropertyChangeAction(ActionListener), setPropertyChangeActions(ActionSequence), getPropertyChangeActions()

setPropertyChangeActions

public void setPropertyChangeActions(ActionSequence sequence)
Sets the action sequence for property change events to the provided action sequence. If null, the action sequence for property change events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getPropertyChangeActions(), addPropertyChangeAction(ActionListener), removePropertyChangeAction(ActionListener)

getPropertyChangeActions

public ActionSequence getPropertyChangeActions()
Returns the action sequence for property change events.

See Also:
setPropertyChangeActions(ActionSequence), addPropertyChangeAction(ActionListener), removePropertyChangeAction(ActionListener)