Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class TextRun

  1. Object
  2. TextRun
A stretch of text with one style.

Constructors

public TextRun(String text, String fontFamily, float size, ArtPaint fill)Creates a run.

Methods

public TextRun copy()A deep copy.
public String getText()The characters.
public void setText(String text)Sets the characters.
public String getFontFamily()The family name, or null.
public void setFontFamily(String fontFamily)Sets the family.
public float getSize()The size in the node’s units.
public void setSize(float size)Sets the size.
public boolean isBold()True for bold.
public void setBold(boolean bold)Sets bold.
public boolean isItalic()True for italic.
public void setItalic(boolean italic)Sets italic.
public boolean isUnderline()True for underline.
public void setUnderline(boolean underline)Sets underline.
public boolean isStrikethrough()True for strikethrough.
public void setStrikethrough(boolean strikethrough)Sets strikethrough.
public ArtPaint getFill()The text paint.
public void setFill(ArtPaint fill)Sets the text paint.
public float getLetterSpacing()Extra space between characters, in the node’s units.
public void setLetterSpacing(float letterSpacing)Sets the letter spacing.

Inherited methods

Constructor details

TextRun

public TextRun(String text, String fontFamily, float size, ArtPaint fill)
Creates a run.

Parameters

text String
the characters; \n breaks a line
fontFamily String
the family name, or null for the default
size float
the font size in the node’s units
fill ArtPaint
the text color or paint

Method details

copy

public TextRun copy()
A deep copy.

getText

public String getText()
The characters.

setText

public void setText(String text)
Sets the characters.

Parameters

text String
the characters

getFontFamily

public String getFontFamily()
The family name, or null.

setFontFamily

public void setFontFamily(String fontFamily)
Sets the family.

Parameters

fontFamily String
the family name

getSize

public float getSize()
The size in the node’s units.

setSize

public void setSize(float size)
Sets the size.

Parameters

size float
the size

isBold

public boolean isBold()
True for bold.

setBold

public void setBold(boolean bold)
Sets bold.

Parameters

bold boolean
true for bold

isItalic

public boolean isItalic()
True for italic.

setItalic

public void setItalic(boolean italic)
Sets italic.

Parameters

italic boolean
true for italic

isUnderline

public boolean isUnderline()
True for underline.

setUnderline

public void setUnderline(boolean underline)
Sets underline.

Parameters

underline boolean
true to underline

isStrikethrough

public boolean isStrikethrough()
True for strikethrough.

setStrikethrough

public void setStrikethrough(boolean strikethrough)
Sets strikethrough.

Parameters

strikethrough boolean
true to strike through

getFill

public ArtPaint getFill()
The text paint.

setFill

public void setFill(ArtPaint fill)
Sets the text paint.

Parameters

fill ArtPaint
the paint

getLetterSpacing

public float getLetterSpacing()
Extra space between characters, in the node’s units.

setLetterSpacing

public void setLetterSpacing(float letterSpacing)
Sets the letter spacing.

Parameters

letterSpacing float
extra space between characters