com.moximedia.aims
Class AimsPolyline

java.lang.Object
  extended bycom.moximedia.aims.AimsPolyline
All Implemented Interfaces:
AimsShapeObject, java.io.Serializable

public class AimsPolyline
extends java.lang.Object
implements AimsShapeObject, java.io.Serializable

Implementation of an ArcIMS polygon object which can be placed in an Acetate layer of a map.

Author:
Doug Cates - www.moximedia.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.moximedia.aims.AimsShapeObject
SHAPE_TYPE_ENVELOPE, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_POINT, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYLINE
 
Constructor Summary
AimsPolyline()
          Creates a new point object with no arguments.
AimsPolyline(AimsPoints pts)
          Creates a new polyline object with an AimsPoints object.
 
Method Summary
 AimsPath addPath()
          Adds a new path to the polyline, and returns the path object.
 void addPath(AimsPath path)
          Adds a new path to the polyline.
 AimsPolygon buffer(double distance)
           
 java.lang.Object clone()
           
 void densify(double distance)
          Densifies the points in the shape by a distance.
 void generalize(double distance)
          Generalizes the points in the shape by a distance.
 AimsPoint getClosestVertex(AimsPoint pt)
          Gets the closest vertex in the AimsPolyline to the specified point.
 AimsEnvelope getExtent()
          Returns the extent of the polygon, or null if the polygon has no points.
 double getLength()
          Gets the length of the polyline.
 java.util.Vector getPaths()
           
 AimsPoints getPoints()
          Gets a points object containing copies of the points of the polyline.
 int getShapeType()
           
 AimsPolyline intersection(AimsPolygon polygon)
           
 boolean intersects(AimsPolygon polygon)
           
 boolean isValid()
          Returns a boolean indicator of whether this shape is valid.
 void offsetBy(AimsPoint offset)
          Offsets the points in the polyline by the x and y in a point.
 AimsPolyline project(Projection projection)
          Projects this object to the specified projection.
 AimsPolyline project(Projection fromProjection, Projection toProjection)
          Projects this object from one projection to another.
 void setPoints(AimsPoints pts)
          Sets the points of the polyline object.
 java.lang.String toAxlString()
          Returns the AXL string to refresh this object.
 java.lang.String toAxlString(AimsEnvironment env)
          Returns the AXL string to refresh this object.
 java.lang.String toGmlString()
           
 com.vividsolutions.jts.geom.Geometry toJtsGeometry()
           
 java.lang.String toString()
          Returns a text representation of of this object.
 AimsPolyline unproject(Projection projection)
          Unprojects this object to geographic from the specified projection.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AimsPolyline

public AimsPolyline()
Creates a new point object with no arguments.


AimsPolyline

public AimsPolyline(AimsPoints pts)
Creates a new polyline object with an AimsPoints object.

Method Detail

getShapeType

public int getShapeType()
Specified by:
getShapeType in interface AimsShapeObject

getLength

public double getLength()
Gets the length of the polyline.

Returns:
The length of the polyline.

addPath

public AimsPath addPath()
Adds a new path to the polyline, and returns the path object.

Returns:
The path added to the polyline.

addPath

public void addPath(AimsPath path)
Adds a new path to the polyline.

Parameters:
path - The path to add to the polyline.

getPoints

public AimsPoints getPoints()
Gets a points object containing copies of the points of the polyline. Note that changing the points does not change the polyline.

Returns:
The points of the polyline.

densify

public void densify(double distance)
Densifies the points in the shape by a distance.

Parameters:
distance - The densify distance.

generalize

public void generalize(double distance)
Generalizes the points in the shape by a distance.

Parameters:
distance - The generalize distance.

offsetBy

public void offsetBy(AimsPoint offset)
Offsets the points in the polyline by the x and y in a point.

Parameters:
offset - An AimsPoint object containing the offset.

getClosestVertex

public AimsPoint getClosestVertex(AimsPoint pt)
Gets the closest vertex in the AimsPolyline to the specified point.

Parameters:
pt - The point to compare the vertexes to.
Returns:
The closest vertex to the specified point, or null if there are no points in the polyline.

getPaths

public java.util.Vector getPaths()

setPoints

public void setPoints(AimsPoints pts)
Sets the points of the polyline object.


getExtent

public AimsEnvelope getExtent()
Returns the extent of the polygon, or null if the polygon has no points.

Returns:
An AimsEnvelope containing the extent.

toString

public java.lang.String toString()
Returns a text representation of of this object.

Returns:
A string describing the object

toAxlString

public java.lang.String toAxlString()
Returns the AXL string to refresh this object. This method is not typically used by the application programmer.

Specified by:
toAxlString in interface AimsShapeObject
Returns:
The AXL string to refresh this object.

toAxlString

public java.lang.String toAxlString(AimsEnvironment env)
Returns the AXL string to refresh this object. This method is not typically used by the application programmer.

Specified by:
toAxlString in interface AimsShapeObject
Returns:
The AXL string to refresh this object.

clone

public java.lang.Object clone()
Specified by:
clone in interface AimsShapeObject

toGmlString

public java.lang.String toGmlString()
Specified by:
toGmlString in interface AimsShapeObject

toJtsGeometry

public com.vividsolutions.jts.geom.Geometry toJtsGeometry()
Specified by:
toJtsGeometry in interface AimsShapeObject

buffer

public AimsPolygon buffer(double distance)

intersection

public AimsPolyline intersection(AimsPolygon polygon)

intersects

public boolean intersects(AimsPolygon polygon)

isValid

public boolean isValid()
Returns a boolean indicator of whether this shape is valid.

Specified by:
isValid in interface AimsShapeObject
Returns:
True if the shape is valid, otherwise false.

project

public AimsPolyline project(Projection fromProjection,
                            Projection toProjection)
Projects this object from one projection to another.

Parameters:
fromProjection - The projection of this object.
toProjection - The target projection.
Returns:
The projected object.

project

public AimsPolyline project(Projection projection)
Projects this object to the specified projection. It is assumed that the coordinate system of the original object is geographic.

Parameters:
projection - The original projection system.
Returns:
An object containing the projected coordinates.

unproject

public AimsPolyline unproject(Projection projection)
Unprojects this object to geographic from the specified projection.

Parameters:
projection - The projection system.
Returns:
An object containing the unprojected coordinates.


Internet Mapping Framework for ArcIMS Java Object Model API (v5.1.00)
Copyright © 2006 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.