com.partnersoft.maps.rover
Class RoverArea

java.lang.Object
  extended by com.partnersoft.maps.rover.AbstractRoverShape<RoverArea>
      extended by com.partnersoft.maps.rover.RoverArea
All Implemented Interfaces:
Immutable, RoverShape<RoverArea>

public class RoverArea
extends AbstractRoverShape<RoverArea>

A geographic area described by a polygon.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
RoverArea(int drawId, boolean selectable, XyPolygon polygon)
          Creates a RoverArea with zero id and dataId.
RoverArea(int id, int dataId, int drawId, boolean selectable, XyPolygon polygon)
          Construct a RoverArea with all parameters set.
RoverArea(int id, int dataId, int drawId, XyPolygon polygon)
          Construct a selectable RoverArea.
RoverArea(int drawId, XyPolygon polygon)
          Creates a RoverArea with zero id and dataId.
 
Method Summary
 XyBounds getBounds()
          The bounds of the shape.
 XyPoint getCentroid()
          The center of the bounds of the shape.
 XyPoint getEndPoint()
          The last point in the shape.
 XyPolygon getPolygon()
          Polygon geometry for this area.
 XyPoint getStartPoint()
          The first point in the shape.
 java.lang.String toString()
           
 RoverArea withDataId(int dataId)
          Returns a copy of this shape with the given data ID.
 RoverArea withDrawId(int drawId)
          Returns a copy of this shape with the given drawable ID.
 RoverArea withId(int id)
          Returns a copy of this shape with the given ID.
 RoverArea withIds(int id, int dataId, int drawId)
          Returns a copy of this shape with the given IDs set.
 
Methods inherited from class com.partnersoft.maps.rover.AbstractRoverShape
getDataId, getDrawId, getId, hasZ, isOffset, isRotated, isSelectable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoverArea

public RoverArea(int id,
                 int dataId,
                 int drawId,
                 boolean selectable,
                 XyPolygon polygon)
Construct a RoverArea with all parameters set.


RoverArea

public RoverArea(int drawId,
                 boolean selectable,
                 XyPolygon polygon)
Creates a RoverArea with zero id and dataId.


RoverArea

public RoverArea(int id,
                 int dataId,
                 int drawId,
                 XyPolygon polygon)
Construct a selectable RoverArea.


RoverArea

public RoverArea(int drawId,
                 XyPolygon polygon)
Creates a RoverArea with zero id and dataId.

Method Detail

getBounds

public XyBounds getBounds()
Description copied from interface: RoverShape
The bounds of the shape.


getCentroid

public XyPoint getCentroid()
Description copied from interface: RoverShape
The center of the bounds of the shape.


getEndPoint

public XyPoint getEndPoint()
Description copied from interface: RoverShape
The last point in the shape. May be the same as the start point.


getStartPoint

public XyPoint getStartPoint()
Description copied from interface: RoverShape
The first point in the shape. May be a better choice for locating the shape than the center.


withDataId

public RoverArea withDataId(int dataId)
Description copied from interface: RoverShape
Returns a copy of this shape with the given data ID.


withDrawId

public RoverArea withDrawId(int drawId)
Description copied from interface: RoverShape
Returns a copy of this shape with the given drawable ID.


withId

public RoverArea withId(int id)
Description copied from interface: RoverShape
Returns a copy of this shape with the given ID.


withIds

public RoverArea withIds(int id,
                         int dataId,
                         int drawId)
Description copied from interface: RoverShape
Returns a copy of this shape with the given IDs set.


toString

public java.lang.String toString()
Overrides:
toString in class AbstractRoverShape<RoverArea>

getPolygon

public XyPolygon getPolygon()
Polygon geometry for this area.