edu.neu.ccs.gui
Class ChangeActionAdapter

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

public class ChangeActionAdapter
extends Object
implements ChangeListener, Cloneable, Serializable

An adapter class for receiving change events, and performing actions in response to those events.

Since:
1.0
Version:
2.3.3
See Also:
Serialized Form

Field Summary
protected  ActionSequence changeActions
          List of actions to be performed upon the notification of adjustment change events.
 
Constructor Summary
ChangeActionAdapter()
           
 
Method Summary
 void addChangeAction(ActionListener a)
          Adds the given action listener to this adapter so that it will be performed when the state of the target object is adjusted.
 ActionSequence getChangeActions()
          Returns the action sequence for change events.
 void removeChangeAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the state of the target object is adjusted.
 void setChangeActions(ActionSequence sequence)
          Sets the action sequence for change events to the provided action sequence.
 void stateChanged(ChangeEvent evt)
          Performs the stored action sequence when the state of the target object is changed.
 
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 actions to be performed upon the notification of adjustment change events.

Constructor Detail

ChangeActionAdapter

public ChangeActionAdapter()
Method Detail

stateChanged

public final void stateChanged(ChangeEvent evt)
Performs the stored action sequence when the state of the target object is changed.

Specified by:
stateChanged in interface ChangeListener
Parameters:
evt - the change event to be handled

addChangeAction

public void addChangeAction(ActionListener a)
Adds the given action listener to this adapter so that it will be performed when the state of the target object is adjusted.

Parameters:
a - the action to be performed
See Also:
removeChangeAction(ActionListener), setChangeActions(ActionSequence), getChangeActions()

removeChangeAction

public void removeChangeAction(ActionListener a)
Removes the given action listener from this adapter so that it will be no longer be performed when the state of the target object is adjusted.

Parameters:
a - the action to be removed
See Also:
addChangeAction(ActionListener), setChangeActions(ActionSequence), getChangeActions()

setChangeActions

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

Parameters:
sequence - the desired action sequence
See Also:
getChangeActions(), addChangeAction(ActionListener), removeChangeAction(ActionListener)

getChangeActions

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

See Also:
setChangeActions(ActionSequence), addChangeAction(ActionListener), removeChangeAction(ActionListener)