com.esri.core.symbol
Class TextSymbol

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

public class TextSymbol
extends Object
implements PaintSymbol

Used to display text at points on the graphics layer.

See Also:
Serialized Form

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.
 
Method Summary
 boolean equals(Object obj)
           
 android.graphics.Paint.Align getAlign()
          Returns the Align value for drawing text.
 int getColor()
          Returns the color of the TextSymbol.
 float getOffsetX()
          The TextSymbol adheres to a point feature.
 float getOffsetY()
          The TextSymbol adheres to a point feature.
 float getSize()
          Returns the font size in pixels.
 String getText()
          Returns the text content of the symbol.
 int hashCode()
           
 void setAlign(android.graphics.Paint.Align align)
          Sets the Align value for drawing text.
 void setColor(int color)
          Sets the color to render the TextSymbol with.
 void setOffsetX(float offsetX)
          The TextSymbol adheres to a point feature.
 void setOffsetY(float offsetY)
          The TextSymbol adheres to a point feature.
 void setSize(float size)
          Sets the font size.
 void setText(String text)
          Sets the text content of the symbol.
 String toJson()
          Converts the symbol to a Json String.
 android.graphics.Paint toPaint(android.graphics.Paint p)
          Returns the symbol as a Paint object.
 
Methods inherited from class java.lang.Object
clone, finalize, 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.
Method Detail

getOffsetX

public float getOffsetX()
The TextSymbol adheres to a point feature. The offset specifies the distance between the point and the symbol anchor point in pixels.

Returns:
the offset along the x-axis in pixels.

setOffsetX

public void setOffsetX(float offsetX)
The TextSymbol adheres to a point feature. The offset specifies the distance between the point and the symbol anchor point in pixels.

Parameters:
offsetX - the offset along x-axis in pixels.

getOffsetY

public float getOffsetY()
The TextSymbol adheres to a point feature. The offset specifies the distance between the point and the symbol anchor point in pixels.

Returns:
the offset along y-axis in pixels.

setOffsetY

public void setOffsetY(float offsetY)
The TextSymbol adheres to a point feature. The offset specifies the distance between the point and the symbol anchor point in pixels.

Parameters:
offsetY - the offset along y-axis in pixels.

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.

getAlign

public android.graphics.Paint.Align getAlign()
Returns the Align value for drawing text. This controls how the text is positioned relative to its origin. LEFT align means that all of the text will be drawn to the right of its origin (i.e. the origin specifieds the LEFT edge of the text) and so on.

Returns:
the paint's Align value for drawing text.

setAlign

public void setAlign(android.graphics.Paint.Align align)
Sets the Align value for drawing text. This controls how the text is positioned relative to its origin. LEFT align means that all of the text will be drawn to the right of its origin (i.e. the origin specifieds the LEFT edge of the text) and so on.

Parameters:
align - the Align value for drawing text.

toPaint

public android.graphics.Paint toPaint(android.graphics.Paint p)
Description copied from interface: PaintSymbol
Returns the symbol as a Paint object.

Specified by:
toPaint in interface PaintSymbol
Parameters:
p - override the given paint object instead of create a new paint object.
Returns:
the symbol as a paint object.

toJson

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

Specified by:
toJson in interface Symbol
Throws:
Exception

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2010. All Rights Reserved.