com.esri.wms.client
Class Envelope

java.lang.Object
  extended by com.esri.wms.client.Envelope
All Implemented Interfaces:
Serializable

public class Envelope
extends Object
implements Serializable

Defines an Envelope object used for setting extents of maps or layers.


 Envelope bounds = new Envelope();
 bounds.setMinX(-71.63);
 bounds.setMinY(41.75);
 bounds.setMaxX(-70.78);
 bounds.setMaxY(42.90);
 bounds.setSpatialReference(SpatialReference.EPSG4326);
 

See Also:
Serialized Form

Constructor Summary
Envelope()
           
 
Method Summary
 boolean equals(Object obj)
          Compares the specified object with this instance for equality.
 Point getCenterPoint()
          Gets the center point of the envelope.
 Envelope getCopy()
          Gets a copy of the current instance.
 double getHeight()
          Returns the height of the envelope object.
 double getMaxX()
          Returns the maximum x coordinate value of the envelope object.
 double getMaxY()
          Returns the maximum y coordinate value of the envelope object.
 double getMinX()
          Returns the minimum x coordinate value of the envelope objects.
 double getMinY()
          Returns the minimum y coordinate value of the envelope objects.
 SpatialReference getSpatialReference()
          Gets the spatial reference of the envelope.
 double getWidth()
          Returns the width of the envelope object.
 int hashCode()
          Returns the hash code of the request object.
 boolean isEmpty()
          Indicates whether this geometry contains any points.
 void reaspect(double width, double height)
          Adjusts the current envelope based on the aspect ratio of the given width and height.
 void setMaxX(double maxX)
          Sets the maximum x coordinate value of the envelope objects.
 void setMaxY(double maxY)
          Sets the maximum y coordinate value of the envelope objects.
 void setMinX(double minX)
          Sets the minimum x coordinate value of the envelope objects.
 void setMinY(double minY)
          Sets the minimum y coordinate value of the envelope objects.
 void setSpatialReference(SpatialReference spatialReference)
          Sets the spatial reference of the envelope.
 void swapAxis()
          Swaps the x y axis of the envelope.
 String toBBoxString(String version)
          Represents the envelope as a WMS BoundingBox string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Envelope

public Envelope()
Method Detail

getCopy

public Envelope getCopy()
Gets a copy of the current instance.

Returns:
the copy of this instance.

isEmpty

public boolean isEmpty()
Indicates whether this geometry contains any points.

Returns:
true if the envelope is valid.

setMinX

public void setMinX(double minX)
Sets the minimum x coordinate value of the envelope objects.

Parameters:
minX - is the minimum x value.
See Also:
getMinX()

setMinY

public void setMinY(double minY)
Sets the minimum y coordinate value of the envelope objects.

Parameters:
minY - is the minimum y value.
See Also:
getMinY()

setMaxX

public void setMaxX(double maxX)
Sets the maximum x coordinate value of the envelope objects.

Parameters:
maxX - is the maximum x value.
See Also:
getMaxX()

setMaxY

public void setMaxY(double maxY)
Sets the maximum y coordinate value of the envelope objects.

Parameters:
maxY - is the maximum y value.
See Also:
getMaxY()

getMinX

public double getMinX()
Returns the minimum x coordinate value of the envelope objects.

Returns:
double
See Also:
setMinX(double)

getMinY

public double getMinY()
Returns the minimum y coordinate value of the envelope objects.

Returns:
double
See Also:
setMinY(double)

getMaxX

public double getMaxX()
Returns the maximum x coordinate value of the envelope object.

Returns:
double
See Also:
setMaxX(double)

getMaxY

public double getMaxY()
Returns the maximum y coordinate value of the envelope object.

Returns:
double
See Also:
setMaxY(double)

getWidth

public double getWidth()
Returns the width of the envelope object. The Width of an Envelope is the horizontal span. The Width = XMax - XMin. Used to get or set the Width of a non-empty Envelope.

Returns:
the width in the unit of the envelope's spatial reference system.

getHeight

public double getHeight()
Returns the height of the envelope object. The Height of an Envelope is the vertical span. The Height = YMax - YMin. Used to get or set the Height of a non-empty Envelope.

Returns:
the height in the unit of the envelope's spatial reference system.

getSpatialReference

public SpatialReference getSpatialReference()
Gets the spatial reference of the envelope. Returns and sets the spatial reference in which the geometry exists. If the spatial reference has not been set the property will return null instance.

Returns:
Returns the spatialReference.

setSpatialReference

public void setSpatialReference(SpatialReference spatialReference)
Sets the spatial reference of the envelope.

Parameters:
spatialReference - The spatialReference to set.

getCenterPoint

public Point getCenterPoint()
Gets the center point of the envelope. The Center Point occurs at: ((XMin + XMax) / 2, (YMin + YMax) / 2).

Returns:
the center point with spatial reference.

reaspect

public void reaspect(double width,
                     double height)
Adjusts the current envelope based on the aspect ratio of the given width and height.

Parameters:
width -
height -

toBBoxString

public String toBBoxString(String version)
Represents the envelope as a WMS BoundingBox string.

Parameters:
version - the version of WMS service.
Returns:
the string for the given version.

swapAxis

public void swapAxis()
Swaps the x y axis of the envelope.


hashCode

public int hashCode()
Returns the hash code of the request object.

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Compares the specified object with this instance for equality. Returns true if all fields of the two Objects are equal.

Overrides:
equals in class Object
Parameters:
obj - object to be compared for equality with this instance.
Returns:
Returns true if the specified object is equal to this instance.