com.esri.core.symbol
Class TextSymbol

java.lang.Object
  extended by com.esri.core.symbol.MarkerSymbol
      extended by com.esri.core.symbol.TextSymbol
All Implemented Interfaces:
Symbol, Serializable

public class TextSymbol
extends MarkerSymbol

Used to display text at points on the graphics layer.

See Also:
Serialized Form

Nested Class Summary
static class TextSymbol.HorizontalAlignment
           
static class TextSymbol.VerticalAlignment
           
 
Field Summary
static String TYPE
           
 
Constructor Summary
TextSymbol(float size, String text, int color)
          Instantiates an object of TextSymbol in the specified size and color.
TextSymbol(org.codehaus.jackson.JsonNode node)
          Instantiates an object of TextSymbol from a JsonNode.
TextSymbol(TextSymbol textSymbol)
           
 
Method Summary
 Symbol copy()
          Gets a copy of this Symbol object.
 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()
          Converts the symbol to a Json String.
 
Methods inherited from class com.esri.core.symbol.MarkerSymbol
getAngle, getHeight, getOffsetX, getOffsetY, getWidth, setAngle, setOffsetX, setOffsetY
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values
Constructor Detail

TextSymbol

public TextSymbol(org.codehaus.jackson.JsonNode node)
Instantiates an object of TextSymbol from a JsonNode.

Parameters:
node - the text symbol node.

TextSymbol

public TextSymbol(float size,
                  String text,
                  int color)
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.

TextSymbol

public TextSymbol(TextSymbol textSymbol)
Method Detail

getText

public String getText()
Returns the text content of the symbol.


setText

public void setText(String text)
Sets the text content of the symbol.

Parameters:
text - the text string.

getColor

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.

setColor

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.

getSize

public float getSize()
Returns the font size in pixels.

Returns:
the font size in pixels.

setSize

public void setSize(float size)
Sets the font size.

Parameters:
size - the size in pixels.

toJson

public String toJson()
              throws Exception
Description copied from interface: Symbol
Converts the symbol to a Json String.

Throws:
Exception

copy

public Symbol copy()
            throws Exception
Description copied from interface: Symbol
Gets a copy of this Symbol object.

Returns:
Symbol object
Throws:
Exception

getHorizontalAlignment

public TextSymbol.HorizontalAlignment getHorizontalAlignment()
Gets the horizontalAlignment of the TextSymbol.

Returns:
Returns the horizontalAlignment.

setHorizontalAlignment

public void setHorizontalAlignment(TextSymbol.HorizontalAlignment horizontalAlignment)
Sets the horizontalAlignment of the TextSymbol.

Parameters:
horizontalAlignment - The horizontalAlignment to set.

getVerticalAlignment

public TextSymbol.VerticalAlignment getVerticalAlignment()
Gets the verticalAlignment of the TextSymbol.

Returns:
Returns the verticalAlignment.

setVerticalAlignment

public void setVerticalAlignment(TextSymbol.VerticalAlignment verticalAlignment)
Sets the verticalAlignment of the TextSymbol.

Parameters:
verticalAlignment - The verticalAlignment to set.

hashCode

public int hashCode()
Overrides:
hashCode in class MarkerSymbol

equals

public boolean equals(Object obj)
Overrides:
equals in class MarkerSymbol


Copyright © 2012. All Rights Reserved.