本文整理汇总了Java中java.lang.Character.Subset类的典型用法代码示例。如果您正苦于以下问题:Java Subset类的具体用法?Java Subset怎么用?Java Subset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Subset类属于java.lang.Character包,在下文中一共展示了Subset类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* @see java.awt.im.InputContext#setCharacterSubsets
*/
public void setCharacterSubsets(Subset[] subsets) {
if (subsets == null) {
characterSubsets = null;
} else {
characterSubsets = new Subset[subsets.length];
System.arraycopy(subsets, 0,
characterSubsets, 0, characterSubsets.length);
}
if (inputMethod != null) {
inputMethod.setCharacterSubsets(subsets);
}
}
示例2: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
@Override
public void setCharacterSubsets(Subset[] subsets) {
if (inputMethod != null) {
inputMethod.setCharacterSubsets(subsets);
}
super.setCharacterSubsets(subsets);
}
示例3: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* 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);
}
}
}
示例4: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* 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);
}
}
}
示例5: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* Sets the subsets of the Unicode character set that this input method
* is allowed to input. Null may be passed in to indicate that all
* characters are allowed.
* <p>
* This method is called
* <ul>
* <li>immediately after instantiating this input method,
* <li>when switching to this input method from a different one, and
* <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
* </ul>
*
* @param subsets the subsets of the Unicode character set from which
* characters may be input
*/
public void setCharacterSubsets(Subset[] subsets);
示例6: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* Sets the subsets of the Unicode character set that input methods of this input
* context should be allowed to input. Null may be passed in to
* indicate that all characters are allowed. The initial value
* is null. The setting applies to the current input method as well
* as input methods selected after this call is made. However,
* applications cannot rely on this call having the desired effect,
* since this setting cannot be passed on to all host input methods -
* applications still need to apply their own character validation.
* If no input methods are available, then this method has no effect.
*
* @param subsets The subsets of the Unicode character set from which characters may be input
*/
public void setCharacterSubsets(Subset[] subsets) {
// real implementation is in sun.awt.im.InputContext
}
示例7: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* Sets the subsets of the Unicode character set that this input method
* is allowed to input. Null may be passed in to indicate that all
* characters are allowed.
* <p>
* This method is called
* <ul>
* <li>immediately after instantiating this input method,
* <li>when switching to this input method from a different one, and
* <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
* </ul>
*
* @param subsets the subsets of the Unicode character set from which
* characters may be input
*/
public void setCharacterSubsets(Subset[] subsets) {
// -- SAK: Does mac OS X support this?
}
示例8: setCharacterSubsets
import java.lang.Character.Subset; //导入依赖的package包/类
/**
* Does nothing - XIM doesn't let you specify which characters you expect.
*
* @see java.awt.im.spi.InputMethod#setCharacterSubsets
*/
public void setCharacterSubsets(Subset[] subsets) {
}