Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.im

Class InputMethodHighlight

java.lang.Object
|
+--java.awt.im.InputMethodHighlight


public class InputMethodHighlight

extends 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:See Also:

Field Summary

static intCONVERTED_TEXT

Converted text state (after conversion).
static intRAW_TEXT

Raw text state (before conversion).
static java.awt.im.InputMethodHighlightSELECTED_CONVERTED_TEXT_HIGHLIGHT

Default do-nothing highlighting for selected converted text.
static java.awt.im.InputMethodHighlightSELECTED_RAW_TEXT_HIGHLIGHT

Default do-nothing highlighting for selected raw text.
static java.awt.im.InputMethodHighlightUNSELECTED_CONVERTED_TEXT_HIGHLIGHT

Default do-nothing highlighting for unselected converted text.
static java.awt.im.InputMethodHighlightUNSELECTED_RAW_TEXT_HIGHLIGHT

Default do-nothing highlighting for unselected raw text.

Constructor Summary

InputMethodHighlight(boolean selected, int state)

Create an input method highlight style, with variation 0 and null style mapping.
InputMethodHighlight(boolean selected, int state, int variation)

Create an input method highlight style, with null style mapping.
InputMethodHighlight(boolean selected, int state, int variation, java.util.Map style)

Create an input method highlight style.

Method Summary

intgetState()

Return the conversion state of the highlighted text.
java.util.MapgetStyle()

Return the rendering style attributes map, or null if it should be the default mapping.
intgetVariation()

Return the highlighting style variation.
booleanisSelected()

Return whether the highlighting applies to selected text.

Field Details

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.


Constructor Details

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:


Method Details

getState

public int getState()

Return the conversion state of the highlighted text.

Returns:


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: