⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defaultinputmethodhandler_ja.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/* * @(#)DefaultInputMethodHandler_ja.java	1.13  01/08/21 * * Copyright (c) 2000-2001 Sun Microsystems, Inc., 901 San Antonio Road, * Palo Alto, CA 94303, U.S.A.  All Rights Reserved. * * Sun Microsystems, Inc. has intellectual property rights relating * to the technology embodied in this software.  In particular, and * without limitation, these intellectual property rights may include * one or more U.S. patents, foreign patents, or pending * applications.  Sun, Sun Microsystems, the Sun logo, Java, KJava, * and all Sun-based and Java-based marks are trademarks or * registered trademarks of Sun Microsystems, Inc.  in the United * States and other countries. * * This software is distributed under licenses restricting its use, * copying, distribution, and decompilation.  No part of this * software may be reproduced in any form by any means without prior * written authorization of Sun and its licensors, if any. * * FEDERAL ACQUISITIONS:  Commercial Software -- Government Users * Subject to Standard License Terms and Conditions */package com.sun.midp.lcdui.i18n;import com.sun.midp.lcdui.DefaultInputMethodHandler;import com.sun.midp.lcdui.InputMethodClient;/** * The Japanese implementation of the of the InputMethodHandler interface. * @author unattributed * @version 1.13 08/21/01 */public class DefaultInputMethodHandler_ja extends DefaultInputMethodHandler {    /** Kanji Input Method. */    protected static final int IM_KANJI         = IM_SYMBOL + 1;    /** Kana Input Method. */    protected static final int IM_KANA          = IM_SYMBOL + 2;    /** The Kana character set symbol table. */    protected char kanaKeyMap[][] = {        /*   wa        wo        wn */         {'\uff9c', '\uff66', '\uff9d',         /* DAKU       PU      KUTEN */         '\uff9e', '\uff9f', '\uff61',         /* SEP       LBRA      RBRA     TOUTEN */         '\uff65', '\uff62', '\uff63', '\uff64'},        /*    A       I       U       E       O  */        {'\uff71', '\uff72', '\uff73', '\uff74', '\uff75',         /*    a       i       u       e       o  */         '\uff67', '\uff68', '\uff69', '\uff6a', '\uff6b'},        /*   KA      KI      KU      KE      KO */        {'\uff76', '\uff77', '\uff78', '\uff79', '\uff7a'},        /*   SA      SI      SU      SE      SO */        {'\uff7b', '\uff7c', '\uff7d', '\uff7e', '\uff7f'},        /*   TA      TI      TU      TE      TO      tu */        {'\uff80', '\uff81', '\uff82', '\uff83', '\uff84', '\uff6f'},        /*   NA      NI      NU      NE      NO */        {'\uff85', '\uff86', '\uff87', '\uff88', '\uff89'},        /*   HA      HI      HU      HE      HO */        {'\uff8a', '\uff8b', '\uff8c', '\uff8d', '\uff8e'},        /*   MA      MI      MU      ME      MO */        {'\uff8f', '\uff90', '\uff91', '\uff92', '\uff93'},        /*   YA      YU      YO      ya      yu      yo */        {'\uff94', '\uff95', '\uff96', '\uff6c', '\uff6d', '\uff6e'},        /*   RA      RI      RU      RE      RO */        {'\uff97', '\uff98', '\uff99', '\uff9a', '\uff9b'},        /* null */        {'\0'},        /* SPACE */	{' '}    };    /** The Kanji character set symbol table. */    protected char kanjiKeyMap[][] = {	/*   WA      WO      WN  */        {'\u308f', '\u3092', '\u3093',        /*   SP  TOUTEN   KUTEN   QUEST  EXCLAM */         '\u3000', '\u3001', '\u3002', '\uff1f', '\uff01',        /*  SEP   COLON  SEMICOL QUOTEDBL   YEN */         '\u30fb', '\uff1a', '\uff1b', '\u201d', '\uffe5',        /* AMPERSAND ASTERISK */         '\uff06', '\uff0a'},        /*    A       I       U       E       O  */        {'\u3042', '\u3044', '\u3046', '\u3048', '\u304a',         /*   a       i       u       e       o */         '\u3041', '\u3043', '\u3045', '\u3047', '\u3049'},        /*   KA      KI      KU      KE      KO */        {'\u304b', '\u304d', '\u304f', '\u3051', '\u3053',         /*   GA      GI      GU      GE      GO */         '\u304c', '\u304e', '\u3050', '\u3052', '\u3054'},        /*   SA      SI      SU      SE      SO */        {'\u3055', '\u3057', '\u3059', '\u305b', '\u305d',         /*   ZA      ZI      ZU      ZE      ZO */         '\u3056', '\u3058', '\u305a', '\u305c', '\u305e'},        /*   TA      TI      TU      TE      TO      tu */        {'\u305f', '\u3061', '\u3064', '\u3066', '\u3068', '\u3063',         /*   DA      DI      DU      DE      DO */         '\u3060', '\u3062', '\u3065', '\u3067', '\u3069'},        /*   NA      NI      NU      NE      NO */        {'\u306a', '\u306b', '\u306c', '\u306d', '\u306e'},        /*   HA      HI      HU      HE      HO */        {'\u306f', '\u3072', '\u3075', '\u3078', '\u307b',         /*   BA      BI      BU      BE      BO */         '\u3070', '\u3073', '\u3076', '\u3079', '\u307c',         /*   PA      PI      PU      PE      PO */         '\u3071', '\u3074', '\u3077', '\u307a', '\u307d'},        /*   MA      MI      ME      ME      MO */        {'\u307e', '\u307f', '\u3080', '\u3081', '\u3082'},        /*   YA      YU      YO      ya      yu      yo */        {'\u3084', '\u3086', '\u3088', '\u3083', '\u3085', '\u3087'},        /*   RA      RI      RU      RE      RO */        {'\u3089', '\u308a', '\u308b', '\u308c', '\u308d'},        /* null */        {'\0'},        /* SPACE */	{'\u3000'}    };    // Japanese specific symbol table characters    // protected char jaSymbolTableChars[] = {    //     '|',  '\uff62', '\uff63', '\uff64',  '{',  '}',     //     //     '_',	'$',	'(',	')',	'\\', '\uff65',     //     //     '~',	'"',	'\'',	'/',	'&',  '\uff61',    //     //     '*',	'@',	'.',	'?',	'!',  '`',     //     //     '#',	'-',	',',	':',	';',  '^',     //     //     '%',	'=',	'+',	'<',	'>'};    /** The set of available Japanese input modes. */    protected String jaInputModes[] = {        "KANJI",        "HALFWIDTH_KATAKANA",        "LATIN",        "LATIN_DIGITS",    };    /** The Japanese input mode conversion table. */    protected Object jaInputModeConvTable[][] = {        {"KANJI",              new Integer(IM_KANJI)},        {"HALFWIDTH_KATAKANA", new Integer(IM_KANA)},        {"LATIN",              new Integer(IM_ROMAN_CAPS)},        {"LATIN",              new Integer(IM_ROMAN_SMALL)},        {"LATIN_DIGITS",       new Integer(IM_NUMERIC)},        {"LATIN",              new Integer(IM_SYMBOL)},    };    /**     * Constructs a new DefaultInputMethodHandler_ja object     * to handle japanese input modes.     */    public DefaultInputMethodHandler_ja() {        allowedModes = new int[7];        super.supportedInputModes = jaInputModes;        super.inputModeConvTable = jaInputModeConvTable;        // Japanese specific symbol table        // super.symbolTableChars = jaSymbolTableChars;        // super.defaultSymbolCursorPos = 20;    }    /**     * Set the input method client.     * @param imc The Input method to use.     */    public void setInputMethodClient(InputMethodClient imc) {        super.setInputMethodClient(imc);        switch (inputMode) {	case IM_KANA:	    keyMap = kanaKeyMap;            break;	case IM_KANJI:	    keyMap = kanjiKeyMap;            break;        }    }    /**     * Set the input mode.     * @param mode The mode to use     * @return true if the mode could be set     */    protected boolean setInputMode(int mode) {        if (super.setInputMode(mode)) {            return true;        }	switch (mode) {	case IM_KANA:	    keyMap = kanaKeyMap;            break;	case IM_KANJI:	    keyMap = kanjiKeyMap;            break;        default:            return false;	}        imc.setInputMode(inputMode = mode);        return true;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -