|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.InputMethodEvent
public class InputMethodEvent
This class is for event generated by change in a text input method.
InputMethodListener
,
Serialized FormField Summary | |
---|---|
static int |
CARET_POSITION_CHANGED
This event id indicates that the input method curor point has changed. |
static int |
INPUT_METHOD_FIRST
This is the first id in the range of event ids used by this class. |
static int |
INPUT_METHOD_LAST
This is the last id in the range of event ids used by this class. |
static int |
INPUT_METHOD_TEXT_CHANGED
This event id indicates that the text in the input method has changed. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
InputMethodEvent(Component source,
int id,
AttributedCharacterIterator text,
int committedCharacterCount,
TextHitInfo caret,
TextHitInfo visiblePosition)
Initializes a new instance of InputMethodEvent with the
specified source, id, text, char count, caret, and visible position. |
|
InputMethodEvent(Component source,
int id,
long when,
AttributedCharacterIterator text,
int committedCharacterCount,
TextHitInfo caret,
TextHitInfo visiblePosition)
Initializes a new instance of InputMethodEvent with the
specified source, id, timestamp, text, char count, caret, and visible
position. |
|
InputMethodEvent(Component source,
int id,
TextHitInfo caret,
TextHitInfo visiblePosition)
Initializes a new instance of InputMethodEvent with the
specified source, id, caret, and visible position, and with a null
text and char count. |
Method Summary | |
---|---|
void |
consume()
This method consumes the event. |
TextHitInfo |
getCaret()
Returns the caret position. |
int |
getCommittedCharacterCount()
Returns the number of committed characters in the input method text. |
AttributedCharacterIterator |
getText()
This method returns the input method text. |
TextHitInfo |
getVisiblePosition()
Returns the position that is most important to be visible, or null if such a hint is not necessary. |
long |
getWhen()
Return the timestamp of this event. |
boolean |
isConsumed()
This method tests whether or not this event has been consumed. |
String |
paramString()
This method returns a string identifying the event. |
Methods inherited from class java.awt.AWTEvent |
---|
getID, setSource, toString |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public InputMethodEvent(Component source, int id, long when, AttributedCharacterIterator text, int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition)
InputMethodEvent
with the
specified source, id, timestamp, text, char count, caret, and visible
position.
source
- the source that generated the eventid
- the event idwhen
- the timestamp of the eventtext
- the input textcommittedCharacterCount
- the number of committed characterscaret
- the caret positionvisiblePosition
- the position most important to make visible
IllegalArgumentException
- if source is null, id is invalid, id is
CARET_POSITION_CHANGED and text is non-null, or if
committedCharacterCount is out of rangepublic InputMethodEvent(Component source, int id, AttributedCharacterIterator text, int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition)
InputMethodEvent
with the
specified source, id, text, char count, caret, and visible position.
source
- the source that generated the eventid
- the event idtext
- the input textcommittedCharacterCount
- the number of committed characterscaret
- the caret positionvisiblePosition
- the position most important to make visible
IllegalArgumentException
- if source is null, id is invalid, id is
CARET_POSITION_CHANGED and text is non-null, or if
committedCharacterCount is out of rangepublic InputMethodEvent(Component source, int id, TextHitInfo caret, TextHitInfo visiblePosition)
InputMethodEvent
with the
specified source, id, caret, and visible position, and with a null
text and char count.
source
- the source that generated the eventid
- the event idcaret
- the caret positionvisiblePosition
- the position most important to make visible
IllegalArgumentException
- if source is null or id is invalidMethod Detail |
---|
public AttributedCharacterIterator getText()
null
,
and will always be null for CARET_POSITION_CHANGED
events.
Characters from 0 to getCommittedCharacterCount()-1
have
been committed, the remaining characters are composed text.
public int getCommittedCharacterCount()
public TextHitInfo getCaret()
INPUT_METHOD_TEXT_CHANGED
event.
public TextHitInfo getVisiblePosition()
INPUT_METHOD_TEXT_CHANGED
event.
public void consume()
consume
in class AWTEvent
public boolean isConsumed()
isConsumed
in class AWTEvent
public long getWhen()
public String paramString()
paramString
in class AWTEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |