public class

TextSymbol

extends MarkerSymbol
java.lang.Object
   ↳ com.esri.core.symbol.MarkerSymbol
     ↳ com.esri.core.symbol.TextSymbol

Class Overview

Used to display text at points on the graphics layer.

Summary

Nested Classes
enum TextSymbol.HorizontalAlignment The Enum HorizontalAlignment. 
enum TextSymbol.VerticalAlignment The Enum VerticalAlignment. 
Constants
String TYPE The Constant TYPE.
Public Constructors
TextSymbol(JsonNode node)
Instantiates an object of TextSymbol from a JsonNode.
TextSymbol(int size, String text, int color, TextSymbol.HorizontalAlignment halign, TextSymbol.VerticalAlignment valign)
Instantiates an object of TextSymbol in the specified size, color, and horizontal and vertical alignment.
TextSymbol(int size, String text, int color)
Instantiates an object of TextSymbol in the specified size and color.
TextSymbol(String fontFamily, String text, int color)
Instantiates an object of TextSymbol in the specified font family and color.
TextSymbol(TextSymbol textSymbol)
The Constructor.
Public Methods
Symbol copy()
boolean equals(Object obj)
int getColor()
Returns the color of the TextSymbol.
FontDecoration getFontDecoration()
Returns the font decoration of the symbol.
String getFontFamily()
Returns the font family of the symbol.
FontStyle getFontStyle()
Returns the font style of the symbol.
FontWeight getFontWeight()
Returns the font weight of the symbol.
TextSymbol.HorizontalAlignment getHorizontalAlignment()
Gets the horizontal alignment of the symbol.
float getSize()
Returns the font size in pixels.
String getText()
Returns the text content of the symbol.
TextSymbol.VerticalAlignment getVerticalAlignment()
Gets the vertical alignment of the symbol.
int hashCode()
void setColor(int color)
Sets the color to render the TextSymbol with.
TextSymbol setFontDecoration(FontDecoration fontDecoration)
Sets the font decoration of the symbol.
TextSymbol setFontFamily(String fontFamily)
Sets the font family of the symbol.
TextSymbol setFontStyle(FontStyle fontStyle)
Sets the font style of the symbol.
TextSymbol setFontWeight(FontWeight fontWeight)
Sets the font weight of the symbol.
TextSymbol setHorizontalAlignment(TextSymbol.HorizontalAlignment horizontalAlignment)
Sets the horizontal alignment of the symbol.
TextSymbol setSize(float size)
Sets the font size.
TextSymbol setText(String text)
Sets the text content of the symbol.
TextSymbol setVerticalAlignment(TextSymbol.VerticalAlignment verticalAlignment)
Sets the vertical alignment of the TextSymbol.
String toJson()
[Expand]
Inherited Methods
From class com.esri.core.symbol.MarkerSymbol
From class java.lang.Object
From interface com.esri.core.symbol.Symbol

Constants

public static final String TYPE

The Constant TYPE.

Constant Value: "esriTS"

Public Constructors

public TextSymbol (JsonNode node)

Instantiates an object of TextSymbol from a JsonNode.

Parameters
node JsonNode: the text symbol node.

public TextSymbol (int size, String text, int color, TextSymbol.HorizontalAlignment halign, TextSymbol.VerticalAlignment valign)

Instantiates an object of TextSymbol in the specified size, color, and horizontal and vertical alignment.

Parameters
size int: the size of the font.
text String: the text content.
color int: the color of the text.
halign TextSymbol.HorizontalAlignment: HorizontalAlignment
valign TextSymbol.VerticalAlignment: VerticalAlignment

public TextSymbol (int size, String text, int color)

Instantiates an object of TextSymbol in the specified size and color. The default horizontal and vertical alignment is set to center.

Parameters
size int: the size of the font.
text String: the text content.
color int: the color of the text.

public TextSymbol (String fontFamily, String text, int color)

Instantiates an object of TextSymbol in the specified font family and color. The default horizontal and vertical alignment is set to center.

Parameters
fontFamily String: the font family of the text.
text String: the text content.
color int: the color of the text.

public TextSymbol (TextSymbol textSymbol)

The Constructor.

Parameters
textSymbol TextSymbol: the text symbol

Public Methods

public Symbol copy ()

Returns
Symbol
Throws
Exception

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public int getColor ()

Returns the color of the TextSymbol. The color is a 32bit value containing alpha as well as RGB. This 32bit value is not pre-multiplied, meaning that its alpha can be any value, regardless of the values of RGB. See the Color class for more details.

Returns
int the color in RGB color value.

public FontDecoration getFontDecoration ()

Returns the font decoration of the symbol.

Returns
FontDecoration the font decoration of the symbol.

public String getFontFamily ()

Returns the font family of the symbol.

Returns
String the font family of the symbol.

public FontStyle getFontStyle ()

Returns the font style of the symbol.

Returns
FontStyle the font style of the symbol.

public FontWeight getFontWeight ()

Returns the font weight of the symbol.

Returns
FontWeight the font weight of the symbol.

public TextSymbol.HorizontalAlignment getHorizontalAlignment ()

Gets the horizontal alignment of the symbol.

Returns
TextSymbol.HorizontalAlignment Returns the horizontal alignment.

public float getSize ()

Returns the font size in pixels.

Returns
float the font size in pixels.

public String getText ()

Returns the text content of the symbol.

Returns
String the text

public TextSymbol.VerticalAlignment getVerticalAlignment ()

Gets the vertical alignment of the symbol.

Returns
TextSymbol.VerticalAlignment Returns the vertical alignment.

public int hashCode ()

Returns
int

public void setColor (int color)

Sets the color to render the TextSymbol with. The color is a 32bit value containing alpha as well as RGB. This 32bit value is not pre-multiplied, meaning that its alpha can be any value, regardless of the values of RGB. See the Color class for more details.

Parameters
color int: the color in RGB color value.

public TextSymbol setFontDecoration (FontDecoration fontDecoration)

Sets the font decoration of the symbol.

Parameters
fontDecoration FontDecoration: the font decoration to set.
Returns
TextSymbol

public TextSymbol setFontFamily (String fontFamily)

Sets the font family of the symbol.

Parameters
fontFamily String: the font family to set.
Returns
TextSymbol

public TextSymbol setFontStyle (FontStyle fontStyle)

Sets the font style of the symbol.

Parameters
fontStyle FontStyle: the font style to set
Returns
TextSymbol

public TextSymbol setFontWeight (FontWeight fontWeight)

Sets the font weight of the symbol.

Parameters
fontWeight FontWeight: the font weight to set.
Returns
TextSymbol

public TextSymbol setHorizontalAlignment (TextSymbol.HorizontalAlignment horizontalAlignment)

Sets the horizontal alignment of the symbol.

Parameters
horizontalAlignment TextSymbol.HorizontalAlignment: the horizontal alignment to set.
Returns
TextSymbol

public TextSymbol setSize (float size)

Sets the font size.

Parameters
size float: the size in pixels.
Returns
TextSymbol

public TextSymbol setText (String text)

Sets the text content of the symbol.

Parameters
text String: the text string.
Returns
TextSymbol

public TextSymbol setVerticalAlignment (TextSymbol.VerticalAlignment verticalAlignment)

Sets the vertical alignment of the TextSymbol.

Parameters
verticalAlignment TextSymbol.VerticalAlignment: The vertical alignment to set.
Returns
TextSymbol

public String toJson ()

Returns
String
Throws
Exception