org.jagatoo.input.localization
Class KeyboardLocalizer

java.lang.Object
  extended by org.jagatoo.input.localization.KeyboardLocalizer

public class KeyboardLocalizer
extends java.lang.Object

This class can be used to map key-assotiated characters to their counterparts for the key with a modifier held.
This class must be initialized before any access to the Key or Keys class. This class is consulted at creation time of a Key with a key char assotiated. Specifically this means, that the Key's Key.hasKeyChar() method returns true.


Constructor Summary
KeyboardLocalizer()
           
 
Method Summary
static Mapping autoselectMapping()
          Looks up the current mappings-map for the current system's locale.
static java.lang.String getCurrentMappingName()
           
static Mapping getMapping()
          Selects a Mapping, if none is currently selected.
static void registerMapping(java.util.Locale locale, Mapping mapping)
          Registers a new Locale->Mapping mapping, that is considered by the autoselectMapping() method.
static void setMapping(Mapping mapping)
          Sets the new mapping for your localization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyboardLocalizer

public KeyboardLocalizer()
Method Detail

registerMapping

public static void registerMapping(java.util.Locale locale,
                                   Mapping mapping)
Registers a new Locale->Mapping mapping, that is considered by the autoselectMapping() method.

Parameters:
locale -
mapping -

autoselectMapping

public static final Mapping autoselectMapping()
Looks up the current mappings-map for the current system's locale. If the locale isn't found, a default mapping is used. Use setMapping(Mapping) to force a Mapping to be used.

Returns:
the selected Mapping

setMapping

public static void setMapping(Mapping mapping)
Sets the new mapping for your localization.

Parameters:
mapping -

getMapping

public static final Mapping getMapping()
Selects a Mapping, if none is currently selected.
This will select the mapping from the System's default Locale.

Returns:
the currently selected Mapping (never null).

getCurrentMappingName

public static final java.lang.String getCurrentMappingName()
Returns:
the class-name of the current Mapping.