GATE
Version 3.1-2270

guk.im
Class KeyboardMap

java.lang.Object
  extended by 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.


Nested Class Summary
 class KeyboardMap.KeyGUI
           
 
Constructor Summary
KeyboardMap(GateIM im, LocaleHandler handler, State state)
          Builds the keyboard map.
 
Method Summary
 void addJob(Object job)
          Adds a job to the job list of the thread.
protected  void fixShape()
           
protected  KeyboardMap.KeyGUI guiForKey(Key key)
          Gets the gui that corresponds to a Key object.
 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?
protected  void update()
          Does th actual update.
 void update(LocaleHandler newHandler, State newState)
          Updates the keyboard map for a new Locale or a new state of the current locale handler.
protected  void updateLabels()
          Updates the virtual keyboard to reflect the current state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 method
handler - the active Locale handler
state - the state of the handler.
Method Detail

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 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 -

update

protected void update()
Does th actual update.


updateLabels

protected void updateLabels()
Updates the virtual keyboard to reflect the current state.


fixShape

protected void fixShape()

guiForKey

protected KeyboardMap.KeyGUI guiForKey(Key key)
Gets the gui that corresponds to a Key object.

Parameters:
key -

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 -

GATE
Version 3.1-2270