|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dvb.event.RepositoryDescriptor
org.dvb.event.UserEventRepository
The application will use this class to define the events that it wants to receive. Events that are able to be put in the repository are defined in the UserEvent class.
Where a repository includes a KEY_PRESSED
type event
without the KEY_RELEASED
type event for the same key code or vice versa then
exclusive reservations shall be made for both event types but only the one
requested shall be received by the listener. Where a repository includes
a KEY_TYPED
event without the corresponding KEY_PRESSED
and
KEY_RELEASED
events (excluding KEY_PRESSED
or KEY_RELEASED
events for modifiers),
when an exclusive reservation is requested, it shall also be made for
those corresponding KEY_PRESSED
and KEY_RELEASED
events but only the
requested event shall be received by the listener.
Repositories do not keep a count of the number of times a particular user event is added or removed. Repeatedly adding an event to a repository has no effect. Removing an event removes it regardless of the number of times it has been added. For example, org.dvb.event.UserEventRepository.addUserEvent(UserEvent event) does nothing in case that the event is already in the repository. For events based on a keycode, events are considered to be already in the repository if an event with the same triplet of family, type and code is already in the repository. For events based on a keychar, events are considered to be already in the repository if an event with the same family and keychar is already in the repository.
If an application loses exclusive access to a repository, it shall lose access to all events defined in that repository. Repositories are resolved when they are passed into the methods of EventManager. Adding or removing events from the repository after those method calls does not affect the subscription to those events.
Unless stated otherwise, all constants used in the specification of this class are defined
in java.awt.event.KeyEvent
and its parent classes and not in this class.
UserEvent
Constructor Summary | |
UserEventRepository(java.lang.String name)
The method to construct a new UserEventRepository. |
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)
Adds the specified keycode to the repository. |
void |
addUserEvent(UserEvent event)
Adds the given user event to the repository. |
java.lang.String |
getName()
Returns the name of the current repository as passed to the constructor. |
UserEvent[] |
getUserEvent()
Returns the list of the user events that are in the repository. |
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 repository. |
void |
removeUserEvent(UserEvent event)
Remove a user event from the repository. |
Methods inherited from class org.dvb.event.RepositoryDescriptor |
getClient |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UserEventRepository(java.lang.String name)
name
- the name of the repository.Method Detail |
public void addUserEvent(UserEvent event)
UserEvent
shall be ignored by
the MHP terminal.
The value of the source used to construct the specified UserEvent
shall
be ignored by the MHP terminal when the UserEventRepository
is used to
specify events which an application wants to receive.
event
- the user event to be added in the repository.public UserEvent[] getUserEvent()
public void removeUserEvent(UserEvent event)
event
- the event to be removed from the repository.public void addKey(int keycode)
getUserEvent
method.
If a key is already in the repository, this method has no effect.
After calling this method, the keycode shall be present for both
the KEY_PRESSED
and KEY_RELEASED
modes.
keycode
- the key code.public void removeKey(int keycode)
KEY_PRESSED
and KEY_RELEASED
modes.
keycode
- the key code.public void addAllNumericKeys()
KEY_PRESSED
and KEY_RELEASED
modes.
public void addAllColourKeys()
KEY_PRESSED
and KEY_RELEASED
modes.
public void addAllArrowKeys()
KEY_PRESSED
and KEY_RELEASED
modes.
public void removeAllNumericKeys()
KEY_PRESSED
and KEY_RELEASED
modes.
public void removeAllColourKeys()
KEY_PRESSED
and KEY_RELEASED
modes.
public void removeAllArrowKeys()
KEY_PRESSED
and KEY_RELEASED
modes.
public java.lang.String getName()
getName
in class RepositoryDescriptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |