com.hdcookbook.grin.commands
Class SetVisualRCStateCommand

java.lang.Object
  extended by com.hdcookbook.grin.commands.Command
      extended by com.hdcookbook.grin.commands.SetVisualRCStateCommand
All Implemented Interfaces:
Node

public class SetVisualRCStateCommand
extends Command
implements Node

This command is used to set the state of a visual RC handler. It's useful when going into a segment that contains such a handler, to put things into a known state.

Author:
Bill Foote (http://jovial.com)

Field Summary
protected  boolean activated
           
protected  int gridNumber
           
protected  VisualRCHandler handler
           
protected  boolean runCommands
           
protected  int state
           
 
Fields inherited from class com.hdcookbook.grin.commands.Command
show
 
Constructor Summary
SetVisualRCStateCommand(Show show)
           
SetVisualRCStateCommand(Show show, boolean activated, int state, VisualRCHandler handler, boolean runCommands)
          Constructor for use by xlets that want to set a handler state
SetVisualRCStateCommand(Show show, boolean activated, int state, VisualRCHandler handler, boolean runCommands, int gridNumber)
          Constructor for use by xlets that want to set a handler state
 
Method Summary
 void execute()
          Execute the command.
 void execute(Show caller)
          Execute the command.
 boolean getActivated()
           
 boolean getRunCommands()
           
 int getState()
           
 VisualRCHandler getVisualRCHandler()
           
 void readInstanceData(GrinDataInputStream in, int length)
          Reads in this node information from the binary file format.
 
Methods inherited from class com.hdcookbook.grin.commands.Command
cloneIfNeeded, deferNextCommands, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

activated

protected boolean activated

state

protected int state

handler

protected VisualRCHandler handler

runCommands

protected boolean runCommands

gridNumber

protected int gridNumber
Constructor Detail

SetVisualRCStateCommand

public SetVisualRCStateCommand(Show show)

SetVisualRCStateCommand

public SetVisualRCStateCommand(Show show,
                               boolean activated,
                               int state,
                               VisualRCHandler handler,
                               boolean runCommands)
Constructor for use by xlets that want to set a handler state


SetVisualRCStateCommand

public SetVisualRCStateCommand(Show show,
                               boolean activated,
                               int state,
                               VisualRCHandler handler,
                               boolean runCommands,
                               int gridNumber)
Constructor for use by xlets that want to set a handler state

Method Detail

getActivated

public boolean getActivated()

getState

public int getState()

getVisualRCHandler

public VisualRCHandler getVisualRCHandler()

getRunCommands

public boolean getRunCommands()

execute

public void execute(Show caller)
Description copied from class: Command
Execute the command. This causes the command to take whatever action it was created to do. By default, this calls execute().

Overrides:
execute in class Command
Parameters:
caller - The show that is executing this command. This might not be the same as the show this command was created under.

execute

public void execute()
Description copied from class: Command
Execute the command. This causes the command to take whatever action it was created to do.

Specified by:
execute in class Command

readInstanceData

public void readInstanceData(GrinDataInputStream in,
                             int length)
                      throws java.io.IOException
Description copied from interface: Node
Reads in this node information from the binary file format.

An implementation of this method is recommended to call in.readSuperClassData(this) as the first line of the method to read in information that is defined in the base class of this Node type.

This should only be called while initializing this object.

Specified by:
readInstanceData in interface Node
Parameters:
in - InputStream to read data from.
length - the number of bytes that this node's information occupies in the InputStream. The implementation of this method is expected to read exactly this number of bytes from the stream. This can be used for a debugging purpose.
Throws:
java.io.IOException - if error occurs.
See Also:
GrinDataInputStream.readSuperClassData(Feature), GrinDataInputStream.readSuperClassData(RCHandler), GrinDataInputStream.readSuperClassData(Segment), GrinDataInputStream.readSuperClassData(Command)