| Modifier and Type | Class and Description |
|---|---|
| public static interface | TextLayout.
Encodes the caret geometry, which can be either a single vertical line,
or two vertical lines (a "split" caret), represented by |
| public static interface | TextLayout.
Callback to be called for each rectangular shape |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int |
| Modifier and Type | Method and Description |
|---|---|
| public BaseBounds | Returns: the layout boundsReturns the (logical) bounds of the layout minX is always zero minY is the ascent of the first line (negative) width the width of the widest line height the sum of all lines height Note that this width is different the wrapping width! |
| public BaseBounds | |
| public TextLayout. | Returns: the caret geometrythe character offset offset, boolean whether the caret is biased on the leading edge of the character leading)Queries the caret geometry and associated information at the specified text position. |
| public TextLayout. | Returns: returns aHit object containing character index, insertion index and position of cursor on the character.x coordinate value. x, float y coordinate value. y)Calculates character index and insertion index for the given coordinates
and maps to |
| public TextLine[] | |
| public void | getRange(int
the start offset start, int the end offset end, int the type of the geometry type, TextLayout.the callback to invoke for each rectangular shape clientQueries the range geometry of the range of text within the text layout for one of the three possible types:
|
| public GlyphList[] | |
| public Shape | |
| public BaseBounds | Returns: the visual boundsReturns the visual bounds of the layout using glyph bounding box |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the alignment for the TextLayout. |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the bounds type for the TextLayout. |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the content for the TextLayout. |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the content for the TextLayout. |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the direction (bidi algorithm's) for the TextLayout. |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the line spacing for the TextLayout. |
| public boolean | Returns: returns true if the call modifies the layout internal statethe tab size tabSize, TabAdvancePolicy the tab advance policy, or null policy)Sets the tab size and the tab advance policy for the TextLayout. |
| public boolean | Returns: returns true is the call modifies the layout internal state.Sets the wrap width for the TextLayout. |
| ALIGN_CENTER | back to summary |
|---|---|
| public static final int ALIGN_CENTER | |
| ALIGN_JUSTIFY | back to summary |
|---|---|
| public static final int ALIGN_JUSTIFY | |
| ALIGN_LEFT | back to summary |
|---|---|
| public static final int ALIGN_LEFT | |
| ALIGN_MASK | back to summary |
|---|---|
| public static final int ALIGN_MASK | |
| ALIGN_RIGHT | back to summary |
|---|---|
| public static final int ALIGN_RIGHT | |
| ANALYSIS_MASK | back to summary |
|---|---|
| public static final int ANALYSIS_MASK | |
| BOUNDS_CENTER | back to summary |
|---|---|
| public static final int BOUNDS_CENTER | |
| BOUNDS_MASK | back to summary |
|---|---|
| public static final int BOUNDS_MASK | |
| DEFAULT_TAB_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_TAB_SIZE | |
| DIRECTION_DEFAULT_LTR | back to summary |
|---|---|
| public static final int DIRECTION_DEFAULT_LTR | |
| DIRECTION_DEFAULT_RTL | back to summary |
|---|---|
| public static final int DIRECTION_DEFAULT_RTL | |
| DIRECTION_LTR | back to summary |
|---|---|
| public static final int DIRECTION_LTR | |
| DIRECTION_MASK | back to summary |
|---|---|
| public static final int DIRECTION_MASK | |
| DIRECTION_RTL | back to summary |
|---|---|
| public static final int DIRECTION_RTL | |
| FLAGS_ANALYSIS_VALID | back to summary |
|---|---|
| public static final int FLAGS_ANALYSIS_VALID | |
| FLAGS_CACHED_STRIKETHROUGH | back to summary |
|---|---|
| public static final int FLAGS_CACHED_STRIKETHROUGH | |
| FLAGS_CACHED_UNDERLINE | back to summary |
|---|---|
| public static final int FLAGS_CACHED_UNDERLINE | |
| FLAGS_HAS_BIDI | back to summary |
|---|---|
| public static final int FLAGS_HAS_BIDI | |
| FLAGS_HAS_CJK | back to summary |
|---|---|
| public static final int FLAGS_HAS_CJK | |
| FLAGS_HAS_COMPLEX | back to summary |
|---|---|
| public static final int FLAGS_HAS_COMPLEX | |
| FLAGS_HAS_EMBEDDED | back to summary |
|---|---|
| public static final int FLAGS_HAS_EMBEDDED | |
| FLAGS_HAS_TABS | back to summary |
|---|---|
| public static final int FLAGS_HAS_TABS | |
| FLAGS_LAST | back to summary |
|---|---|
| public static final int FLAGS_LAST | |
| FLAGS_LINES_VALID | back to summary |
|---|---|
| public static final int FLAGS_LINES_VALID | |
| FLAGS_RTL_BASE | back to summary |
|---|---|
| public static final int FLAGS_RTL_BASE | |
| FLAGS_WRAPPED | back to summary |
|---|---|
| public static final int FLAGS_WRAPPED | |
| TYPE_BASELINE | back to summary |
|---|---|
| public static final int TYPE_BASELINE | |
| TYPE_BEARINGS | back to summary |
|---|---|
| public static final int TYPE_BEARINGS | |
| TYPE_STRIKETHROUGH | back to summary |
|---|---|
| public static final int TYPE_STRIKETHROUGH | |
| TYPE_TEXT | back to summary |
|---|---|
| public static final int TYPE_TEXT | |
| TYPE_TOP | back to summary |
|---|---|
| public static final int TYPE_TOP | |
| TYPE_UNDERLINE | back to summary |
|---|---|
| public static final int TYPE_UNDERLINE | |
| getBounds | back to summary |
|---|---|
| public BaseBounds getBounds() Returns the (logical) bounds of the layout minX is always zero minY is the ascent of the first line (negative) width the width of the widest line height the sum of all lines height Note that this width is different the wrapping width!
| |
| getBounds | back to summary |
|---|---|
| public BaseBounds getBounds(TextSpan filter, BaseBounds bounds) | |
| getCaretGeometry | back to summary |
|---|---|
| public TextLayout. Queries the caret geometry and associated information at the specified text position.
| |
| getHitInfo | back to summary |
|---|---|
| public TextLayout. Calculates character index and insertion index for the given coordinates
and maps to
| |
| getLines | back to summary |
|---|---|
| public TextLine[] getLines() Returns the lines of text layout.
| |
| getRange | back to summary |
|---|---|
| public void getRange(int start, int end, int type, TextLayout. Queries the range geometry of the range of text within the text layout for one of the three possible types:
| |
| getRuns | back to summary |
|---|---|
| public GlyphList[] getRuns() Returns the GlyphList of text layout. The runs are returned order visually (rendering order), starting from the first line.
| |
| getShape | back to summary |
|---|---|
| public Shape getShape(int type, TextSpan filter) Returns the shape of the entire text layout relative to the baseline of the first line.
| |
| getVisualBounds | back to summary |
|---|---|
| public BaseBounds getVisualBounds(int type) Returns the visual bounds of the layout using glyph bounding box
| |
| setAlignment | back to summary |
|---|---|
| public boolean setAlignment(int alignment) Sets the alignment for the TextLayout.
| |
| setBoundsType | back to summary |
|---|---|
| public boolean setBoundsType(int type) Sets the bounds type for the TextLayout.
| |
| setContent | back to summary |
|---|---|
| public boolean setContent(TextSpan[] spans) Sets the content for the TextLayout. Supports multiple spans (rich text).
| |
| setContent | back to summary |
|---|---|
| public boolean setContent(String string, Object font) Sets the content for the TextLayout. Shorthand for single span text (no rich text).
| |
| setDirection | back to summary |
|---|---|
| public boolean setDirection(int direction) Sets the direction (bidi algorithm's) for the TextLayout.
| |
| setLineSpacing | back to summary |
|---|---|
| public boolean setLineSpacing(float spacing) Sets the line spacing for the TextLayout.
| |
| setTabAdvancePolicy | back to summary |
|---|---|
| public boolean setTabAdvancePolicy(int tabSize, TabAdvancePolicy policy) Sets the tab size and the tab advance policy for the TextLayout.
A non-
| |
| setWrapWidth | back to summary |
|---|---|
| public boolean setWrapWidth(float wrapWidth) Sets the wrap width for the TextLayout.
| |
Single
and Split classes respectively.
| Modifier and Type | Class and Description |
|---|---|
| public static record | TextLayout.
Represents a single line from (x, y) to (x, y + height) |
| public static record | TextLayout.
Represents a split caret drawn as two lines, the first line from (x1, y) to (x1, y + height/2), the second line from (x2, y + height/2) to (x2, y + height). |
| Modifier and Type | Field and Description |
|---|---|
| private final float | |
| private final float | |
| private final float |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public float | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| public float | |
| public float |
| height | back to summary |
|---|---|
| private final float height Record Component accessed by height(). | |
| x | back to summary |
|---|---|
| private final float x Record Component accessed by x(). | |
| y | back to summary |
|---|---|
| private final float y Record Component accessed by y(). | |
| Single | back to summary |
|---|---|
| public Single(float x, float y, float height) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| height | back to summary |
|---|---|
| public float height() Record Component getter of height. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| x | back to summary |
|---|---|
| public float x() Record Component getter of x. | |
| y | back to summary |
|---|---|
| public float y() Record Component getter of y. | |
| Modifier and Type | Field and Description |
|---|---|
| private final float | |
| private final float | |
| private final float | |
| private final float |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public float | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| public float | |
| public float | |
| public float |
| height | back to summary |
|---|---|
| private final float height Record Component accessed by height(). | |
| x1 | back to summary |
|---|---|
| private final float x1 Record Component accessed by x1(). | |
| x2 | back to summary |
|---|---|
| private final float x2 Record Component accessed by x2(). | |
| y | back to summary |
|---|---|
| private final float y Record Component accessed by y(). | |
| Split | back to summary |
|---|---|
| public Split(float x1, float x2, float y, float height) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| height | back to summary |
|---|---|
| public float height() Record Component getter of height. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| x1 | back to summary |
|---|---|
| public float x1() Record Component getter of x1. | |
| x2 | back to summary |
|---|---|
| public float x2() Record Component getter of x2. | |
| y | back to summary |
|---|---|
| public float y() Record Component getter of y. | |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| addRectangle | back to summary |
|---|---|
| public void addRectangle(float left, float top, float right, float bottom) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public int | |
| public int | |
| public boolean | |
| public String |
| charIndex | back to summary |
|---|---|
| pack-priv int charIndex | |
| insertionIndex | back to summary |
|---|---|
| pack-priv int insertionIndex | |
| leading | back to summary |
|---|---|
| pack-priv boolean leading | |
| Hit | back to summary |
|---|---|
| public Hit(int charIndex, int insertionIndex, boolean leading) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getCharIndex | back to summary |
|---|---|
| public int getCharIndex() | |
| getInsertionIndex | back to summary |
|---|---|
| public int getInsertionIndex() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isLeading | back to summary |
|---|---|
| public boolean isLeading() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |