|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.viewer.commands.CommandButtons
public class CommandButtons
This class controls the primary RT-STPS button commands. It creates the appropriate Action classes and links them so they enable or disable themselves depending on the current command state. Not all XActions may be defined here.
ButtonCommands is a StatusListener so that it can see external changes to the command state and thereby change the enable/disable status of the buttons. It should be attached to the Distributor to listen for state- related StatusItems.
A client may register with ButtonCommands as a CommandStateListener. The client will be notified of command state changes due to button presses. It will NOT be notified of command state changes due to external events, which is available from the Distributor as periodic StatusItems.
If a client needs command state change notification, it should register instead as a CommandStateListener with CommandState, which will notify it of both internal and external command state changes.
Field Summary | |
---|---|
private int |
currentState
This is the last state I saw from the Distributor. |
private ExitAction |
exit
|
private GoAction |
go
|
private boolean |
isLoaded
|
private LocalLoadAction |
lload
|
private RemoteLoadAction |
rload
|
private StopAction |
stop
|
private UnloadAction |
unload
|
private ZeroAction |
zero
|
Constructor Summary | |
---|---|
CommandButtons(javax.swing.JFrame frame,
RtStpsServices server,
int initialCommandState)
Create the command buttons. |
Method Summary | |
---|---|
void |
addCommandStateListener(CommandStateListener csl)
|
XAction |
getExitAction()
|
XAction |
getGoAction()
|
XAction |
getLocalLoadAction()
|
XAction |
getRemoteLoadAction()
|
XAction |
getStopAction()
|
XAction |
getUnloadAction()
|
XAction |
getZeroAction()
|
void |
processStatusItem(StatusItem item,
java.lang.String fullName)
Process command state status items so that the button's enable/disable state reflect the current command state. |
void |
removeCommandStateListener(CommandStateListener csl)
|
private void |
setButtonState(int state)
Change the enable/disable status of the buttons depending on the command state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private LocalLoadAction lload
private RemoteLoadAction rload
private GoAction go
private StopAction stop
private UnloadAction unload
private ExitAction exit
private ZeroAction zero
private int currentState
private boolean isLoaded
Constructor Detail |
---|
public CommandButtons(javax.swing.JFrame frame, RtStpsServices server, int initialCommandState)
Method Detail |
---|
public final XAction getLocalLoadAction()
public final XAction getRemoteLoadAction()
public final XAction getGoAction()
public final XAction getStopAction()
public final XAction getUnloadAction()
public final XAction getExitAction()
public final XAction getZeroAction()
public void addCommandStateListener(CommandStateListener csl)
public void removeCommandStateListener(CommandStateListener csl)
public void processStatusItem(StatusItem item, java.lang.String fullName)
processStatusItem
in interface StatusListener
private void setButtonState(int state)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |