public class

TextStyleBuilder

extends LabelStyleBuilder
java.lang.Object
   ↳ com.carto.styles.StyleBuilder
     ↳ com.carto.styles.BillboardStyleBuilder
       ↳ com.carto.styles.LabelStyleBuilder
         ↳ com.carto.styles.TextStyleBuilder

Class Overview

A builder class for TextStyle.

Summary

Public Constructors
TextStyleBuilder()
Constructs a TextStyleBuilder object with all parameters set to defaults.
Public Methods
TextStyle buildStyle()
Builds a new instance of the TextStyle object using previously set parameters.
synchronized void delete()
Color getBackgroundColor()
Returns the background color for the text label.
Color getBorderColor()
Returns the border color for the text label.
float getBorderWidth()
Returns the border width for the text label.
String getFontName()
Returns the font name for the text label.
float getFontSize()
Returns the font size for the text label.
Color getStrokeColor()
Returns the stroke color for the text label.
float getStrokeWidth()
Returns the stroke width for the text label.
String getTextField()
Returns the text field variable.
TextMargins getTextMargins()
Returns the margins for the text.
boolean isBreakLines()
Returns the state of the 'break lines' flag.
void setBackgroundColor(Color backgroundColor)
Sets the background color for the text label.
void setBorderColor(Color borderColor)
Sets the border color for the text label.
void setBorderWidth(float borderWidth)
Sets the border width for the text label.
void setBreakLines(boolean enable)
Sets the state of the 'break lines' flag.
void setFontName(String fontName)
Sets the font name for the text label.
void setFontSize(float size)
Sets the font size for the text label.
void setStrokeColor(Color strokeColor)
Sets the stroke color for the text label.
void setStrokeWidth(float strokeWidth)
Sets the stroke width for the text label.
void setTextField(String field)
Sets the text field variable.
void setTextMargins(TextMargins textMargins)
Sets the margins for the text.
[Expand]
Inherited Methods
From class com.carto.styles.LabelStyleBuilder
From class com.carto.styles.BillboardStyleBuilder
From class com.carto.styles.StyleBuilder
From class java.lang.Object

Public Constructors

public TextStyleBuilder ()

Constructs a TextStyleBuilder object with all parameters set to defaults.

Public Methods

public TextStyle buildStyle ()

Builds a new instance of the TextStyle object using previously set parameters.

Returns
  • A new TextStyle object.

public synchronized void delete ()

public Color getBackgroundColor ()

Returns the background color for the text label.

Returns
  • The background color for the text label.

public Color getBorderColor ()

Returns the border color for the text label.

Returns
  • The border color for the text label.

public float getBorderWidth ()

Returns the border width for the text label.

Returns
  • The border width for the text label in screen density independent pixels.

public String getFontName ()

Returns the font name for the text label.

Returns
  • The platform dependent font name for the text label.

public float getFontSize ()

Returns the font size for the text label.

Returns
  • The font size for the text label in points.

public Color getStrokeColor ()

Returns the stroke color for the text label.

Returns
  • The stroke color for the text label.

public float getStrokeWidth ()

Returns the stroke width for the text label.

Returns
  • The stroke width for the text label in screen density independent pixels.

public String getTextField ()

Returns the text field variable. If not empty, this variable is used to read actual text string from object meta info.

Returns
  • The current text variable.

public TextMargins getTextMargins ()

Returns the margins for the text.

Returns
  • The margins for the text.

public boolean isBreakLines ()

Returns the state of the 'break lines' flag.

Returns
  • The state of the 'break lines' flag.

public void setBackgroundColor (Color backgroundColor)

Sets the background color for the text label.

Parameters
backgroundColor The new background color for the text label. By default the background color is transparent.

public void setBorderColor (Color borderColor)

Sets the border color for the text label.

Parameters
borderColor The new border color for the text label. By default the border color is transparent.

public void setBorderWidth (float borderWidth)

Sets the border width for the text label.

Parameters
borderWidth The new border width for the text label in screen density independent pixels. By default the border width is 0.

public void setBreakLines (boolean enable)

Sets the state of the 'break lines' flag.
If enabled, texts containing CR or NL characters are split into multiple lines.
By default the flag is false, due to backward compatibility reasons.

public void setFontName (String fontName)

Sets the font name for the text label.

Parameters
fontName The new platform dependent font name for the text label.

public void setFontSize (float size)

Sets the font size for the text label.

Parameters
size The new font size for the text label in points.

public void setStrokeColor (Color strokeColor)

Sets the stroke color for the text label.

Parameters
strokeColor The new stroke color for the text label.

public void setStrokeWidth (float strokeWidth)

Sets the stroke width for the text label.

Parameters
strokeWidth The new stroke width for the text label in screen density independent pixels.

public void setTextField (String field)

Sets the text field variable. If not empty, this variable is used to read actual text string from object meta info.

Parameters
field The text field to use for displaying text from metainfo.

public void setTextMargins (TextMargins textMargins)

Sets the margins for the text. The margins will determine how much
empty space should surround the text. The default is TextMargins(0, 0, 0, 0).

Parameters
textMargins The new margins for the text in dp.