guk.im
Class GateIM

java.lang.Object
  |
  +--guk.im.GateIM
All Implemented Interfaces:
InputMethod

public class GateIM
extends Object
implements InputMethod

The Gate input method


Field Summary
(package private)  Map additionalKeymaps
          Not used
(package private)  String composedText
          The composed text;
(package private)  LocaleHandler currentHandler
          The current locale handler.
(package private)  Locale currentLocale
          The active locale
(package private)  State currentState
          The current state of the current LocaleHandler.
(package private)  Locale defaultLocale
          The default locale to be used when this method is loaded and no locale is specified.
(package private)  boolean enabled
          Is this inpuit method enabled?
private static String imBase
          The resource path to the input methods director
private static Font keyboardFont
           
(package private) static KeyboardMap keyboardMap
          The current virtual keyboard map.
(package private)  Map loadedLocales
          The locales that have been loaded already.
(package private)  boolean mapVisible
          Should the keyboard map be visible?
(package private)  InputMethodContext myContext
          The input context
(package private)  Map supportedLocales
          The available locales (the locales for which a definition file exists).
 
Constructor Summary
GateIM(Map supportedLocales)
          Constructs a new Gate input method
 
Method Summary
 void activate()
          Activates this input method
 void deactivate(boolean isTemporary)
          Deactivates this input method
 void dispatchEvent(AWTEvent event)
          Called by the system when an input event occures in a component that uses this input method.
 void dispose()
          Disposes this input method releasing all the memory.
 void endComposition()
          Ends the curent composition.
 InputMethodContext getContext()
          Returns theinput context for this input method.
 Object getControlObject()
          Gives the clients a chance to control the bevaviour of this input method by returning a handle to itself.
 GateIMDescriptor getDescriptor()
          gets the descriptor class for this input method
static String getIMBase()
          Gets the path inside the classpath where the input methods should be found
static Font getKeyboardFont()
           
 Locale getLocale()
          Gets the active locale
 void hideWindows()
          Hides all the windows displayed by the input method.
 boolean isCompositionEnabled()
          Is this input method enabled?
protected  void loadLocale(Locale locale)
          Loads a new locale if it's not already loaded.
 void notifyClientWindowChange(Rectangle bounds)
          Called by the system when the client window has changed size or position.
 void reconvert()
          Throws a UnsupportedOperationException as this input method does not support recnversion.
 void removeNotify()
          Called by the system when a client unregisters to this input method.
 void setCharacterSubsets(Character.Subset[] subsets)
          Restricts the character ranges valid for this input method output.
 void setCompositionEnabled(boolean enable)
          Enables this input method for composition
static void setIMBase(String path)
          Sets the default path to be used when looking for input methods.
 void setInputMethodContext(InputMethodContext context)
          Provides the input method with a context.
 boolean setLocale(Locale locale)
          Selects the active locale
 void setMapVisible(boolean mapvis)
          Should the virtual keyboard map be visible?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentLocale

Locale currentLocale
The active locale


defaultLocale

Locale defaultLocale
The default locale to be used when this method is loaded and no locale is specified.


currentHandler

LocaleHandler currentHandler
The current locale handler.


myContext

InputMethodContext myContext
The input context


supportedLocales

Map supportedLocales
The available locales (the locales for which a definition file exists).


loadedLocales

Map loadedLocales
The locales that have been loaded already. Maps from Loacle to LocaleHandler.


enabled

boolean enabled
Is this inpuit method enabled?


composedText

String composedText
The composed text;


currentState

State currentState
The current state of the current LocaleHandler.


additionalKeymaps

Map additionalKeymaps
Not used


keyboardMap

static KeyboardMap keyboardMap
The current virtual keyboard map.


mapVisible

boolean mapVisible
Should the keyboard map be visible?


imBase

private static String imBase
The resource path to the input methods director


keyboardFont

private static Font keyboardFont
Constructor Detail

GateIM

public GateIM(Map supportedLocales)
Constructs a new Gate input method

Parameters:
supportedLocales -
Method Detail

setInputMethodContext

public void setInputMethodContext(InputMethodContext context)
Provides the input method with a context. This method is called by the system after the input method is loaded and linked to a text component.

Specified by:
setInputMethodContext in interface InputMethod
Parameters:
context -

setLocale

public boolean setLocale(Locale locale)
Selects the active locale

Specified by:
setLocale in interface InputMethod
Parameters:
locale -

getLocale

public Locale getLocale()
Gets the active locale

Specified by:
getLocale in interface InputMethod

getDescriptor

public GateIMDescriptor getDescriptor()
gets the descriptor class for this input method


setCharacterSubsets

public void setCharacterSubsets(Character.Subset[] subsets)
Restricts the character ranges valid for this input method output. This is currently ignored by the input method.

Specified by:
setCharacterSubsets in interface InputMethod
Parameters:
subsets -

setCompositionEnabled

public void setCompositionEnabled(boolean enable)
Enables this input method for composition

Specified by:
setCompositionEnabled in interface InputMethod
Parameters:
enable -

isCompositionEnabled

public boolean isCompositionEnabled()
Is this input method enabled?

Specified by:
isCompositionEnabled in interface InputMethod

reconvert

public void reconvert()
Throws a UnsupportedOperationException as this input method does not support recnversion.

Specified by:
reconvert in interface InputMethod

dispatchEvent

public void dispatchEvent(AWTEvent event)
Called by the system when an input event occures in a component that uses this input method. The input method then analyses the input event and sends an input method event to the interested components using the input context provided by the system.

Specified by:
dispatchEvent in interface InputMethod
Parameters:
event -

notifyClientWindowChange

public void notifyClientWindowChange(Rectangle bounds)
Called by the system when the client window has changed size or position. This event is ignored by the input method.

Specified by:
notifyClientWindowChange in interface InputMethod
Parameters:
bounds -

activate

public void activate()
Activates this input method

Specified by:
activate in interface InputMethod

deactivate

public void deactivate(boolean isTemporary)
Deactivates this input method

Specified by:
deactivate in interface InputMethod
Parameters:
isTemporary -

hideWindows

public void hideWindows()
Hides all the windows displayed by the input method. Currently this only includes the virtual keyboard map.

Specified by:
hideWindows in interface InputMethod

removeNotify

public void removeNotify()
Called by the system when a client unregisters to this input method. This event is currently ignored by the input method.

Specified by:
removeNotify in interface InputMethod

endComposition

public void endComposition()
Ends the curent composition.

Specified by:
endComposition in interface InputMethod

dispose

public void dispose()
Disposes this input method releasing all the memory.

Specified by:
dispose in interface InputMethod

getControlObject

public Object getControlObject()
Gives the clients a chance to control the bevaviour of this input method by returning a handle to itself.

Specified by:
getControlObject in interface InputMethod
Returns:
a reference to this input method

setMapVisible

public void setMapVisible(boolean mapvis)
Should the virtual keyboard map be visible?

Parameters:
mapvis -

loadLocale

protected void loadLocale(Locale locale)
Loads a new locale if it's not already loaded.

Parameters:
locale -

getContext

public InputMethodContext getContext()
Returns theinput context for this input method.


setIMBase

public static void setIMBase(String path)
Sets the default path to be used when looking for input methods. This should be a resource path (a path inside the class path). By default the path is "guk/im/data/"

Parameters:
path -

getIMBase

public static String getIMBase()
Gets the path inside the classpath where the input methods should be found


getKeyboardFont

public static Font getKeyboardFont()