com.keenedgesoftware.scrutinize.core
Class CommandManager

java.lang.Object
  |
  +--com.keenedgesoftware.scrutinize.core.CoreEntity
        |
        +--com.keenedgesoftware.scrutinize.core.CommandManager
All Implemented Interfaces:
java.lang.Runnable

public final class CommandManager
extends CoreEntity
implements java.lang.Runnable

Manages commands.


Field Summary
static int SOURCE_INTERACTIVE
          The message was generated by a user interaction
static int SOURCE_NETCASTER
          The message was read from the net by the netcaster
static int SOURCE_RECORDER
          The message was read from a pbk file by the recorder
 
Fields inherited from class com.keenedgesoftware.scrutinize.core.CoreEntity
ACTIVATE, BACKSLASH, EOL, GO, HASH, INIT, NEWLINE, QUIT, QUOTE, SLASH, SPACE
 
Constructor Summary
CommandManager()
          Constructs an empty command manager
CommandManager(Universe u)
          Constructs a command manager owned by the specified universe.
 
Method Summary
 void addCommand(java.lang.String commandId, Command commandObject)
          Declares a new command to the command manager.
 Picker getActivePicker()
          Returns the active picker
 Selector getActiveSelector()
          Returns the active selector
 void initializeDebug()
           
 boolean isPickerActive()
          Returns true if a picker is active
 boolean isSelectorActive()
          Returns true if a selector is active
 void messageHandler(java.lang.String message)
          Usual message handler
 void messageHandlerInternal(java.lang.String message, int source, int senderId)
          Internal message handlers.
 void messageHandlerInternal2(java.lang.String message, int source, int senderId)
           
 void messageHandlerInternal3(java.lang.String message, int source, int senderId)
          Internal message handler
 void messageHandlerInternal4(java.lang.String message)
          Internal message handler
 void messageHandlerLongCommand(java.lang.String message)
          Message handler for time-hungry commands.
 Command peekActiveCommand()
          Peeks at the top command
 void run()
          Run method for messageHandlerLongCommand
 
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

SOURCE_INTERACTIVE

public static final int SOURCE_INTERACTIVE
The message was generated by a user interaction

SOURCE_RECORDER

public static final int SOURCE_RECORDER
The message was read from a pbk file by the recorder

SOURCE_NETCASTER

public static final int SOURCE_NETCASTER
The message was read from the net by the netcaster
Constructor Detail

CommandManager

public CommandManager()
Constructs an empty command manager

CommandManager

public CommandManager(Universe u)
Constructs a command manager owned by the specified universe.
Method Detail

initializeDebug

public void initializeDebug()

addCommand

public void addCommand(java.lang.String commandId,
                       Command commandObject)
Declares a new command to the command manager.

run

public void run()
Run method for messageHandlerLongCommand
Specified by:
run in interface java.lang.Runnable

messageHandlerLongCommand

public void messageHandlerLongCommand(java.lang.String message)
Message handler for time-hungry commands. Executes in a new thread.

messageHandler

public void messageHandler(java.lang.String message)
Usual message handler

messageHandlerInternal

public void messageHandlerInternal(java.lang.String message,
                                   int source,
                                   int senderId)
Internal message handlers.

messageHandlerInternal2

public void messageHandlerInternal2(java.lang.String message,
                                    int source,
                                    int senderId)

messageHandlerInternal3

public void messageHandlerInternal3(java.lang.String message,
                                    int source,
                                    int senderId)
Internal message handler

messageHandlerInternal4

public void messageHandlerInternal4(java.lang.String message)
Internal message handler

peekActiveCommand

public Command peekActiveCommand()
Peeks at the top command

isPickerActive

public boolean isPickerActive()
Returns true if a picker is active

getActivePicker

public Picker getActivePicker()
Returns the active picker

isSelectorActive

public boolean isSelectorActive()
Returns true if a selector is active

getActiveSelector

public Selector getActiveSelector()
Returns the active selector