edu.neu.ccs.gui
Class ComponentActionAdapter

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

public class ComponentActionAdapter
extends Object
implements ComponentListener, Cloneable, Serializable

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

Since:
2.2
Version:
2.3.3
See Also:
Serialized Form

Field Summary
protected  ActionSequence hiddenActions
          List of action listeners to be performed upon the notification of component hidden events.
protected  ActionSequence movedActions
          List of action listeners to be performed upon the notification of component moved events.
protected  ActionSequence resizedActions
          List of action listeners to be performed upon the notification of component resized events.
protected  ActionSequence shownActions
          List of action listeners to be performed upon the notification of component shown events.
 
Constructor Summary
ComponentActionAdapter()
          Constructs a component action adapter.
ComponentActionAdapter(Component target)
          Constructs a component action adapter listening for component events generated by the given component.
 
Method Summary
 void addComponentHiddenAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the component is hidden.
 void addComponentMovedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the component is moved.
 void addComponentResizedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the component is resized.
 void addComponentShownAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the component is shown.
 void componentHidden(ComponentEvent evt)
          Performs the stored action listener sequence when the component is hidden.
 void componentMoved(ComponentEvent evt)
          Performs the stored action listener sequence when the component enters the component.
 void componentResized(ComponentEvent evt)
          Performs the stored action listener sequence when the component exits the component.
 void componentShown(ComponentEvent evt)
          Performs the stored action listener sequence when a component button is shown.
 ActionSequence getComponentHiddenActions()
          Returns the action sequence for component hidden events.
 ActionSequence getComponentMovedActions()
          Returns the action sequence for component moved events.
 ActionSequence getComponentResizedActions()
          Returns the action sequence for component resized events.
 ActionSequence getComponentShownActions()
          Returns the action sequence for component shown events.
 void removeComponentHiddenAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the component is hidden.
 void removeComponentMovedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the component is moved.
 void removeComponentResizedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the component is resized.
 void removeComponentShownAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the component is shown.
 void setComponentHiddenActions(ActionSequence sequence)
          Sets the action sequence for component hidden events to the given action sequence.
 void setComponentMovedActions(ActionSequence sequence)
          Sets the action sequence for component moved events to the given action sequence.
 void setComponentResizedActions(ActionSequence sequence)
          Sets the action sequence for component resized events to the given action sequence.
 void setComponentShownActions(ActionSequence sequence)
          Sets the action sequence for component shown events to the given action sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hiddenActions

protected ActionSequence hiddenActions
List of action listeners to be performed upon the notification of component hidden events.


movedActions

protected ActionSequence movedActions
List of action listeners to be performed upon the notification of component moved events.


resizedActions

protected ActionSequence resizedActions
List of action listeners to be performed upon the notification of component resized events.


shownActions

protected ActionSequence shownActions
List of action listeners to be performed upon the notification of component shown events.

Constructor Detail

ComponentActionAdapter

public ComponentActionAdapter()
Constructs a component action adapter.


ComponentActionAdapter

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

Parameters:
target - the component that is listened to
Method Detail

componentHidden

public final void componentHidden(ComponentEvent evt)
Performs the stored action listener sequence when the component is hidden.

Specified by:
componentHidden in interface ComponentListener
Parameters:
evt - the component event
See Also:
addComponentHiddenAction(ActionListener), getComponentHiddenActions()

componentMoved

public final void componentMoved(ComponentEvent evt)
Performs the stored action listener sequence when the component enters the component.

Specified by:
componentMoved in interface ComponentListener
Parameters:
evt - the component event
See Also:
addComponentMovedAction(ActionListener), getComponentMovedActions()

componentResized

public final void componentResized(ComponentEvent evt)
Performs the stored action listener sequence when the component exits the component.

Specified by:
componentResized in interface ComponentListener
Parameters:
evt - the component event
See Also:
addComponentResizedAction(ActionListener), getComponentResizedActions()

componentShown

public final void componentShown(ComponentEvent evt)
Performs the stored action listener sequence when a component button is shown.

Specified by:
componentShown in interface ComponentListener
Parameters:
evt - the component event
See Also:
addComponentShownAction(ActionListener), getComponentShownActions()

addComponentHiddenAction

public void addComponentHiddenAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the component is hidden.

Parameters:
a - the desired action listener
See Also:
removeComponentHiddenAction(ActionListener), setComponentHiddenActions(ActionSequence), getComponentHiddenActions()

addComponentMovedAction

public void addComponentMovedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the component is moved.

Parameters:
a - the desired action listener
See Also:
removeComponentMovedAction(ActionListener), setComponentMovedActions(ActionSequence), getComponentMovedActions()

addComponentResizedAction

public void addComponentResizedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the component is resized.

Parameters:
a - the desired action listener
See Also:
removeComponentResizedAction(ActionListener), setComponentResizedActions(ActionSequence), getComponentResizedActions()

addComponentShownAction

public void addComponentShownAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the component is shown.

Parameters:
a - the desired action listener
See Also:
removeComponentShownAction(ActionListener), setComponentShownActions(ActionSequence), getComponentShownActions()

removeComponentHiddenAction

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

Parameters:
a - the action listener to be removed
See Also:
addComponentHiddenAction(ActionListener), setComponentHiddenActions(ActionSequence), getComponentHiddenActions()

removeComponentMovedAction

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

Parameters:
a - the action to be removed
See Also:
addComponentMovedAction(ActionListener), setComponentMovedActions(ActionSequence), getComponentMovedActions()

removeComponentResizedAction

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

Parameters:
a - the action listener to be removed
See Also:
addComponentResizedAction(ActionListener), setComponentResizedActions(ActionSequence), getComponentResizedActions()

removeComponentShownAction

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

Parameters:
a - the action to be removed
See Also:
addComponentShownAction(ActionListener), setComponentShownActions(ActionSequence), getComponentShownActions()

setComponentHiddenActions

public void setComponentHiddenActions(ActionSequence sequence)
Sets the action sequence for component hidden events to the given action sequence. If null, the action sequence for component hidden events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getComponentHiddenActions(), addComponentHiddenAction(ActionListener), removeComponentHiddenAction(ActionListener)

setComponentMovedActions

public void setComponentMovedActions(ActionSequence sequence)
Sets the action sequence for component moved events to the given action sequence. If null, the action sequence for component moved events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getComponentMovedActions(), addComponentMovedAction(ActionListener), removeComponentMovedAction(ActionListener)

setComponentResizedActions

public void setComponentResizedActions(ActionSequence sequence)
Sets the action sequence for component resized events to the given action sequence. If null, the action sequence for component resized events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
setComponentResizedActions(ActionSequence), addComponentResizedAction(ActionListener), removeComponentResizedAction(ActionListener)

setComponentShownActions

public void setComponentShownActions(ActionSequence sequence)
Sets the action sequence for component shown events to the given action sequence. If null, the action sequence for component shown events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getComponentShownActions(), addComponentShownAction(ActionListener), removeComponentShownAction(ActionListener)

getComponentHiddenActions

public ActionSequence getComponentHiddenActions()
Returns the action sequence for component hidden events.

See Also:
setComponentHiddenActions(ActionSequence), addComponentHiddenAction(ActionListener), removeComponentHiddenAction(ActionListener)

getComponentMovedActions

public ActionSequence getComponentMovedActions()
Returns the action sequence for component moved events.

See Also:
setComponentMovedActions(ActionSequence), addComponentMovedAction(ActionListener), removeComponentMovedAction(ActionListener)

getComponentResizedActions

public ActionSequence getComponentResizedActions()
Returns the action sequence for component resized events.

See Also:
setComponentResizedActions(ActionSequence), addComponentResizedAction(ActionListener), removeComponentResizedAction(ActionListener)

getComponentShownActions

public ActionSequence getComponentShownActions()
Returns the action sequence for component shown events.

See Also:
setComponentShownActions(ActionSequence), addComponentShownAction(ActionListener), removeComponentShownAction(ActionListener)