public class InputMethodHighlight extends Object
Toolkit.mapInputMethodHighlight(java.awt.im.InputMethodHighlight)
映射到一个具体的风格。
抽象的描述包括三个方面:selected
,state
,和variation
。selected
指示文本范围是一个输入法是目前的工作,例如,该段为转换的候选人目前正在一个菜单显示。state
表示转换状态。状态值是由输入法框架定义的,并应在所有映射从抽象到具体风格的区别。目前定义的状态值为原料(尾)和转换。这些状态值推荐使用前和文字组成,主要转换步骤后说,之前和之后的假名-汉字或拼音> >汉字转换。的variation
字段允许输入的方法来表达对转换结果的附加信息。
inputmethodhighlight实例通常是作为属性值返回attributedcharacteriterator为input_method_highlight属性。他们可能被包裹成Annotation
实例表明单独的文本段。
AttributedCharacterIterator
Modifier and Type | Field and Description |
---|---|
static int |
CONVERTED_TEXT
转换文本状态常量。
|
static int |
RAW_TEXT
原始文本状态常量。
|
static InputMethodHighlight |
SELECTED_CONVERTED_TEXT_HIGHLIGHT
选定转换文本的默认高亮显示。
|
static InputMethodHighlight |
SELECTED_RAW_TEXT_HIGHLIGHT
为选定的原始文本的默认高亮显示常量。
|
static InputMethodHighlight |
UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
为选中的转换文本的默认亮点不断。
|
static InputMethodHighlight |
UNSELECTED_RAW_TEXT_HIGHLIGHT
为选中的原文本的默认亮点不断。
|
Constructor and Description |
---|
InputMethodHighlight(boolean selected, int state)
构造一个输入法突出记录。
|
InputMethodHighlight(boolean selected, int state, int variation)
构造一个输入法突出记录。
|
InputMethodHighlight(boolean selected, int state, int variation, Map<TextAttribute,?> style)
构造一个输入法突出记录。
|
Modifier and Type | Method and Description |
---|---|
int |
getState()
返回文本范围的转换状态。
|
Map<TextAttribute,?> |
getStyle()
返回文本范围的渲染样式属性,或为。
|
int |
getVariation()
返回文本范围的变化。
|
boolean |
isSelected()
返回是否选择文本范围。
|
public static final int RAW_TEXT
public static final int CONVERTED_TEXT
public static final InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT
public static final InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT
public static final InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
public static final InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT
public InputMethodHighlight(boolean selected, int state)
selected
-文本是否选定范围
state
-文本范围的转换状态raw_text或converted_text
IllegalArgumentException
如果比其他raw_text或converted_text给出一个状态
RAW_TEXT
,
CONVERTED_TEXT
public InputMethodHighlight(boolean selected, int state, int variation)
selected
-文本是否选定范围
state
-文本范围的转换状态raw_text或converted_text
variation
-文本范围的风格变化
IllegalArgumentException
如果比其他raw_text或converted_text给出一个状态
RAW_TEXT
,
CONVERTED_TEXT
public InputMethodHighlight(boolean selected, int state, int variation, Map<TextAttribute,?> style)
selected
-文本是否选定范围
state
-文本范围的转换状态raw_text或converted_text
variation
-文本范围的变化
style
-渲染样式属性的文本范围,或空
IllegalArgumentException
如果比其他raw_text或converted_text给出一个状态
RAW_TEXT
,
CONVERTED_TEXT
public boolean isSelected()
public int getState()
RAW_TEXT
,
CONVERTED_TEXT
public int getVariation()
public Map<TextAttribute,?> getStyle()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.