stella.jview
Class JSimpleCommand

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.MessageEvent
              extended by stella.CommandEvent
                  extended by stella.command.SimpleCommand
                      extended by stella.jview.JSimpleCommand
All Implemented Interfaces:
Serializable, Displayable, JDisplayableCommand

public class JSimpleCommand
extends SimpleCommand
implements JDisplayableCommand

A generic command event that allows JDisplayableCommand capabilities for non-command line commands.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class stella.CommandEvent
CommandEvent.Create
 
Field Summary
private  JButton command
          The button representing the command.
private  CommandEvent wrap
          We deliver exactly the command we were constructed qwith.
 
Fields inherited from class stella.CommandEvent
COMMANDPACKAGE, JVIEWPACKAGE, TYPESEPARATOR
 
Fields inherited from class stella.MessageEvent
SEPCHAR
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
JSimpleCommand(CommandEvent ce)
          Constructs a command event from a simple command.
 
Method Summary
 void addActionListener(ActionListener box)
          Adds an action listener to the command button.
 CommandEvent getCommand()
          The fully qualified command for simple commands does not need anything.
 Icon getIcon()
          Return null.
 Component getRepresentation()
          Returns the button displaying the command name.
 boolean isEnabled()
          Returns the enabled state of the button displayed.
 void removeActionListener(ActionListener box)
          Removes the action listener from the command button.
 void setEnabled(boolean isactive)
          Enables or disables the component.
 
Methods inherited from class stella.command.SimpleCommand
getLine, parseLine
 
Methods inherited from class stella.CommandEvent
classNameToTemplate, createCommand, createCommand, createJCommand, extractType, getExpectedAcknowledgeNumber, parseForStrings, templateToClassName
 
Methods inherited from class stella.MessageEvent
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, readFromBufferedStream, setNr, setTime, setType, setValid, toString
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.jview.JDisplayableCommand
getType
 

Field Detail

command

private JButton command
The button representing the command. Its label is the command name.


wrap

private CommandEvent wrap
We deliver exactly the command we were constructed qwith.

Constructor Detail

JSimpleCommand

public JSimpleCommand(CommandEvent ce)
Constructs a command event from a simple command.

Method Detail

getIcon

public Icon getIcon()
Return null.

Specified by:
getIcon in interface Displayable

getRepresentation

public Component getRepresentation()
Returns the button displaying the command name.

Specified by:
getRepresentation in interface Displayable

addActionListener

public void addActionListener(ActionListener box)
Adds an action listener to the command button.

Specified by:
addActionListener in interface JDisplayableCommand

removeActionListener

public void removeActionListener(ActionListener box)
Removes the action listener from the command button.

Specified by:
removeActionListener in interface JDisplayableCommand

getCommand

public CommandEvent getCommand()
The fully qualified command for simple commands does not need anything. To allow this event to also implement different interface, we deliver the command we were constructed with.

Specified by:
getCommand in interface JDisplayableCommand

isEnabled

public boolean isEnabled()
Returns the enabled state of the button displayed.

Specified by:
isEnabled in interface JDisplayableCommand

setEnabled

public void setEnabled(boolean isactive)
Enables or disables the component. Disabled components never return or deliver command events.

Specified by:
setEnabled in interface JDisplayableCommand