Java Code Examples for java.lang.Character.UnicodeBlock#HANGUL_JAMO

The following examples show how to use java.lang.Character.UnicodeBlock#HANGUL_JAMO . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WInputMethod.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 2
Source File: WInputMethod.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 3
Source File: WInputMethod.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 4
Source File: WInputMethod.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 5
Source File: WInputMethod.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 6
Source File: WInputMethod.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 7
Source File: WInputMethod.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 8
Source File: WInputMethod.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 9
Source File: WInputMethod.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 10
Source File: WInputMethod.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 11
Source File: WInputMethod.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 12
Source File: WInputMethod.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 13
Source File: WInputMethod.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Implements InputMethod.setCharacterSubsets for Windows.
 *
 * @see java.awt.im.spi.InputMethod#setCharacterSubsets
 */
@Override
public void setCharacterSubsets(Subset[] subsets) {
    if (subsets == null){
        setConversionStatus(context, cmode);
        setOpenStatus(context, open);
        return;
    }

    // Use first subset only. Other subsets in array is ignored.
    // This is restriction of Win32 implementation.
    Subset subset1 = subsets[0];

    Locale locale = getNativeLocale();
    int newmode;

    if (locale == null) {
        return;
    }

    if (locale.getLanguage().equals(Locale.JAPANESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.KANJI
                || subset1 == UnicodeBlock.HIRAGANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE;
            else if (subset1 == UnicodeBlock.KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA| IME_CMODE_FULLSHAPE;
            else if (subset1 == InputSubset.HALFWIDTH_KATAKANA)
                newmode = IME_CMODE_NATIVE | IME_CMODE_KATAKANA;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            newmode |= (getConversionStatus(context)&IME_CMODE_ROMAN);   // reserve ROMAN input mode
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.KOREAN.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.HANJA
                || subset1 == UnicodeBlock.HANGUL_SYLLABLES
                || subset1 == UnicodeBlock.HANGUL_JAMO
                || subset1 == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    } else if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
        if (subset1 == UnicodeBlock.BASIC_LATIN || subset1 == InputSubset.LATIN_DIGITS) {
            setOpenStatus(context, false);
        } else {
            if (subset1 == UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS
                || subset1 == InputSubset.TRADITIONAL_HANZI
                || subset1 == InputSubset.SIMPLIFIED_HANZI)
                newmode = IME_CMODE_NATIVE;
            else if (subset1 == InputSubset.FULLWIDTH_LATIN)
                newmode = IME_CMODE_FULLSHAPE;
            else
                return;
            setOpenStatus(context, true);
            setConversionStatus(context, newmode);
        }
    }
}
 
Example 14
Source File: Komoran.java    From komoran-2.0 with Apache License 2.0 4 votes vote down vote up
/**
 * 입력된 문자로부터 symbol을 구분하여 lattice에 삽입
 * @param in
 * @param i
 */
private void symbolParsing(String in, int i) {
	char ch = in.charAt(i);
	Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(ch);
	//숫자
	if(Character.isDigit(ch)){
		
	}
	else if(unicodeBlock == Character.UnicodeBlock.BASIC_LATIN){
		//영어
		if (((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'))) {
			;
		}
		else if(observation.getTrieDictionary().get(ch) != null){
			;
		}
		//symbol
		else{
			this.lattice.put(i, i+1, ""+ch, this.table.getId(SYMBOL.SW), SCORE.SW);
		}
	}
	//한글
	else if(unicodeBlock == UnicodeBlock.HANGUL_COMPATIBILITY_JAMO 
			|| unicodeBlock == UnicodeBlock.HANGUL_JAMO
			|| unicodeBlock == UnicodeBlock.HANGUL_JAMO_EXTENDED_A
			||unicodeBlock == UnicodeBlock.HANGUL_JAMO_EXTENDED_B
			||unicodeBlock == UnicodeBlock.HANGUL_SYLLABLES){
		;
	}
	//일본어
	else if(unicodeBlock == UnicodeBlock.KATAKANA
			|| unicodeBlock == UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS){
		
	}
	//중국어
	else if(UnicodeBlock.CJK_COMPATIBILITY.equals(unicodeBlock)				
			|| UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS.equals(unicodeBlock)
			|| UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.equals(unicodeBlock)
			|| UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B.equals(unicodeBlock)
			|| UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS.equals(unicodeBlock)){
		;
	}
	else{
		this.lattice.put(i, i+1, ""+ch, this.table.getId(SYMBOL.SW), SCORE.SW);
	}
}