java.awt.im
Class InputMethodHighlight
java.lang.Object
|
+--java.awt.im.InputMethodHighlight
public class
InputMethodHighlightextends
Object This describes the highlight attributes of text composed in an input method.
The description includes an abstract level (whether text has been converted
yet, and whether it is selected), and a concrete level (which style
attributes are used in rendering). If no concrete level is defined, the
renderer should use
Toolkit#mapInputMethodHighlight(InputMethodHighlight). An example
of conversion state is kana -> kanji.
Instances of this class are typically used in
AttributedCharacterIterators, and may be wrapped in Annotations to separate
text segments.
Since:Author:- Eric Blake <ebb9@email.byu.edu>
See Also:
CONVERTED_TEXT
public static final int CONVERTED_TEXT
Converted text state (after conversion).
RAW_TEXT
public static final int RAW_TEXT
Raw text state (before conversion).
SELECTED_CONVERTED_TEXT_HIGHLIGHT
public static final InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT
Default do-nothing highlighting for selected converted text.
SELECTED_RAW_TEXT_HIGHLIGHT
public static final InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT
Default do-nothing highlighting for selected raw text.
UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
public static final InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT
Default do-nothing highlighting for unselected converted text.
UNSELECTED_RAW_TEXT_HIGHLIGHT
public static final InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT
Default do-nothing highlighting for unselected raw text.
InputMethodHighlight
public InputMethodHighlight(boolean selected, int state)
Create an input method highlight style, with variation 0 and null style
mapping.
Parameters:
Throws:
InputMethodHighlight
public InputMethodHighlight(boolean selected, int state, int variation)
Create an input method highlight style, with null style mapping.
Parameters:
Throws:
InputMethodHighlight
public InputMethodHighlight(boolean selected, int state, int variation, java.util.Map style)
Create an input method highlight style.
Since:Parameters:
Throws:
getState
public int getState()
Return the conversion state of the highlighted text.
Returns:
- one of {@link #RAW_TEXT} or {@link #CONVERTED_TEXT}
getStyle
public Map getStyle()
Return the rendering style attributes map, or null if it should be the
default mapping.
Since:Returns:
getVariation
public int getVariation()
Return the highlighting style variation.
Returns:
isSelected
public boolean isSelected()
Return whether the highlighting applies to selected text.
Returns:
Instances of this class are typically used in AttributedCharacterIterators, and may be wrapped in Annotations to separate text segments.