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

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

public class WebPolyline
extends WebGeometry

WebPolyline is a class for representing polyline's, i.e. complex lines composed of multiple line segments. WebPolyline holds a list of WebPaths.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.esri.adf.web.data.geometry.WebGeometry
spatialReference
 
Constructor Summary
WebPolyline()
          Constructs an empty WebPolyline instance.
WebPolyline(List<WebPath> paths)
          Constructs a WebPolyline instance with the given paths.
WebPolyline(WebSpatialReference spatialReference)
          Constructs an empty WebPolyline instance with a given spatial reference.
 
Method Summary
 void addPath(WebPath path)
          Adds the given WebPath instance to the list of WebPaths of this polyline.
 void addPaths(List<? extends WebPath> webPaths)
          Adds all the WebPaths from the submitted list to the list of WebPaths of this polyline.
 boolean equals(Object obj)
           
 WebPolyline fromMapGeometry(WebExtent extent, int width, int height)
           Converts a geometry in map coordinates to a geometry of the same type in screen coordinates.
 WebPolyline 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.
 WebPath getPath(int index)
          Returns a WebPath with the given index.
 List<WebPath> getPaths()
          Returns a list with WebPaths constituting the polyline.
 int hashCode()
           
 WebPolyline project(WebSpatialReference toSpatialReference)
           Converts the geometry in map coordinates from the spatialReference of this geometry to a geometry in the desired spatial reference.
 WebPolyline toMapGeometry(WebExtent extent, int width, int height)
           Converts a geometry in screen coordinates to a geometry of the same type in map coordinates.
 WebPolyline 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

WebPolyline

public WebPolyline(List<WebPath> paths)
Constructs a WebPolyline instance with the given paths.

Parameters:
paths - WebPaths constituting the polyline

WebPolyline

public WebPolyline(WebSpatialReference spatialReference)
Constructs an empty WebPolyline instance with a given spatial reference.

Parameters:
spatialReference - a spatial reference to be used by the resulting WebPolyline instance

WebPolyline

public WebPolyline()
Constructs an empty WebPolyline instance.

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.

Specified by:
getGeometryType in class WebGeometry
Returns:
a text representing the type of the geometry

getPaths

public List<WebPath> getPaths()
Returns a list with WebPaths constituting the polyline.

Returns:
a list with WebPaths constituting the polyline.

getPath

public WebPath getPath(int index)
Returns a WebPath with the given index.

Parameters:
index - index of the path
Returns:
a WebPath with the given index

addPath

public void addPath(WebPath path)
Adds the given WebPath instance to the list of WebPaths of this polyline.

Parameters:
path - a WebPath to add

addPaths

public void addPaths(List<? extends WebPath> webPaths)
Adds all the WebPaths from the submitted list to the list of WebPaths of this polyline.

Parameters:
webPaths - a list of WebPaths to add

toMapGeometry

public WebPolyline 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.

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

toMapGeometry

public WebPolyline 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 WebGeometry
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 WebPolyline 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.

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

fromMapGeometry

public WebPolyline 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 WebGeometry
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

toString

public String toString()
Overrides:
toString in class Object

project

public WebPolyline 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.

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

hashCode

public int hashCode()
Overrides:
hashCode in class WebGeometry

equals

public boolean equals(Object obj)
Overrides:
equals in class WebGeometry