uk.ac.gate.guk.im
Class LocaleHandler
java.lang.Object
|
+--uk.ac.gate.guk.im.LocaleHandler
- public class LocaleHandler
- extends java.lang.Object
A Handler for a locale.
A locale handler is actually a finite state machine (FSM) that maps
input events (presseed keys) to other input events(typed characters).
Field Summary |
(package private) State |
initialState
The initial state of the fsm. |
(package private) java.util.Map |
keycap
maps from string (the English description of the key) to
string (the string to be displayed on the key) |
(package private) java.util.Locale |
locale
The locale this handler handles. |
Constructor Summary |
LocaleHandler(java.util.Locale locale,
java.lang.String fileName)
Creates a locale handler for a given locale using the definitions from
the file provided. |
Method Summary |
protected State |
addAction(java.lang.String keyDesc,
java.lang.String textToAdd,
java.lang.String keycapStr)
|
State |
getInitialState()
The initial state of the FSM. |
java.util.Map |
getKeyCap()
Gets the map with the keycaps (the strings to be painted on virtual keys). |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
initialState
State initialState
- The initial state of the fsm.
keycap
java.util.Map keycap
- maps from string (the English description of the key) to
string (the string to be displayed on the key)
locale
java.util.Locale locale
- The locale this handler handles.
LocaleHandler
public LocaleHandler(java.util.Locale locale,
java.lang.String fileName)
throws java.io.IOException
- Creates a locale handler for a given locale using the definitions from
the file provided.
- Parameters:
locale
- fileName
- - Throws:
java.io.IOException
-
addAction
protected State addAction(java.lang.String keyDesc,
java.lang.String textToAdd,
java.lang.String keycapStr)
- Parameters:
keyDesc
- textToAdd
- keycapStr
-
getInitialState
public State getInitialState()
- The initial state of the FSM.
getKeyCap
public java.util.Map getKeyCap()
- Gets the map with the keycaps (the strings to be painted on virtual keys).