edu.neu.ccs.gui
Class WindowActionAdapter

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

public class WindowActionAdapter
extends Object
implements WindowListener, Cloneable, Serializable

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

Since:
1.0.1
Version:
2.3.3
See Also:
Serialized Form

Field Summary
protected  ActionSequence activatedActions
          List of actions to be performed upon the notification of window activated events.
protected  ActionSequence closedActions
          List of actions to be performed upon the notification of window closed events.
protected  ActionSequence closingActions
          List of actions to be performed upon the notification of window closing events.
protected  ActionSequence deactivatedActions
          List of actions to be performed upon the notification of window deactivated events.
protected  ActionSequence deiconifiedActions
          List of actions to be performed upon the notification of window deiconified events.
protected  ActionSequence iconifiedActions
          List of actions to be performed upon the notification of window iconified events.
protected  ActionSequence openedActions
          List of actions to be performed upon the notification of window opened events.
 
Constructor Summary
WindowActionAdapter()
          Constructs a window action adapter.
WindowActionAdapter(Window target)
          Constructs a window action adapter listening for window events generated by the given window.
 
Method Summary
 void addWindowActivatedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is activated.
 void addWindowClosedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is closed.
 void addWindowClosingAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is closing.
 void addWindowDeactivatedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is deactivated.
 void addWindowDeiconifiedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is deiconified.
 void addWindowIconifiedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is iconified.
 void addWindowOpenedAction(ActionListener a)
          Adds the given action listener to the action sequence so that it will be performed when the window is opened.
 ActionSequence getWindowActivatedActions()
          Returns the action sequence for window activated events.
 ActionSequence getWindowClosedActions()
          Returns the action sequence for window closed events.
 ActionSequence getWindowClosingActions()
          Returns the action sequence for window closing events.
 ActionSequence getWindowDeactivatedActions()
          Returns the action sequence for window deactivated events.
 ActionSequence getWindowDeiconifiedActions()
          Returns the action sequence for window deiconified events.
 ActionSequence getWindowIconifiedActions()
          Returns the action sequence for window iconified events.
 ActionSequence getWindowOpenedActions()
          Returns the action sequence for window opened events.
 void removeWindowActivatedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is activated.
 void removeWindowClosedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is closed.
 void removeWindowClosingAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is closing.
 void removeWindowDeactivatedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is deactivated.
 void removeWindowDeiconifiedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is deiconified.
 void removeWindowIconifiedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is iconified.
 void removeWindowOpenedAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when the window is opened.
 void setWindowActivatedActions(ActionSequence sequence)
          Sets the action sequence for window activated events to the given action sequence.
 void setWindowClosedActions(ActionSequence sequence)
          Sets the action sequence for window closed events to the given action sequence.
 void setWindowClosingActions(ActionSequence sequence)
          Sets the action sequence for window closing events to the given action sequence.
 void setWindowDeactivatedActions(ActionSequence sequence)
          Sets the action sequence for window deactivated events to the given action sequence.
 void setWindowDeiconifiedActions(ActionSequence sequence)
          Sets the action sequence for window deiconified events to the given action sequence.
 void setWindowIconifiedActions(ActionSequence sequence)
          Sets the action sequence for window iconified events to the given action sequence.
 void setWindowOpenedActions(ActionSequence sequence)
          Sets the action sequence for window opened events to the given action sequence.
 void windowActivated(WindowEvent evt)
          Performs the stored action sequence when the window is activated.
 void windowClosed(WindowEvent evt)
          Performs the stored action sequence when the window is closed.
 void windowClosing(WindowEvent evt)
          Performs the stored action sequence when the window is closing.
 void windowDeactivated(WindowEvent evt)
          Performs the stored action sequence when the window is deactivated.
 void windowDeiconified(WindowEvent evt)
          Performs the stored action sequence when the window is deiconified.
 void windowIconified(WindowEvent evt)
          Performs the stored action sequence when the window is iconified.
 void windowOpened(WindowEvent evt)
          Performs the stored action sequence when the window is opened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activatedActions

protected ActionSequence activatedActions
List of actions to be performed upon the notification of window activated events.


closedActions

protected ActionSequence closedActions
List of actions to be performed upon the notification of window closed events.


closingActions

protected ActionSequence closingActions
List of actions to be performed upon the notification of window closing events.


deactivatedActions

protected ActionSequence deactivatedActions
List of actions to be performed upon the notification of window deactivated events.


deiconifiedActions

protected ActionSequence deiconifiedActions
List of actions to be performed upon the notification of window deiconified events.


iconifiedActions

protected ActionSequence iconifiedActions
List of actions to be performed upon the notification of window iconified events.


openedActions

protected ActionSequence openedActions
List of actions to be performed upon the notification of window opened events.

Constructor Detail

WindowActionAdapter

public WindowActionAdapter()
Constructs a window action adapter.


WindowActionAdapter

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

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

windowActivated

public final void windowActivated(WindowEvent evt)
Performs the stored action sequence when the window is activated.

Specified by:
windowActivated in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowActivatedAction(ActionListener), getWindowActivatedActions()

windowClosed

public final void windowClosed(WindowEvent evt)
Performs the stored action sequence when the window is closed.

Specified by:
windowClosed in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowClosedAction(ActionListener), getWindowClosedActions()

windowClosing

public final void windowClosing(WindowEvent evt)
Performs the stored action sequence when the window is closing.

Specified by:
windowClosing in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowClosingAction(ActionListener), getWindowClosingActions()

windowDeactivated

public final void windowDeactivated(WindowEvent evt)
Performs the stored action sequence when the window is deactivated.

Specified by:
windowDeactivated in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowDeactivatedAction(ActionListener), getWindowDeactivatedActions()

windowDeiconified

public final void windowDeiconified(WindowEvent evt)
Performs the stored action sequence when the window is deiconified.

Specified by:
windowDeiconified in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowDeiconifiedAction(ActionListener), getWindowDeiconifiedActions()

windowIconified

public final void windowIconified(WindowEvent evt)
Performs the stored action sequence when the window is iconified.

Specified by:
windowIconified in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowIconifiedAction(ActionListener), getWindowIconifiedActions()

windowOpened

public final void windowOpened(WindowEvent evt)
Performs the stored action sequence when the window is opened.

Specified by:
windowOpened in interface WindowListener
Parameters:
evt - the window event
See Also:
addWindowOpenedAction(ActionListener), getWindowOpenedActions()

addWindowActivatedAction

public void addWindowActivatedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is activated.

Parameters:
a - the desired action listener
See Also:
removeWindowActivatedAction(ActionListener), setWindowActivatedActions(ActionSequence), getWindowActivatedActions()

addWindowClosedAction

public void addWindowClosedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is closed.

Parameters:
a - the desired action listener
See Also:
removeWindowClosedAction(ActionListener), setWindowClosedActions(ActionSequence), getWindowClosedActions()

addWindowClosingAction

public void addWindowClosingAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is closing.

Parameters:
a - the desired action listener
See Also:
removeWindowClosingAction(ActionListener), setWindowClosingActions(ActionSequence), getWindowClosingActions()

addWindowDeactivatedAction

public void addWindowDeactivatedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is deactivated.

Parameters:
a - the desired action listener
See Also:
removeWindowDeactivatedAction(ActionListener), setWindowDeactivatedActions(ActionSequence), getWindowDeactivatedActions()

addWindowDeiconifiedAction

public void addWindowDeiconifiedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is deiconified.

Parameters:
a - the desired action listener
See Also:
removeWindowDeiconifiedAction(ActionListener), setWindowDeiconifiedActions(ActionSequence), getWindowDeiconifiedActions()

addWindowIconifiedAction

public void addWindowIconifiedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is iconified.

Parameters:
a - the desired action listener
See Also:
removeWindowIconifiedAction(ActionListener), setWindowIconifiedActions(ActionSequence), getWindowIconifiedActions()

addWindowOpenedAction

public void addWindowOpenedAction(ActionListener a)
Adds the given action listener to the action sequence so that it will be performed when the window is opened.

Parameters:
a - the desired action listener
See Also:
removeWindowOpenedAction(ActionListener), setWindowOpenedActions(ActionSequence), getWindowOpenedActions()

removeWindowActivatedAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowActivatedAction(ActionListener), setWindowActivatedActions(ActionSequence), getWindowActivatedActions()

removeWindowClosedAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowClosedAction(ActionListener), setWindowClosedActions(ActionSequence), getWindowClosedActions()

removeWindowClosingAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowClosingAction(ActionListener), setWindowClosingActions(ActionSequence), getWindowClosingActions()

removeWindowDeactivatedAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowDeactivatedAction(ActionListener), setWindowDeactivatedActions(ActionSequence), getWindowDeactivatedActions()

removeWindowDeiconifiedAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowDeiconifiedAction(ActionListener), setWindowDeiconifiedActions(ActionSequence), getWindowDeiconifiedActions()

removeWindowIconifiedAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowIconifiedAction(ActionListener), setWindowIconifiedActions(ActionSequence), getWindowIconifiedActions()

removeWindowOpenedAction

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

Parameters:
a - the action listener to be removed
See Also:
addWindowOpenedAction(ActionListener), setWindowOpenedActions(ActionSequence), getWindowOpenedActions()

setWindowActivatedActions

public void setWindowActivatedActions(ActionSequence sequence)
Sets the action sequence for window activated events to the given action sequence. If null, the action sequence for window activated events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowActivatedActions(), addWindowActivatedAction(ActionListener), removeWindowActivatedAction(ActionListener)

setWindowClosedActions

public void setWindowClosedActions(ActionSequence sequence)
Sets the action sequence for window closed events to the given action sequence. If null, the action sequence for window closed events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowClosedActions(), addWindowClosedAction(ActionListener), removeWindowClosedAction(ActionListener)

setWindowClosingActions

public void setWindowClosingActions(ActionSequence sequence)
Sets the action sequence for window closing events to the given action sequence. If null, the action sequence for window closing events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowClosingActions(), addWindowClosingAction(ActionListener), removeWindowClosingAction(ActionListener)

setWindowDeactivatedActions

public void setWindowDeactivatedActions(ActionSequence sequence)
Sets the action sequence for window deactivated events to the given action sequence. If null, the action sequence for window deactivated events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowDeactivatedActions(), addWindowDeactivatedAction(ActionListener), removeWindowDeactivatedAction(ActionListener)

setWindowDeiconifiedActions

public void setWindowDeiconifiedActions(ActionSequence sequence)
Sets the action sequence for window deiconified events to the given action sequence. If null, the action sequence for window deiconified events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowDeiconifiedActions(), addWindowDeiconifiedAction(ActionListener), removeWindowDeiconifiedAction(ActionListener)

setWindowIconifiedActions

public void setWindowIconifiedActions(ActionSequence sequence)
Sets the action sequence for window iconified events to the given action sequence. If null, the action sequence for window iconified events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowIconifiedActions(), addWindowIconifiedAction(ActionListener), removeWindowIconifiedAction(ActionListener)

setWindowOpenedActions

public void setWindowOpenedActions(ActionSequence sequence)
Sets the action sequence for window opened events to the given action sequence. If null, the action sequence for window opened events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getWindowOpenedActions(), addWindowOpenedAction(ActionListener), removeWindowOpenedAction(ActionListener)

getWindowActivatedActions

public ActionSequence getWindowActivatedActions()
Returns the action sequence for window activated events.

See Also:
setWindowActivatedActions(ActionSequence), addWindowActivatedAction(ActionListener), removeWindowActivatedAction(ActionListener)

getWindowClosedActions

public ActionSequence getWindowClosedActions()
Returns the action sequence for window closed events.

See Also:
setWindowClosedActions(ActionSequence), addWindowClosedAction(ActionListener), removeWindowClosedAction(ActionListener)

getWindowClosingActions

public ActionSequence getWindowClosingActions()
Returns the action sequence for window closing events.

See Also:
setWindowClosingActions(ActionSequence), addWindowClosingAction(ActionListener), removeWindowClosingAction(ActionListener)

getWindowDeactivatedActions

public ActionSequence getWindowDeactivatedActions()
Returns the action sequence for window deactivated events.

See Also:
setWindowDeactivatedActions(ActionSequence), addWindowDeactivatedAction(ActionListener), removeWindowDeactivatedAction(ActionListener)

getWindowDeiconifiedActions

public ActionSequence getWindowDeiconifiedActions()
Returns the action sequence for window deiconified events.

See Also:
setWindowDeiconifiedActions(ActionSequence), addWindowDeiconifiedAction(ActionListener), removeWindowDeiconifiedAction(ActionListener)

getWindowIconifiedActions

public ActionSequence getWindowIconifiedActions()
Returns the action sequence for window iconified events.

See Also:
setWindowIconifiedActions(ActionSequence), addWindowIconifiedAction(ActionListener), removeWindowIconifiedAction(ActionListener)

getWindowOpenedActions

public ActionSequence getWindowOpenedActions()
Returns the action sequence for window opened events.

See Also:
setWindowOpenedActions(ActionSequence), addWindowOpenedAction(ActionListener), removeWindowOpenedAction(ActionListener)