java.awt.Toolkit#mapInputMethodHighlight to map to a concrete style.
The abstract description consists of three fields: selected,
state, and variation.
selected indicates whether the text range is the one that the
input method is currently working on, for example, the segment for which
conversion candidates are currently shown in a menu.
state represents the conversion state. State values are defined
by the input method framework and should be distinguished in all
mappings from abstract to concrete styles. Currently defined state values
are raw (unconverted) and converted.
These state values are recommended for use before and after the
main conversion step of text composition, say, before and after kana->kanji
or pinyin->hanzi conversion.
The variation field allows input methods to express additional
information about the conversion results.
InputMethodHighlight instances are typically used as attribute values
returned from AttributedCharacterIterator for the INPUT_METHOD_HIGHLIGHT
attribute. They may be wrapped into Annotation
instances to indicate separate text segments.
java.text.AttributedCharacterIterator
| Modifier and Type | Field and Description |
|---|---|
| public static final int | CONVERTED_TEXT
Constant for the converted text state. |
| public static final int | RAW_TEXT
Constant for the raw text state. |
| private boolean | |
| public static final InputMethodHighlight | SELECTED_CONVERTED_TEXT_HIGHLIGHT
Constant for the default highlight for selected converted text. |
| public static final InputMethodHighlight | SELECTED_RAW_TEXT_HIGHLIGHT
Constant for the default highlight for selected raw text. |
| private int | |
| private Map | |
| public static final InputMethodHighlight | UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
Constant for the default highlight for unselected converted text. |
| public static final InputMethodHighlight | UNSELECTED_RAW_TEXT_HIGHLIGHT
Constant for the default highlight for unselected raw text. |
| private int |
| Access | Constructor and Description |
|---|---|
| public | InputMethodHighlight(boolean
Whether the text range is selected selected, int The conversion state for the text range - RAW_TEXT or CONVERTED_TEXT state)Constructs an input method highlight record. |
| public | InputMethodHighlight(boolean
Whether the text range is selected selected, int The conversion state for the text range - RAW_TEXT or CONVERTED_TEXT state, int The style variation for the text range variation)Constructs an input method highlight record. |
| public | InputMethodHighlight(boolean
whether the text range is selected selected, int the conversion state for the text range - RAW_TEXT or CONVERTED_TEXT state, int the variation for the text range variation, Map<TextAttribute, ?> the rendering style attributes for the text range, or null style)Constructs an input method highlight record. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The conversion state for the text range - RAW_TEXT or CONVERTED_TEXT.Returns the conversion state of the text range. |
| public Map | Returns: the rendering style attributes for the text range, or nullReturns the rendering style attributes for the text range, or null. |
| public int | |
| public boolean |
| CONVERTED_TEXT | back to summary |
|---|---|
| public static final int CONVERTED_TEXT Constant for the converted text state. | |
| RAW_TEXT | back to summary |
|---|---|
| public static final int RAW_TEXT Constant for the raw text state. | |
| selected | back to summary |
|---|---|
| private boolean selected | |
| SELECTED_CONVERTED_TEXT_HIGHLIGHT | back to summary |
|---|---|
| public static final InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT Constant for the default highlight for selected converted text. | |
| SELECTED_RAW_TEXT_HIGHLIGHT | back to summary |
|---|---|
| public static final InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT Constant for the default highlight for selected raw text. | |
| state | back to summary |
|---|---|
| private int state | |
| style | back to summary |
|---|---|
| private Map<TextAttribute, ?> style | |
| UNSELECTED_CONVERTED_TEXT_HIGHLIGHT | back to summary |
|---|---|
| public static final InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT Constant for the default highlight for unselected converted text. | |
| UNSELECTED_RAW_TEXT_HIGHLIGHT | back to summary |
|---|---|
| public static final InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT Constant for the default highlight for unselected raw text. | |
| variation | back to summary |
|---|---|
| private int variation | |
| InputMethodHighlight | back to summary |
|---|---|
| public InputMethodHighlight(boolean selected, int state) Constructs an input method highlight record. The variation is set to 0, the style to null.
| |
| InputMethodHighlight | back to summary |
|---|---|
| public InputMethodHighlight(boolean selected, int state, int variation) Constructs an input method highlight record. The style is set to null.
| |
| InputMethodHighlight | back to summary |
|---|---|
| public InputMethodHighlight(boolean selected, int state, int variation, Map<TextAttribute, ?> style) Constructs an input method highlight record. The style attributes map provided must be unmodifiable.
| |
| getState | back to summary |
|---|---|
| public int getState() Returns the conversion state of the text range.
| |
| getStyle | back to summary |
|---|---|
| public Map Returns the rendering style attributes for the text range, or null.
| |
| getVariation | back to summary |
|---|---|
| public int getVariation() Returns the variation of the text range.
| |
| isSelected | back to summary |
|---|---|
| public boolean isSelected() Returns whether the text range is selected.
| |