|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IInputLocationRequests
Defines the methods that the input method uses to receive information from the text component.
Method Summary | ||
---|---|---|
TextHitInfo |
getLocationOffset(int x,
int y)
Retrieves the offset within the composed text for the specified absolute x and y coordinates on the screen. |
|
void |
getTextLocation(TextHitInfo offset,
XYRect aResult)
Returns the location (absolute x and y coordinates on the screen) of a specified offset within the current composed text, or of the selection in committed text. |
Method Detail |
---|
TextHitInfo getLocationOffset(int x, int y)
This information is used, for example to handle touch events. The offset is relative to the composed text, so offset 0 indicates the beginning of the composed text.
x
- Absolute x coordinate on screen.y
- Absolute y coordinate on screen.
void getTextLocation(TextHitInfo offset, XYRect aResult)
The offset 0 is relative to the first character in the text if the component contains composed text. IllegalArgumentException is thrown in case offset is outside composed text boundaries
If the component doesn't have composed text, the beginning of the the highlight in the last line containing selected text is returned. For example, for horizontal left-to-right text, the character position to the left of the left-most character on the last line that contains selected text is returned.
The value is represented as a zero-thickness caret. In other words, it has no width if the text is drawn horizontally, and no height if the text is drawn vertically. The rectangle uses absolute screen coordinates.
Note that this implementation of the getTextLocation
method, passes in
the XYRect instance to populate it with data. As such, the method does
not return anything.
offset
- The location of the text or null if no composed text exists. IllegalArgumentException
is thrown in case offset is outside composed text boundariesaResult
- A rectangle (x,y,width,height) representing the location.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal