com.keenedgesoftware.scrutinize.core
Class Command

java.lang.Object
  |
  +--com.keenedgesoftware.scrutinize.core.CoreEntity
        |
        +--com.keenedgesoftware.scrutinize.core.Command
Direct Known Subclasses:
GraphicsCommand, MiscCommand, RecorderCommand, SystemCommand

public abstract class Command
extends CoreEntity

Abstract class for any command.


Field Summary
static int LEVEL_0
          Level 0, used for top-level commands (eg start, quit)
static int LEVEL_1
          Level 1, used for interactive modelling commands.
static int LEVEL_2
          Level 2, used for primary camera controls.
static int LEVEL_3
          Level 3, used for secondary camera controls.
static int LEVEL_4
          Level 4, used for batch modelling commands
static MessageParser parser
          Message parser
static int STATE_FINAL
          Final state, which the command-manager interprets as meaning the command is finished.
static int STATE_INITIAL
          Initial state, in which all commands are created.
static int TYPE_SUSPENDING
          Suspending type of command.
static int TYPE_TERMINATING
          Terminating type of command.
 
Fields inherited from class com.keenedgesoftware.scrutinize.core.CoreEntity
ACTIVATE, BACKSLASH, EOL, GO, HASH, INIT, NEWLINE, QUIT, QUOTE, SLASH, SPACE
 
Constructor Summary
Command()
          Default constructor
Command(CommandManager cm, int type)
          Usual constructor for suspending type of command
Command(CommandManager cm, int type, int level)
          Usual constructor for terminating type of command
 
Method Summary
 com.keenedgesoftware.scrutinize.core.misc.events.CursorEvent getCursor()
          Cursor
 int getLevel()
          Returns the level (ie "weight") of the command
 Picker getPicker()
          Picking.
 com.keenedgesoftware.scrutinize.core.misc.events.PromptEvent getPrompt()
          Prompt
 Selector getSelector()
          Selection.
 int getState()
          Returns the current state of the command
 int getType()
          Returns the type of the command
abstract  boolean messageHandler(java.lang.String message)
          Message handler.
 void setCursor(com.keenedgesoftware.scrutinize.core.misc.events.CursorEvent cursor)
           
 void setPicker(Picker picker)
           
 void setPrompt(com.keenedgesoftware.scrutinize.core.misc.events.PromptEvent prompt)
           
 void setSelector(Selector selector)
           
 void setState(int state)
          Sets the current state of the command to the specified value
 
Methods inherited from class com.keenedgesoftware.scrutinize.core.CoreEntity
getActiveView, getBroadcastManager, getCommandManager, getGraphicsGate, getGraphicsWorld, getMiscWorld, getModelWorld, getNetcaster, getRecorder, getScene, getSystemWorld, getTaskManager, getUniverse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_INITIAL

public static final int STATE_INITIAL
Initial state, in which all commands are created.

STATE_FINAL

public static final int STATE_FINAL
Final state, which the command-manager interprets as meaning the command is finished.

TYPE_TERMINATING

public static final int TYPE_TERMINATING
Terminating type of command. Initiating a new command of this type will terminate the active command if the level of the new command is greater than or equal to the level of the active command; otherwise the active command will be suspended, and resumed when the new command has completed.

TYPE_SUSPENDING

public static final int TYPE_SUSPENDING
Suspending type of command. Initiating a new command of this type will cause the active command to be suspended, and resumed when the new command has completed. Suspending type commands can be nested.

LEVEL_0

public static final int LEVEL_0
Level 0, used for top-level commands (eg start, quit)

LEVEL_1

public static final int LEVEL_1
Level 1, used for interactive modelling commands.

LEVEL_2

public static final int LEVEL_2
Level 2, used for primary camera controls.

LEVEL_3

public static final int LEVEL_3
Level 3, used for secondary camera controls.

LEVEL_4

public static final int LEVEL_4
Level 4, used for batch modelling commands

parser

public static final MessageParser parser
Message parser
Constructor Detail

Command

public Command()
Default constructor

Command

public Command(CommandManager cm,
               int type,
               int level)
Usual constructor for terminating type of command

Command

public Command(CommandManager cm,
               int type)
Usual constructor for suspending type of command
Method Detail

getState

public final int getState()
Returns the current state of the command

setState

public final void setState(int state)
Sets the current state of the command to the specified value

getType

public final int getType()
Returns the type of the command

getLevel

public final int getLevel()
Returns the level (ie "weight") of the command

getPicker

public Picker getPicker()
Picking.

setPicker

public void setPicker(Picker picker)

getSelector

public Selector getSelector()
Selection.

setSelector

public void setSelector(Selector selector)

getPrompt

public com.keenedgesoftware.scrutinize.core.misc.events.PromptEvent getPrompt()
Prompt

setPrompt

public void setPrompt(com.keenedgesoftware.scrutinize.core.misc.events.PromptEvent prompt)

getCursor

public com.keenedgesoftware.scrutinize.core.misc.events.CursorEvent getCursor()
Cursor

setCursor

public void setCursor(com.keenedgesoftware.scrutinize.core.misc.events.CursorEvent cursor)

messageHandler

public abstract boolean messageHandler(java.lang.String message)
Message handler. All commands must implement this method