TextRun
Contents
[
Hide
]Inheritance: java.lang.Object
public class TextRun
The class representing a piece of text with associated style.
Constructors
| Constructor | Description |
|---|---|
| TextRun(String text, TextStyle style) | Initializes a new instance of the TextRun class. |
| TextRun(String text) | Initializes a new instance of the TextRun class with default style. |
| TextRun(TextStyle style) | Initializes a new instance of the TextRun class with empty text. |
| TextRun() | Initializes a new instance of the TextRun class with empty text and default style. |
Methods
| Method | Description |
|---|---|
| getLength() | Gets the length of the associated text. |
| getStyle() | Gets the style. |
| getText() | Gets the text. |
| setStyle(TextStyle value) | Sets the style. |
| setText(String value) | Sets the text. |
TextRun(String text, TextStyle style)
public TextRun(String text, TextStyle style)
Initializes a new instance of the TextRun class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| text | java.lang.String | The associated text. |
| style | TextStyle | The style. |
TextRun(String text)
public TextRun(String text)
Initializes a new instance of the TextRun class with default style.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| text | java.lang.String | The associated text. |
TextRun(TextStyle style)
public TextRun(TextStyle style)
Initializes a new instance of the TextRun class with empty text.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| style | TextStyle | The style. |
TextRun()
public TextRun()
Initializes a new instance of the TextRun class with empty text and default style.
getLength()
public final int getLength()
Gets the length of the associated text.
Returns: int
getStyle()
public final TextStyle getStyle()
Gets the style.
Returns: TextStyle
getText()
public final String getText()
Gets the text.
Returns: java.lang.String
setStyle(TextStyle value)
public final void setStyle(TextStyle value)
Sets the style.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | TextStyle |
setText(String value)
public final void setText(String value)
Sets the text.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String |