com.mapquest
Class TextPrimitive

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.Primitive
          extended bycom.mapquest.TextPrimitive
All Implemented Interfaces:
java.lang.Cloneable, TextAlignment

public class TextPrimitive
extends Primitive
implements TextAlignment

Describes text to be placed on the map. The text is initially located by the X/Y coordinate. The coordinate is converted into a latitude/longitude point so the annotation can be placed in the same geographical location after the map is manipulated.

See Also:
Primitive, ColorStyle, FontStyle, LatLng, Point, TextAlignment

Field Summary
static int CLASS_ID
           
static java.lang.String CLASS_NAME
           
 
Fields inherited from class com.mapquest.MQObject
DEFAULT_ID, DEFAULT_NAME, DEFAULT_VERSION, FORMAT_NUMERIC_ID, FORMAT_TEXT_NAME, INVALID_ID, INVALID_NAME, INVALID_VERSION
 
Fields inherited from interface com.mapquest.TextAlignment
Baseline, BASELINE, Bottom, BOTTOM, Center, CENTER, Left, LEFT, Right, RIGHT, Top, TOP
 
Constructor Summary
TextPrimitive()
          Default constructor.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 ColorStyle getBkgdColor()
          Returns the background color of the text box
 ColorStyle getBoxOutlineColor()
          Get RGB Outline Box Color
 int getClassId()
          Returns the numeric id of this class.
 java.lang.String getClassName()
          Returns the text name of this class.
 ColorStyle getColor()
          Returns the value of m_color.
 java.lang.String getFontName()
          Get Font Name
 int getFontSize()
          Get the font size.
 long getMargin()
          Get the margin of the Box surrounding the text.
 ColorStyle getOutlineColor()
          Get RGB Outline Color
 FontStyle getStyle()
          Returns the value currently assigned to member data representing the style of this object.
 java.lang.String getText()
          Returns the text that is displayed
 int getTextAlignment()
          Get the Text Alignment.
 LatLng getUpperLeftLatLng()
          Gets the LatLng coordinate of the upper left corner.
 Point getUpperLeftPoint()
          Gets the value of the upper left corner of the text.
 int getWidth()
          Returns the width of the outline of the text box.( in 1000th of an inch)
 int hashCode()
          Returns a hash code for this TextPrimitive.
 void init()
          Initializes object.
 void setBkgdColor(ColorStyle rgbVal)
          Sets the background color of the text box
 void setBoxOutlineColor(ColorStyle lVal)
          Set RGB Outline Box Color
 void setColor(ColorStyle lColor)
          Sets the color.
 void setFontName(java.lang.String strVal)
          Set Font Name
 void setFontSize(int nVal)
          Set font Size.
 void setMargin(long lVal)
          Set the margin of the Box surrounding the text.
 void setOutlineColor(ColorStyle lVal)
          Set RGB Outline Color
 void setStyle(FontStyle nStyle)
          Sets the value of m_nStyle, which specifies the style of this object.
 void setText(java.lang.String sText)
          Sets the text value to be displayed
 void setTextAlignment(int lVal)
          Set the Text Alignment.
 void setUpperLeftLatLng(LatLng ll)
          Sets the LatLng coordinate of the upper left corner.
 void setUpperLeftPoint(Point pnt)
          Sets the value of the upper left corner of the text.
 void setWidth(int sWidth)
          Sets the width of the outline of the text box.( in 1000th of an inch)
 
Methods inherited from class com.mapquest.Primitive
getCoordinateType, getDrawTrigger, getKey, getOpacity, getTriggerDT, setCoordinateType, setDrawTrigger, setKey, setOpacity, setTriggerDT
 
Methods inherited from class com.mapquest.MQObject
clone, getFormat, getIdWithVersion, getNameWithVersion, getObjectVersion, getTypeId, getTypeName, getVerboseConsoleOutput, setFormat, setObjectVersion, setVerboseConsoleOutput, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ID

public static final int CLASS_ID
See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

TextPrimitive

public TextPrimitive()
Default constructor.

Method Detail

init

public void init()
Initializes object.

Overrides:
init in class Primitive

getClassId

public int getClassId()
Returns the numeric id of this class.

Overrides:
getClassId in class MQObject
Returns:
the numeric id of this class.

getClassName

public java.lang.String getClassName()
Returns the text name of this class.

Overrides:
getClassName in class MQObject
Returns:
the text name of this class.

setColor

public void setColor(ColorStyle lColor)
Sets the color.

Parameters:
lColor - The new color to be assigned to m_color

getColor

public ColorStyle getColor()
Returns the value of m_color.

Returns:
The current value for the color of this object

setStyle

public void setStyle(FontStyle nStyle)
Sets the value of m_nStyle, which specifies the style of this object.

Parameters:
nStyle - The new style value.

getStyle

public FontStyle getStyle()
Returns the value currently assigned to member data representing the style of this object.

Returns:
The value currently assigned to the member data representing the style of this object.

setWidth

public void setWidth(int sWidth)
Sets the width of the outline of the text box.( in 1000th of an inch)

Parameters:
sWidth - The width of the text box.

getWidth

public int getWidth()
Returns the width of the outline of the text box.( in 1000th of an inch)

Returns:
m_width The width of the textbox.

setUpperLeftPoint

public void setUpperLeftPoint(Point pnt)
Sets the value of the upper left corner of the text.

Parameters:
pnt - The coordinate of the upper left corner.

getUpperLeftPoint

public Point getUpperLeftPoint()
Gets the value of the upper left corner of the text.

Returns:
The coordinate of the upper left corner.

setUpperLeftLatLng

public void setUpperLeftLatLng(LatLng ll)
Sets the LatLng coordinate of the upper left corner.

Parameters:
ll - The LatLng of the upper left corner.

getUpperLeftLatLng

public LatLng getUpperLeftLatLng()
Gets the LatLng coordinate of the upper left corner.

Returns:
The LatLng of the upper left corner.

setBkgdColor

public void setBkgdColor(ColorStyle rgbVal)
Sets the background color of the text box

Parameters:
rgbVal - A long value representing the RGB value.

getBkgdColor

public ColorStyle getBkgdColor()
Returns the background color of the text box

Returns:
m_bgdColor The long value representing the background RGB.

setText

public void setText(java.lang.String sText)
Sets the text value to be displayed

Parameters:
sText - A String containing the desired text

getText

public java.lang.String getText()
Returns the text that is displayed

Returns:
m_sText A String containing the desired text

setBoxOutlineColor

public void setBoxOutlineColor(ColorStyle lVal)
Set RGB Outline Box Color

Parameters:
lVal - RGB Outline Box Color

getBoxOutlineColor

public ColorStyle getBoxOutlineColor()
Get RGB Outline Box Color

Returns:
RGB Outline Box Color

setOutlineColor

public void setOutlineColor(ColorStyle lVal)
Set RGB Outline Color

Parameters:
lVal - RGB Outline Color

getOutlineColor

public ColorStyle getOutlineColor()
Get RGB Outline Color

Returns:
RGB Outline Color

setFontName

public void setFontName(java.lang.String strVal)
Set Font Name

Parameters:
strVal - Font Name

getFontName

public java.lang.String getFontName()
Get Font Name

Returns:
Font Name

setFontSize

public void setFontSize(int nVal)
Set font Size.

Parameters:
nVal - new font size

getFontSize

public int getFontSize()
Get the font size.

Returns:
the Font size.

setMargin

public void setMargin(long lVal)
Set the margin of the Box surrounding the text.

Parameters:
lVal - new margin

getMargin

public long getMargin()
Get the margin of the Box surrounding the text.

Returns:
the margin.

setTextAlignment

public void setTextAlignment(int lVal)
Set the Text Alignment. How text emanates from the center point.

Parameters:
lVal - new Text Alignment

getTextAlignment

public int getTextAlignment()
Get the Text Alignment. How text emanates from the center point.

Returns:
the Text Alignment

equals

public boolean equals(java.lang.Object otherObject)
Compares this object to the specified object. The result is true if and only if the argument is not null and is a TextPrimitive object that has same attributes as this object.

Overrides:
equals in class Primitive
Parameters:
otherObject - the object to compare this TextPrimitive against.
Returns:
true if the TextPrimitive objects are equal; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this TextPrimitive.

Overrides:
hashCode in class Primitive
Returns:
a hash code value for this TextPrimitive.