gov.nasa.gsfc.drl.rtstps.viewer.commands
Class AbstractCommandAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by gov.nasa.gsfc.drl.rtstps.library.XAction
          extended by gov.nasa.gsfc.drl.rtstps.viewer.commands.AbstractCommandAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
GoAction, LocalLoadAction, RemoteLoadAction, StopAction, UnloadAction

abstract class AbstractCommandAction
extends XAction

A special abstract action for go, stop, load, and unload. It sends messages to registered CommandStateListeners when its action is triggered.


Field Summary
protected  javax.swing.JFrame frame
          The parent JFrame.
private  java.util.LinkedList<CommandStateListener> listeners
           
private static long serialVersionUID
           
protected  RtStpsServices server
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected AbstractCommandAction(java.lang.String text, javax.swing.JFrame frame, RtStpsServices server)
          Create an AbstractCommandAction.
protected AbstractCommandAction(java.lang.String text, javax.swing.JFrame frame, RtStpsServices server, javax.swing.Icon icon)
          Create an AbstractCommandAction with an icon.
 
Method Summary
(package private)  void addCommandStateListener(CommandStateListener csl)
          Add a command state listener.
protected  void notify(int state)
          Notify all listeners of a command state change.
(package private)  void removeCommandStateListener(CommandStateListener csl)
          Remove a command state listener.
 
Methods inherited from class gov.nasa.gsfc.drl.rtstps.library.XAction
actionPerformed, getKeyStroke, getMnemonic, getText, getToolTip
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

frame

protected javax.swing.JFrame frame
The parent JFrame. I use it for error dialogs.


server

protected RtStpsServices server

listeners

private java.util.LinkedList<CommandStateListener> listeners
Constructor Detail

AbstractCommandAction

protected AbstractCommandAction(java.lang.String text,
                                javax.swing.JFrame frame,
                                RtStpsServices server)
Create an AbstractCommandAction.


AbstractCommandAction

protected AbstractCommandAction(java.lang.String text,
                                javax.swing.JFrame frame,
                                RtStpsServices server,
                                javax.swing.Icon icon)
Create an AbstractCommandAction with an icon.

Method Detail

notify

protected final void notify(int state)
Notify all listeners of a command state change.


addCommandStateListener

void addCommandStateListener(CommandStateListener csl)
Add a command state listener.


removeCommandStateListener

void removeCommandStateListener(CommandStateListener csl)
Remove a command state listener.