com.mapquest
Class Center

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.MapCommand
          extended bycom.mapquest.Center
All Implemented Interfaces:
java.lang.Cloneable

public class Center
extends MapCommand

Centers a map based on a mouse click. The new center point is calculated in pixels and stored in the X and Y coordinates of this object.

See Also:
Point

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
Center()
          Default constructor.
Center(Center copy)
          Copy constructor.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 Point getCenter()
          Returns the Center point of this object.
 int getClassId()
          Returns the numeric id of this class.
 java.lang.String getClassName()
          Returns the text name of this class.
 int hashCode()
          Returns a hash code for this Center.
 void init()
          Initializes object.
 void setCenter(Point c)
          Sets this Center point equal to the value passed in as a parameter.
 
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

Center

public Center()
Default constructor.


Center

public Center(Center copy)
Copy constructor.

Parameters:
copy - The Center object that this Center object is to be set to.
Method Detail

init

public void init()
Initializes object.

Overrides:
init in class MapCommand

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.

getCenter

public Point getCenter()
Returns the Center point of this object.

Returns:
The Center point of this object.

setCenter

public void setCenter(Point c)
Sets this Center point equal to the value passed in as a parameter.

Parameters:
c - The Center point to which this object is to be set.

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

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

hashCode

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

Overrides:
hashCode in class MQObject
Returns:
a hash code value for this Center.