Package limn.scene.event
Class PreeditEvent
java.lang.Object
limn.scene.event.InputEvent
limn.scene.event.PreeditEvent
In-progress IME composition ("preedit"): the text an input method is still
composing, shown inline with an underline but not committed to the
editing model. The committed result arrives later as ordinary
CharEvents; preedit is purely the transient overlay shown while the
user is composing (e.g. typing romaji/pinyin before picking a candidate).
An empty event clears the composition (the user committed or cancelled it). Routed to the focused widget only; a preedit with nothing focused is dropped.
The composing text is split into styled blocks (clauses the IME
draws differently); blockSizes() gives each block's length in code
points, tiling text() in order, and focusedBlock() marks the
one currently being converted. Indices carried here (caret,
block sizes) are in code points, matching the platform IME.
-
Constructor Summary
ConstructorsConstructorDescriptionPreeditEvent(String text, int[] blockSizes, int focusedBlock, int caret) An IME composition update. -
Method Summary
Modifier and TypeMethodDescriptionint[]Length in code points of each styled block; blocks tiletext()in order.intcaret()Caret position withintext(), in code points.intIndex intoblockSizes()of the block being converted, or-1if none.booleanisEmpty()text()The composing text; empty when the composition ends (commit or cancel).toString()Methods inherited from class limn.scene.event.InputEvent
consume, isConsumed
-
Constructor Details
-
PreeditEvent
An IME composition update.blockSizessplitstextinto conversion blocks,focusedBlockis the one being converted, and the caret is a char offset intotext. Empty text ends the composition.
-
-
Method Details
-
text
The composing text; empty when the composition ends (commit or cancel). -
blockSizes
public int[] blockSizes()Length in code points of each styled block; blocks tiletext()in order. -
focusedBlock
public int focusedBlock()Index intoblockSizes()of the block being converted, or-1if none. -
caret
public int caret()Caret position withintext(), in code points. -
isEmpty
public boolean isEmpty()- Returns:
- whether the composition is empty (i.e. this event clears the preedit)
-
toString
-