com.mapquest
Class RectanglePrimitive

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.Primitive
          extended bycom.mapquest.RectanglePrimitive
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
EllipsePrimitive

public class RectanglePrimitive
extends Primitive

Describes rectangular annotations to be placed on the map. The rectangle is initially located by the Upper Left and Lower Right coordinates. The coordinates are then converted into latitude/longitude points so the rectangle can be placed in the same geographical location after the map is manipulated.

See Also:
ColorStyle, FillStyle, LatLng, Point, PenStyle

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
 
Constructor Summary
RectanglePrimitive()
          Default constructor.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 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.
 ColorStyle getFillColor()
          Get ColorStyle to fill this polygon with.
 FillStyle getFillStyle()
          Get fill style of the primitive
 LatLng getLowerRightLatLng()
          Retrieves the LatLng of the Lower Right corner of this rectangle.
 Point getLowerRightPoint()
          Retrieves the Lower Right corner of this rectangle.
 PenStyle getStyle()
          Returns the value currently assigned to member data representing the style of this object.
 LatLng getUpperLeftLatLng()
          Retrieves the LatLng of the Upper Left corner of this rectangle.
 Point getUpperLeftPoint()
          Retrieves the Upper Left corner of this rectangle.
 int getWidth()
          Returns the width (in 1000th of an inch) of the outline.
 int hashCode()
          Returns a hash code for this RectanglePrimitive.
 void init()
          Initializes object.
 void setColor(ColorStyle lColor)
          Sets the color.
 void setFillColor(ColorStyle lColor)
          Set the ColorStyle to fill this polygon with.
 void setFillStyle(FillStyle nStyle)
          Set fill style of the primitive
 void setLowerRightLatLng(LatLng ll)
          Sets the values of the Lower Right LatLng field.
 void setLowerRightPoint(Point pnt)
          Sets the values of the Lower Right corner of this rectangle.
 void setStyle(PenStyle nStyle)
          Sets the value of m_nStyle, which specifies the style of this object.
 void setUpperLeftLatLng(LatLng ll)
          Sets the values of the Upper Left lat/long field.
 void setUpperLeftPoint(Point pnt)
          Sets the values of the Upper Left corner of this rectangle.
 void setWidth(int sWidth)
          Sets the width (in 1000th of an inch) of the outline.
 java.lang.String toString()
          Returns a string built from the class name and contents of this object.
 
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
 
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

RectanglePrimitive

public RectanglePrimitive()
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(PenStyle nStyle)
Sets the value of m_nStyle, which specifies the style of this object.

Parameters:
nStyle - The new style value.

getStyle

public PenStyle 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 (in 1000th of an inch) of the outline.

Parameters:
sWidth - The width of the outline.

getWidth

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

Returns:
m_width The width of the outline.

setUpperLeftPoint

public void setUpperLeftPoint(Point pnt)
Sets the values of the Upper Left corner of this rectangle.

Parameters:
pnt - The point of the Upper Left corner.

setLowerRightPoint

public void setLowerRightPoint(Point pnt)
Sets the values of the Lower Right corner of this rectangle.

Parameters:
pnt - The point of the Lower Right corner.

getUpperLeftPoint

public Point getUpperLeftPoint()
Retrieves the Upper Left corner of this rectangle.

Returns:
The Upper Left corner of this rectangle.

getLowerRightPoint

public Point getLowerRightPoint()
Retrieves the Lower Right corner of this rectangle.

Returns:
The Lower Right corner of this rectangle.

setUpperLeftLatLng

public void setUpperLeftLatLng(LatLng ll)
Sets the values of the Upper Left lat/long field.

Parameters:
ll - The LatLng of the Upper Left coordinate.

setLowerRightLatLng

public void setLowerRightLatLng(LatLng ll)
Sets the values of the Lower Right LatLng field.

Parameters:
ll - The LatLng of the Lower Right coordinate.

getUpperLeftLatLng

public LatLng getUpperLeftLatLng()
Retrieves the LatLng of the Upper Left corner of this rectangle.

Returns:
The LatLng of the Upper Left coordinate.

getLowerRightLatLng

public LatLng getLowerRightLatLng()
Retrieves the LatLng of the Lower Right corner of this rectangle.

Returns:
The LatLng of the Lower Right coordinate.

setFillColor

public void setFillColor(ColorStyle lColor)
Set the ColorStyle to fill this polygon with.

Parameters:
lColor - a ColorStyle formatted color

getFillColor

public ColorStyle getFillColor()
Get ColorStyle to fill this polygon with.

Returns:
The ColorStyle value.

setFillStyle

public void setFillStyle(FillStyle nStyle)
Set fill style of the primitive

Parameters:
nStyle - The fill style

getFillStyle

public FillStyle getFillStyle()
Get fill style of the primitive

Returns:
The fill style.

toString

public java.lang.String toString()
Returns a string built from the class name and contents of this object.

Overrides:
toString in class MQObject
Returns:
A new String object that represents the class name and the contents of this object.

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 RectanglePrimitive object that has same attributes as this object.

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

hashCode

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

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