org.havi.ui.event
Class HEventGroup

java.lang.Object
  extended by org.havi.ui.event.HEventGroup

public class HEventGroup
extends java.lang.Object

Represents a group of key codes. Groups do not keep a count of the number of times a particular key code is added or removed. Repeatedly adding an event to a group has no effect. Removing an event removes it regardless of the number of times it has been added. Groups are resolved when they are passed into the methods of HScene. Adding or removing events from the group after those method calls does not affect the subscription to those events.


Constructor Summary
HEventGroup()
          Constructor for an empty event group
 
Method Summary
 void addAllArrowKeys()
          Adds the key codes for the arrow keys (VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN).
 void addAllColourKeys()
          Adds the key codes for the colour keys (VK_COLORED_KEY_0, VK_COLORED_KEY_1, VK_COLORED_KEY_2, VK_COLORED_KEY_3).
 void addAllNumericKeys()
          Adds the key codes for the numeric keys (VK_0, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6, VK_7, VK_8, VK_9).
 void addKey(int keycode)
          A shortcut to create a new key event type entry in the group.
 int[] getKeyEvents()
          Return the key codes contained in this event group.
 void removeAllArrowKeys()
          Removes the key codes for the arrow keys (VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN).
 void removeAllColourKeys()
          Removes the key codes for the colour keys (VK_COLORED_KEY_0, VK_COLORED_KEY_1, VK_COLORED_KEY_2, VK_COLORED_KEY_3).
 void removeAllNumericKeys()
          Remove the key codes for the numeric keys (VK_0, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6, VK_7, VK_8, VK_9).
 void removeKey(int keycode)
          The method to remove a key from the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HEventGroup

public HEventGroup()
Constructor for an empty event group

Method Detail

addKey

public void addKey(int keycode)
A shortcut to create a new key event type entry in the group. If a key is already in the group, this method has no effect.

Parameters:
keycode - the key code.

removeKey

public void removeKey(int keycode)
The method to remove a key from the group. Removing a key which is not in the group has no effect.

Parameters:
keycode - the key code.

addAllNumericKeys

public void addAllNumericKeys()
Adds the key codes for the numeric keys (VK_0, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6, VK_7, VK_8, VK_9). Any key codes already in the group will not be added again.


addAllColourKeys

public void addAllColourKeys()
Adds the key codes for the colour keys (VK_COLORED_KEY_0, VK_COLORED_KEY_1, VK_COLORED_KEY_2, VK_COLORED_KEY_3). Any key codes already in the group will not be added again.


addAllArrowKeys

public void addAllArrowKeys()
Adds the key codes for the arrow keys (VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN). Any key codes already in the group will not be added again.


removeAllNumericKeys

public void removeAllNumericKeys()
Remove the key codes for the numeric keys (VK_0, VK_1, VK_2, VK_3, VK_4, VK_5, VK_6, VK_7, VK_8, VK_9). Key codes from this set which are not present in the group will be ignored.


removeAllColourKeys

public void removeAllColourKeys()
Removes the key codes for the colour keys (VK_COLORED_KEY_0, VK_COLORED_KEY_1, VK_COLORED_KEY_2, VK_COLORED_KEY_3). Key codes from this set which are not present in the group will be ignored.


removeAllArrowKeys

public void removeAllArrowKeys()
Removes the key codes for the arrow keys (VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN). Key codes from this set which are not present in the group will be ignored.


getKeyEvents

public int[] getKeyEvents()
Return the key codes contained in this event group.