|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grin.input.RCHandler com.hdcookbook.grin.input.CommandRCHandler
public class CommandRCHandler
This remote control handler will trigger a set of commands whenever one of a set of keys is pressed.
Field Summary | |
---|---|
protected Command[] |
commands
|
protected int |
mask
|
protected boolean |
wantKeypress
|
Fields inherited from class com.hdcookbook.grin.input.RCHandler |
---|
name, show |
Constructor Summary | |
---|---|
CommandRCHandler()
|
Method Summary | |
---|---|
void |
activate(Segment s)
Called for handlers in s when s is activated |
boolean |
handleKeyPressed(RCKeyEvent ke,
Show caller)
Handle a remote control key press. |
boolean |
handleKeyReleased(RCKeyEvent ke,
Show caller)
Handle a remote control key release. |
boolean |
handleKeyTyped(RCKeyEvent ke,
Show caller)
Handle a key typed event. |
boolean |
handleMouse(int x,
int y,
boolean activate)
|
void |
nextFrame()
Called by the show to let us know as the model progresses through time. |
void |
readInstanceData(GrinDataInputStream in,
int length)
Reads in this node information from the binary file format. |
Methods inherited from class com.hdcookbook.grin.input.RCHandler |
---|
getName, setName, setShow, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int mask
protected Command[] commands
protected boolean wantKeypress
Constructor Detail |
---|
public CommandRCHandler()
Method Detail |
---|
public boolean handleKeyPressed(RCKeyEvent ke, Show caller)
handleKeyPressed
in class RCHandler
public boolean handleKeyReleased(RCKeyEvent ke, Show caller)
handleKeyReleased
in class RCHandler
public boolean handleKeyTyped(RCKeyEvent ke, Show caller)
handleKeyTyped
in class RCHandler
public boolean handleMouse(int x, int y, boolean activate)
handleMouse
in class RCHandler
public void activate(Segment s)
activate
in class RCHandler
public void nextFrame()
nextFrame
in class RCHandler
public void readInstanceData(GrinDataInputStream in, int length) throws java.io.IOException
Node
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.
readInstanceData
in interface Node
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.
java.io.IOException
- if error occurs.GrinDataInputStream.readSuperClassData(Feature)
,
GrinDataInputStream.readSuperClassData(RCHandler)
,
GrinDataInputStream.readSuperClassData(Segment)
,
GrinDataInputStream.readSuperClassData(Command)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |