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 |
---|---|
getText() | Gets the text. |
setText(String value) | Sets the text. |
getStyle() | Gets the style. |
setStyle(TextStyle value) | Sets the style. |
getLength() | Gets the length of the associated 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.
getText()
public final String getText()
Gets the text.
Returns: java.lang.String
setText(String value)
public final void setText(String value)
Sets the text.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
getStyle()
public final TextStyle getStyle()
Gets the style.
Returns: TextStyle
setStyle(TextStyle value)
public final void setStyle(TextStyle value)
Sets the style.
Parameters:
Parameter | Type | Description |
---|---|---|
value | TextStyle |
getLength()
public final int getLength()
Gets the length of the associated text.
Returns: int