stella.jview
Interface JDisplayableCommand

All Superinterfaces:
Displayable
All Known Implementing Classes:
JMoveTelescope, JSimpleCommand

public interface JDisplayableCommand
extends Displayable

An interface comprising functionality for successfully allowing a stella command to be entered from a JPanel. Commands that do not implement this interface can still be used in a JLaunchBox if they are simple commands. This interface's Displayable.getRepresentation() method returns a Component which consists of any input field necessary to allow the user to fully specifiy the command that is implementing this interface.

If the method getCommand() is called a fully qualified command event should be returned to the caller, ready for delivery to any CommandLaunching instances.

Command implementing this interface must also provide a possibility for adding action listeners to it, which are used to actually send the command. Thus, a move telescope command may consist of a button that actually delivers the ActionEvent and textfields where the use can specify the objects position. Action events delivered by these text fields should not reach the outside world, thus such a command will register to the text fileds as an action listener somewhere during the construction/initalization process.

Note that, as a general contract, any instances implementing this interface should additionally supply a constructor with a single source Object as an argument.


Method Summary
 void addActionListener(ActionListener box)
          This method adds an action listener to the command.
 CommandEvent getCommand()
          This method returns a fully qualified command event.
 String getType()
          Returns the type of the displayable command.
 boolean isEnabled()
          Returns the current activity status of the command.
 void removeActionListener(ActionListener box)
          Removes the command delivering instance from this commands notification method.
 void setEnabled(boolean isactive)
          Sets the command active or inactive.
 
Methods inherited from interface jview.Displayable
getIcon, getRepresentation
 

Method Detail

addActionListener

void addActionListener(ActionListener box)
This method adds an action listener to the command. The action listener should be notified if the user want to invoke command delivery to a command listener. As action events can carry only simple strings in their ActionEvent.getActionCommand(), the additional method getCommand() should be called to retrieve the CommandEvent that then should be sent to the command lsitener.


removeActionListener

void removeActionListener(ActionListener box)
Removes the command delivering instance from this commands notification method.


getCommand

CommandEvent getCommand()
This method returns a fully qualified command event. In the non-trivial case, when the command has some command lines, they have to be constructed from textfields, buttons, etc. originally delivered with the JPanel in Displayable.getRepresentation().


getType

String getType()
Returns the type of the displayable command.


setEnabled

void setEnabled(boolean isactive)
Sets the command active or inactive. Inactive commands should never deliver command events.


isEnabled

boolean isEnabled()
Returns the current activity status of the command.