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(float size, String text, int color, TextSymbol.HorizontalAlignment halign, TextSymbol.VerticalAlignment valign)
Instantiates an object of TextSymbol in the specified size and color.
TextSymbol(float size, String text, int color)
Instantiates an object of TextSymbol in the specified size and color.
TextSymbol(TextSymbol textSymbol)
The Constructor.
Public Methods
Symbol copy()
boolean equals(Object obj)
int getColor()
Returns the color of the TextSymbol.
TextSymbol.HorizontalAlignment getHorizontalAlignment()
Gets the horizontalAlignment of the TextSymbol.
float getSize()
Returns the font size in pixels.
String getText()
Returns the text content of the symbol.
TextSymbol.VerticalAlignment getVerticalAlignment()
Gets the verticalAlignment of the TextSymbol.
int hashCode()
void setColor(int color)
Sets the color to render the TextSymbol with.
void setHorizontalAlignment(TextSymbol.HorizontalAlignment horizontalAlignment)
Sets the horizontalAlignment of the TextSymbol.
void setSize(float size)
Sets the font size.
void setText(String text)
Sets the text content of the symbol.
void setVerticalAlignment(TextSymbol.VerticalAlignment verticalAlignment)
Sets the verticalAlignment 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 the text symbol node.

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

Instantiates an object of TextSymbol in the specified size and color.

Parameters
size the size of the font.
text the text content.
color the color of the text.
halign HorizontalAlignment
valign VerticalAlignment

public TextSymbol (float 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 the size of the font.
text the text content.
color the color of the text.

public TextSymbol (TextSymbol textSymbol)

The Constructor.

Parameters
textSymbol the text symbol

Public Methods

public Symbol copy ()

Throws
Exception

public boolean equals (Object obj)

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
  • the color in RGB color value.

public TextSymbol.HorizontalAlignment getHorizontalAlignment ()

Gets the horizontalAlignment of the TextSymbol.

Returns
  • Returns the horizontalAlignment.

public float getSize ()

Returns the font size in pixels.

Returns
  • the font size in pixels.

public String getText ()

Returns the text content of the symbol.

Returns
  • the text

public TextSymbol.VerticalAlignment getVerticalAlignment ()

Gets the verticalAlignment of the TextSymbol.

Returns
  • Returns the verticalAlignment.

public int hashCode ()

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 the color in RGB color value.

public void setHorizontalAlignment (TextSymbol.HorizontalAlignment horizontalAlignment)

Sets the horizontalAlignment of the TextSymbol.

Parameters
horizontalAlignment The horizontalAlignment to set.

public void setSize (float size)

Sets the font size.

Parameters
size the size in pixels.

public void setText (String text)

Sets the text content of the symbol.

Parameters
text the text string.

public void setVerticalAlignment (TextSymbol.VerticalAlignment verticalAlignment)

Sets the verticalAlignment of the TextSymbol.

Parameters
verticalAlignment The verticalAlignment to set.

public String toJson ()

Throws
Exception