|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.AbstractDisposable | +--gumbo.graphic.input.AbstractKeyboardSensor
Provides objects for maintaining keyboard key state, and event out nodes initialized with an immutable view of the the state object. Upon receiving a keyboard input this sensor should update the state object, check isKeyRepeat(), and then invoke send(), as needed, on the corresponding event out node to send an immutable state snapshot.
Constructor Summary | |
AbstractKeyboardSensor()
Creates an instance, with keyRepeat false. |
|
AbstractKeyboardSensor(boolean keyRepeat)
Creates an instance. |
Method Summary | |
protected abstract void |
addedSensorTarget(SpaceNode target)
Called by the system when a non-duplicate target is added, after updating the graphic map. |
void |
addKeyboardTarget(SpaceNode target)
Updates the graphic-to-target map, then calls addTargetSpace(). |
protected java.util.Map |
getGraphicMap()
Returns an immutable view of the graphic (Object) to target (SpaceNode) map. |
CharField.EventOut |
getKeyboardCharOut()
Sends an event each time a valid character is typed (or repeats) while this sensor is active. |
StateSetField.EventOut |
getKeyboardKeysOut()
Sends an immutable view of getKeyState(). |
protected StateSet |
getKeyState()
Returns a reference to the object maintaining key state. |
boolean |
isKeyRepeat()
Returns true if a key out event is sent even if the value does not change (a key repeat). |
protected abstract void |
removedSensorTarget(SpaceNode target)
Called by the system when a non-missing target is removed, after updating the graphic map. |
void |
removeKeyboardTarget(SpaceNode target)
Updates the graphic-to-target map, then calls removeTargetSpace(). |
Methods inherited from class gumbo.util.AbstractDisposable |
dispose, implDispose, isDisposed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gumbo.graphic.input.KeyboardSensor |
getKeyboardActiveOut, getKeyboardEnableIn, getKeyboardFocusIn, getKeyboardSpaceOut |
Methods inherited from interface gumbo.util.Disposable |
dispose, isDisposed |
Constructor Detail |
public AbstractKeyboardSensor()
public AbstractKeyboardSensor(boolean keyRepeat)
keyRepeat
- If false, a key out event is sent only if its data
value changes.Method Detail |
public boolean isKeyRepeat()
protected StateSet getKeyState()
protected java.util.Map getGraphicMap()
protected abstract void addedSensorTarget(SpaceNode target)
target
- Reference to the target. Never null.protected abstract void removedSensorTarget(SpaceNode target)
target
- Reference to the target. Never null.public final void addKeyboardTarget(SpaceNode target)
addKeyboardTarget
in interface KeyboardSensor
target
- Reference to the target. Never null.
Duplicates are ignored.public final void removeKeyboardTarget(SpaceNode target)
removeKeyboardTarget
in interface KeyboardSensor
target
- Reference to the target. Never null.
Missing are ignored.public StateSetField.EventOut getKeyboardKeysOut()
getKeyboardKeysOut
in interface KeyboardSensor
public CharField.EventOut getKeyboardCharOut()
KeyboardSensor
getKeyboardCharOut
in interface KeyboardSensor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |