com.esri.adf.web.data.geometry
Class WebRing

java.lang.Object
  extended by com.esri.adf.web.data.geometry.WebGeometry
      extended by com.esri.adf.web.data.geometry.WebPointCollection
          extended by com.esri.adf.web.data.geometry.WebPath
              extended by com.esri.adf.web.data.geometry.WebRing
All Implemented Interfaces:
Serializable

public class WebRing
extends WebPath

WebRing is a class for representing simple polygons. Note that an instance of WebPolygon holds a list of WebRings. WebRing holds a list of WebPoints. It is recommended that a ring would always be "closed", i.e. that last point in the list would be the same as the first one.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.esri.adf.web.data.geometry.WebPointCollection
points
 
Fields inherited from class com.esri.adf.web.data.geometry.WebGeometry
spatialReference
 
Constructor Summary
WebRing()
          Creates an empty instance of WebRing.
WebRing(List<? extends WebPoint> pnts)
          Create an instance of WebRing with the given list of points.
WebRing(WebSpatialReference spatialReference)
          Creates an empty instance of WebRing with the given spatial reference.
 
Method Summary
 WebPath fromMapGeometry(WebExtent extent, int width, int height)
           Converts a geometry in map coordinates to a geometry of the same type in screen coordinates.
 WebRing 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.
 WebRing project(WebSpatialReference toSpatialReference)
           Converts the geometry in map coordinates from the spatialReference of this geometry to a geometry in the desired spatial reference.
 WebPath toMapGeometry(WebExtent extent, int width, int height)
           Converts a geometry in screen coordinates to a geometry of the same type in map coordinates.
 WebRing toMapGeometry(WebMap webMap)
           Converts a geometry in screen coordinates to a geometry of the same type in map coordinates.
 
Methods inherited from class com.esri.adf.web.data.geometry.WebPointCollection
addPoint, equals, fromMapPoints, fromMapPoints, getPoints, getXs, getYs, hashCode, projectPoints, toMapPoints, toMapPoints, 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

WebRing

public WebRing()
Creates an empty instance of WebRing.


WebRing

public WebRing(WebSpatialReference spatialReference)
Creates an empty instance of WebRing with the given spatial reference.

Parameters:
spatialReference - a spatial reference to be used

WebRing

public WebRing(List<? extends WebPoint> pnts)
Create an instance of WebRing with the given list of points. The provided list of points must contain at least three points otherwise an ADFGeometryException wrapping IllegalArgumentException is thrown.

Parameters:
pnts - list of points to be used by this WebRing
Method Detail

getGeometryType

public String getGeometryType()
Description copied from class: WebGeometry

Returns a text representing the type of the geometry. WebGeometry objects of the same type must return the same text.

Overrides:
getGeometryType in class WebPath
Returns:
a text representing the type of the geometry

toMapGeometry

public WebRing toMapGeometry(WebMap webMap)
Description copied from class: 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.

Overrides:
toMapGeometry in class WebPath
Parameters:
webMap - The WebMap based on which the coordinates need to be converted
Returns:
the WebGeometry in map coordinates

toMapGeometry

public WebPath toMapGeometry(WebExtent extent,
                             int width,
                             int height)
Description copied from class: 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.

Overrides:
toMapGeometry in class WebPath
Parameters:
extent - the WebExtent of the map image
width - the width of the map image
height - the height of the map image
Returns:
the WebGeometry in map coordinates

fromMapGeometry

public WebRing fromMapGeometry(WebMap webMap)
Description copied from class: 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.

Overrides:
fromMapGeometry in class WebPath
Parameters:
webMap - The WebMap based on which the coordinates need to be converted
Returns:
the WebGeometry in screen coordinates

fromMapGeometry

public WebPath fromMapGeometry(WebExtent extent,
                               int width,
                               int height)
Description copied from class: 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.

Overrides:
fromMapGeometry in class WebPath
Parameters:
extent - the WebExtent of the map image
width - the width of the map image
height - the height of the map image
Returns:
the WebGeometry in screen coordinates

project

public WebRing project(WebSpatialReference toSpatialReference)
Description copied from class: WebGeometry

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.

Overrides:
project in class WebPath
Parameters:
toSpatialReference - the desired spatial reference of the projected geometry
Returns:
the projected WebGeometry