|
|||||||||
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
public abstract class WebGeometry
WebGeometry
is an abstract base class for all geometries in the ADF. All web geometries can be used to
represent both screen as well as map geometries. The toMapGeometry(WebMap)
and
fromMapGeometry(WebMap)
methods can be used to convert geometries to and from screen coordinates to map
coordinates. Additionally, the WebGeometry
class declares an abstract
project(WebSpatialReference)
method. This method can be used to convert map geometries from one coordinate
system to another.
Field Summary | |
---|---|
protected WebSpatialReference |
spatialReference
The coordinate system of this geometry. |
Constructor Summary | |
---|---|
WebGeometry()
|
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
WebGeometry |
fromMapGeometry(WebExtent extent,
int width,
int height)
Converts a geometry in map coordinates to a geometry of the same type in screen coordinates. |
abstract WebGeometry |
fromMapGeometry(WebMap webMap)
Converts a geometry in map coordinates to a geometry of the same type in screen coordinates. |
abstract String |
getGeometryType()
Returns a text representing the type of the geometry. |
WebSpatialReference |
getSpatialReference()
Returns the coordinate system of this geometry. |
int |
hashCode()
|
abstract WebGeometry |
project(WebSpatialReference toSpatialReference)
Converts the geometry in map coordinates from the spatialReference of this geometry to a geometry in
the desired spatial reference. |
void |
setSpatialReference(WebSpatialReference spatialReference)
Sets the coordinate system of this geometry. |
WebGeometry |
toMapGeometry(WebExtent extent,
int width,
int height)
Converts a geometry in screen coordinates to a geometry of the same type in map coordinates. |
abstract WebGeometry |
toMapGeometry(WebMap webMap)
Converts a geometry in screen coordinates to a geometry of the same type in map coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected WebSpatialReference spatialReference
spatialReference
is null.
Constructor Detail |
---|
public WebGeometry()
Method Detail |
---|
public abstract String getGeometryType()
Returns a text representing the type of the geometry. WebGeometry
objects of the same type must return
the same text.
public abstract WebGeometry toMapGeometry(WebMap webMap)
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
.
webMap
- The WebMap
based on which the coordinates need to be converted
WebGeometry
in map coordinatespublic WebGeometry toMapGeometry(WebExtent extent, int width, int height)
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.
extent
- the WebExtent
of the map imagewidth
- the width of the map imageheight
- the height of the map image
WebGeometry
in map coordinatespublic abstract WebGeometry fromMapGeometry(WebMap webMap)
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
.
webMap
- The WebMap
based on which the coordinates need to be converted
WebGeometry
in screen coordinatespublic WebGeometry fromMapGeometry(WebExtent extent, int width, int height)
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
.
extent
- the WebExtent
of the map imagewidth
- the width of the map imageheight
- the height of the map image
WebGeometry
in screen coordinatespublic WebSpatialReference getSpatialReference()
Returns the coordinate system of this geometry. When the geometry represents a client-side geometry the
spatialReference
is null.
public void setSpatialReference(WebSpatialReference spatialReference)
Sets the coordinate system of this geometry. When the geometry represents a client-side geometry the
spatialReference
is null.
spatialReference
- the coordinate system of this geometrypublic abstract WebGeometry project(WebSpatialReference toSpatialReference)
Converts the geometry in map coordinates from the spatialReference
of this geometry to a geometry in
the desired spatial reference. If the desired spatial reference is same as that of this geometry, this same
geometry is returned. Otherwise, a new WebGeometry
object is created and populated with the converted
coordinates. The type of the projected geometry is same as this geometry.
toSpatialReference
- the desired spatial reference of the projected geometry
WebGeometry
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |