FileDocCategorySizeDatePackage
DefaultInputMethodHandler_ja.javaAPI DocJ2ME MIDP 2.09713Thu Nov 07 12:02:22 GMT 2002com.sun.midp.lcdui.i18n

DefaultInputMethodHandler_ja

public class DefaultInputMethodHandler_ja extends com.sun.midp.lcdui.DefaultInputMethodHandler
The Japanese implementation of the of the InputMethodHandler interface.
author
unattributed
version
1.23 07/24/02

Fields Summary
protected static final int
IM_HIRAGANA
Hiragana Input Method.
protected static final int
IM_HWKATAKANA
Kana Input Method.
protected char[]
hwKatakanaKeyMap
The Halfwidth Katakana character set symbol table.
protected char[]
hiraganaKeyMap
The Hiragana character set symbol table.
protected String[]
jaCharSubset
Character Subset values for additional Japanese input modes.
protected int[]
jaSupportedInputModes
values for default supported input modes.
protected Object[]
jaInputModeConvTable
The Japanese input mode conversion table.
Constructors Summary
public DefaultInputMethodHandler_ja()
Constructs a new DefaultInputMethodHandler_ja object to handle japanese input modes.


                   
      
        NUM_INPUT_MODES = 7; // override the super class value
        allowedModes = new int[NUM_INPUT_MODES];
        super.supportedCharSubset = jaCharSubset;
        super.supportedInputModes = jaSupportedInputModes;
        super.inputModeConvTable = jaInputModeConvTable;
        // Japanese specific symbol table
        // super.symbolTableChars = jaSymbolTableChars;
        // super.defaultSymbolCursorPos = 20;
    
Methods Summary
public voidsetInputMethodClient(com.sun.midp.lcdui.InputMethodClient imc)
Set the input method client.

param
imc The Input method to use.

        super.setInputMethodClient(imc);

        if (capWord || capSentence) {
            // INITIAL_CAPS_WORD or INITIAL_CAPS_SENTENCE is not supported for
            // Japanese input method.
            capWord = capSentence = false;

            // Need to re-do the input mode and constraint after setting
            // capWord and capSentence to false.
            // setConstraint();
            // inputMode = defaultMode;
        }

        // initial the keyMap
        // setKeyMap(inputMode); 
    
protected booleansetKeyMap(int mode, int constraints)
Set the appropriate keypad mapping according to the input mode. Override super class to add hiragana and katakana support.

param
mode The new input mode to use
param
constraints the constraints to use
return
true if keyMap is set.

        if (super.setKeyMap(mode, constraints)) {
            return true;
        }

        switch (mode) {
        case IM_HWKATAKANA:
            keyMap = hwKatakanaKeyMap;
            break;
        case IM_HIRAGANA:
            keyMap = hiraganaKeyMap;
            break;
        default:
            return false;
        }
        
        imc.showInputMode(mode);

        return true;