java.lang.Object | +--java.util.EventObject | +--java.awt.AWTEvent | +--java.awt.event.InputMethodEvent
Safe:
static int
CARET_POSITION_CHANGED
static int
INPUT_METHOD_FIRST
static int
INPUT_METHOD_LAST
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
InputMethodEvent(Component source,
int id,
java.text.AttributedCharacterIterator text,
int committedCharacterCount,
java.awt.font.TextHitInfo caret,
java.awt.font.TextHitInfo visiblePosition)
InputMethodEvent
with the specified
source component, type, text, caret, and visiblePosition.
InputMethodEvent(Component source,
int id,
long when,
java.text.AttributedCharacterIterator text,
int committedCharacterCount,
java.awt.font.TextHitInfo caret,
java.awt.font.TextHitInfo visiblePosition)
InputMethodEvent
with the specified
source component, type, time, text, caret, and visiblePosition.
InputMethodEvent(Component source,
int id,
java.awt.font.TextHitInfo caret,
java.awt.font.TextHitInfo visiblePosition)
InputMethodEvent
with the
specified source component, type, caret, and visiblePosition.
void
consume()
java.text.AttributedCharacterIterator
getText()
java.awt.font.TextHitInfo
getVisiblePosition()
private void
readObject(ObjectInputStream s)
when
field if it is not present in the
object input stream.
private static final long serialVersionUID
public static final int INPUT_METHOD_FIRST
public static final int INPUT_METHOD_TEXT_CHANGED
public static final int CARET_POSITION_CHANGED
public static final int INPUT_METHOD_LAST
long when
getWhen()
private transient java.text.AttributedCharacterIterator text
private transient int committedCharacterCount
private transient java.awt.font.TextHitInfo caret
private transient java.awt.font.TextHitInfo visiblePosition
public InputMethodEvent(Component source, int id, long when, java.text.AttributedCharacterIterator text, int committedCharacterCount, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)
InputMethodEvent
with the specified
source component, type, time, text, caret, and visiblePosition.
The offsets of caret and visiblePosition are relative to the current
composed text; that is, the composed text within text
if this is an INPUT_METHOD_TEXT_CHANGED
event,
the composed text within the text
of the
preceding INPUT_METHOD_TEXT_CHANGED
event otherwise.
source
- the object where the event originatedid
- the event typewhen
- a long integer that specifies the time the event occurredtext
- the combined committed and composed text,
committed text first; must be null
when the event type is CARET_POSITION_CHANGED
;
may be null
for
INPUT_METHOD_TEXT_CHANGED
if there's no
committed or composed textcommittedCharacterCount
- the number of committed
characters in the textcaret
- the caret (a.k.a. insertion point);
null
if there's no caret within current
composed textvisiblePosition
- the position that's most important
to be visible; null
if there's no
recommendation for a visible position within current
composed textpublic InputMethodEvent(Component source, int id, java.text.AttributedCharacterIterator text, int committedCharacterCount, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)
InputMethodEvent
with the specified
source component, type, text, caret, and visiblePosition.
The offsets of caret and visiblePosition are relative to the current
composed text; that is, the composed text within text
if this is an INPUT_METHOD_TEXT_CHANGED
event,
the composed text within the text
of the
preceding INPUT_METHOD_TEXT_CHANGED
event otherwise.
The time stamp for this event is initialized by invoking
java.awt.EventQueue#getMostRecentEventTime()
.
source
- the object where the event originatedid
- the event typetext
- the combined committed and composed text,
committed text first; must be null
when the event type is CARET_POSITION_CHANGED
;
may be null
for
INPUT_METHOD_TEXT_CHANGED
if there's no
committed or composed textcommittedCharacterCount
- the number of committed
characters in the textcaret
- the caret (a.k.a. insertion point);
null
if there's no caret within current
composed textvisiblePosition
- the position that's most important
to be visible; null
if there's no
recommendation for a visible position within current
composed textpublic InputMethodEvent(Component source, int id, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)
InputMethodEvent
with the
specified source component, type, caret, and visiblePosition.
The text is set to null
,
committedCharacterCount
to 0.
The offsets of caret
and visiblePosition
are relative to the current composed text; that is,
the composed text within the text
of the
preceding INPUT_METHOD_TEXT_CHANGED
event if the
event being constructed as a CARET_POSITION_CHANGED
event.
For an INPUT_METHOD_TEXT_CHANGED
event without text,
caret
and visiblePosition
must be
null
.
The time stamp for this event is initialized by invoking
java.awt.EventQueue#getMostRecentEventTime()
.
source
- the object where the event originatedid
- the event typecaret
- the caret (a.k.a. insertion point);
null
if there's no caret within current
composed textvisiblePosition
- the position that's most important
to be visible; null
if there's no
recommendation for a visible position within current
composed textpublic java.text.AttributedCharacterIterator getText()
getCommittedCharacterCount() - 1
are committed
text, the remaining characters are composed text.
public int getCommittedCharacterCount()
public java.awt.font.TextHitInfo getCaret()
The offset of the caret is relative to the current
composed text; that is, the composed text within getText()
if this is an INPUT_METHOD_TEXT_CHANGED
event,
the composed text within getText() of the
preceding INPUT_METHOD_TEXT_CHANGED
event otherwise.
public java.awt.font.TextHitInfo getVisiblePosition()
The offset of the visible position is relative to the current
composed text; that is, the composed text within getText()
if this is an INPUT_METHOD_TEXT_CHANGED
event,
the composed text within getText() of the
preceding INPUT_METHOD_TEXT_CHANGED
event otherwise.
public void consume()
public boolean isConsumed()
isConsumed
in class AWTEvent
consume()
public long getWhen()
public String paramString()
paramString
in class AWTEvent
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException
when
field if it is not present in the
object input stream. In that case, the field will be initialized by
invoking java.awt.EventQueue#getMostRecentEventTime()
.