|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.adf.web.data.geometry.WebGeometry
com.esri.adf.web.data.geometry.WebExtent
public class WebExtent
WebExtent
is a class used for representing rectangular extent of a map.
Field Summary |
---|
Fields inherited from class com.esri.adf.web.data.geometry.WebGeometry |
---|
spatialReference |
Constructor Summary | |
---|---|
WebExtent()
Creates an empty WebExtent. |
|
WebExtent(double minX,
double minY,
double maxX,
double maxY)
Constructs a WebExtent instance. |
|
WebExtent(double minX,
double minY,
double maxX,
double maxY,
WebSpatialReference spatialReference)
Constructs a WebExtent instance. |
|
WebExtent(WebExtent copy)
Constructs a WebExtent that is a copy of a given WebExtent. |
|
WebExtent(WebPoint lowerLeft,
WebPoint upperRight)
Constructs a WebExtent using it's lower left and upper right points. |
Method Summary | |
---|---|
void |
centerAt(WebPoint mapPoint)
Re-centers this WebExtent to the argument point, while maintaining original width & height of WebExtent. |
boolean |
contains(WebPoint mapPoint)
Checks whether WebExtent contains the given point. |
boolean |
equals(Object obj)
|
boolean |
equals(WebExtent compareTo,
double toleranceRatio)
Compares two WebExtents for equality. |
void |
expand(double factor)
Expands this WebExtent by the factor. |
WebExtent |
fromMapGeometry(WebExtent extent,
int width,
int height)
Converts a geometry in map coordinates to a geometry of the same type in screen coordinates. |
WebExtent |
fromMapGeometry(WebMap webMap)
Converts a geometry in map coordinates to a geometry of the same type in screen coordinates. |
String |
getGeometryType()
Returns a text representing the type of the geometry. |
double |
getHeight()
Returns the height of WebExtent. |
double |
getMaxX()
Returns the largest X coordinate of WebExtent. |
double |
getMaxY()
Returns the largest Y coordinate of WebExtent. |
double |
getMinX()
Returns the smallest X coordinate of WebExtent. |
double |
getMinY()
Returns the smallest Y coordinate of WebExtent. |
double |
getWidth()
Returns the width of WebExtent. |
int |
hashCode()
|
WebExtent |
project(WebSpatialReference toSpatialReference)
Converts the WebExtent in map coordinates from it's spatialReference to the desired
spatial reference. |
void |
putCoords(double lMinX,
double lMinY,
double lMaxX,
double lMaxY)
Sets the coordinates for the lower left and the upper right corners of WebExtent. |
void |
setMaxX(double maxX)
Sets the largest X coordinate of WebExtent. |
void |
setMaxY(double maxY)
Sets the largest Y coordinate of WebExtent. |
void |
setMinX(double minX)
Sets the smallest X coordinate of WebExtent. |
void |
setMinY(double minY)
Sets the smallest Y coordinate of WebExtent. |
WebExtent |
toMapGeometry(WebExtent extent,
int width,
int height)
Converts a geometry in screen coordinates to a geometry of the same type in map coordinates. |
WebExtent |
toMapGeometry(WebMap webMap)
Converts a geometry in screen coordinates to a geometry of the same type in map coordinates. |
String |
toString()
|
Methods inherited from class com.esri.adf.web.data.geometry.WebGeometry |
---|
getSpatialReference, setSpatialReference |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WebExtent(double minX, double minY, double maxX, double maxY, WebSpatialReference spatialReference)
minX
- the X coordinate of the WebExtent lower-left cornerminY
- the Y coordinate of the WebExtent lower-left cornermaxX
- the maximum X coordinate of the WebExtent upper-right cornermaxY
- the maximum Y coordinate of WebExtent upper-right cornerspatialReference
- spatial reference of WebExtentpublic WebExtent(double minX, double minY, double maxX, double maxY)
minX
- the X coordinate of the WebExtent lower-left cornerminY
- the Y coordinate of the WebExtent lower-left cornermaxX
- the maximum X coordinate of the WebExtent upper-right cornermaxY
- the maximum Y coordinate of WebExtent upper-right cornerpublic WebExtent(WebExtent copy)
copy
- a WebExtent to be cloned.public WebExtent(WebPoint lowerLeft, WebPoint upperRight)
lowerLeft
- a point defining WebExtent's lower left cornerupperRight
- a point defining WebExtent's uper right cornerpublic WebExtent()
Method Detail |
---|
public void putCoords(double lMinX, double lMinY, double lMaxX, double lMaxY)
lMinX
- lower left corner X coordinatelMinY
- lower left corner Y coordinatelMaxX
- upper right corner X coordinatelMaxY
- upper right corner Y coordinatepublic double getMaxY()
public double getMaxX()
public double getMinY()
public void setMinX(double minX)
minX
- the smallest X coordinate of WebExtentpublic void setMaxY(double maxY)
maxY
- the largest Y coordinate of WebExtentpublic void setMaxX(double maxX)
maxX
- the largest X coordinate of WebExtentpublic void setMinY(double minY)
minY
- the smallest Y coordinate of WebExtentpublic double getMinX()
public double getWidth()
public double getHeight()
public boolean equals(WebExtent compareTo, double toleranceRatio)
compareTo
- a WebExtent to compare this one totoleranceRatio
- a tolerance ratio. If the difference between coordinates is less than tolerance ratio,
coordinates are considered to be equal.
public boolean contains(WebPoint mapPoint)
mapPoint
- point to use in the check
public void expand(double factor)
factor
- a value used to expand the WebExtentpublic void centerAt(WebPoint mapPoint)
mapPoint
- new center point of extentpublic WebExtent fromMapGeometry(WebMap webMap)
WebGeometry
Converts a geometry in map coordinates to a geometry of the same type in screen coordinates. Since the converted
geometry is a screen geometry, the coordinate system of the converted geometry will be null
.
fromMapGeometry
in class WebGeometry
webMap
- The WebMap
based on which the coordinates need to be converted
WebGeometry
in screen coordinatespublic WebExtent fromMapGeometry(WebExtent extent, int width, int height)
WebGeometry
Converts a geometry in map coordinates to a geometry of the same type in screen coordinates. Since the converted
geometry is a screen geometry, the coordinate system of the converted geometry will be null
.
fromMapGeometry
in class WebGeometry
extent
- the WebExtent
of the map imagewidth
- the width of the map imageheight
- the height of the map image
WebGeometry
in screen coordinatespublic WebExtent toMapGeometry(WebMap webMap)
WebGeometry
Converts a geometry in screen coordinates to a geometry of the same type in map coordinates. The coordinate system
of the converted geometry is the same as the coordinate system of the WebMap
.
toMapGeometry
in class WebGeometry
webMap
- The WebMap
based on which the coordinates need to be converted
WebGeometry
in map coordinatespublic WebExtent toMapGeometry(WebExtent extent, int width, int height)
WebGeometry
Converts a geometry in screen coordinates to a geometry of the same type in map coordinates. The coordinate system of the converted geometry is the same as the coordinate system of the specified extent.
toMapGeometry
in class WebGeometry
extent
- the WebExtent
of the map imagewidth
- the width of the map imageheight
- the height of the map image
WebGeometry
in map coordinatespublic String getGeometryType()
WebGeometry
Returns a text representing the type of the geometry. WebGeometry
objects of the same type must return
the same text.
getGeometryType
in class WebGeometry
public String toString()
toString
in class Object
public WebExtent project(WebSpatialReference toSpatialReference)
Converts the WebExtent
in map coordinates from it's spatialReference
to the desired
spatial reference. If the desired spatial reference is same as the current one, this same object is returned.
Otherwise, a new WebExtent
object is created and populated with the converted coordinates. The
coordinates are computed such that the extent falls within the horizon of the desired spatial reference.
project
in class WebGeometry
toSpatialReference
- the desired spatial reference of the projected geometry
WebExtent
public int hashCode()
hashCode
in class WebGeometry
public boolean equals(Object obj)
equals
in class WebGeometry
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |