guk.im
Class KeyboardMap
java.lang.Object
|
+--guk.im.KeyboardMap
- All Implemented Interfaces:
- Runnable
- public class KeyboardMap
- extends Object
- implements Runnable
A virtual keyboard map. It uses its own thread do udate the display.
Method Summary |
void |
addJob(Object job)
Adds a job to the job list of the thread. |
void |
run()
The run method for the thread responsible for updating the display. |
void |
setAlt(boolean alt)
Is the Alt key pressed? |
void |
setCtrl(boolean ctrl)
Is the Ctrl key pressed? |
void |
setShift(boolean shift)
Is the Shift key pressed? |
void |
update(LocaleHandler newHandler,
State newState)
Updates the keyboard map for a new Locale or a new state of the current locale handler. |
KeyboardMap
public KeyboardMap(GateIM im,
LocaleHandler handler,
State state)
- Builds the keyboard map. Uses a window provided by the context of the input
method.
- Parameters:
im
- the input methodhandler
- the active Locale handlerstate
- the state of the handler.
run
public void run()
- The run method for the thread responsible for updating the display.
- Specified by:
run
in interface Runnable
addJob
public void addJob(Object job)
- Adds a job to the job list of the thread.
A job is either a
String
or an InputEvent
The string can be one of
- SHOW: shows the keyboard map window
- UPDATE updates the keyboard map window
- HIDE: hides the keyboard map window
- DIE: releases all the memory and terminates the thread
The input events refer to pressed keys and are treated accordingly.
- Parameters:
job
-
update
public void update(LocaleHandler newHandler,
State newState)
- Updates the keyboard map for a new Locale or a new state of the current locale handler.
Currently the state changes are ignored.
This method delegates its job to the thread which will do the actual
update.
- Parameters:
newHandler
- newState
-
setShift
public void setShift(boolean shift)
- Is the Shift key pressed?
- Parameters:
shift
-
setAlt
public void setAlt(boolean alt)
- Is the Alt key pressed?
- Parameters:
alt
-
setCtrl
public void setCtrl(boolean ctrl)
- Is the Ctrl key pressed?
- Parameters:
ctrl
-