com.partnersoft.maps.rover
Interface RoverShape<T extends RoverShape>

All Superinterfaces:
Immutable
All Known Implementing Classes:
AbstractRoverPointShape, AbstractRoverShape, RoverArea, RoverImage, RoverLine, RoverPoint, RoverText

public interface RoverShape<T extends RoverShape>
extends Immutable

A renderable geographic shape in a RoverLayer.

Includes generic methods to get the center, bounds, etc. Note that for points and text many of these are trivial or degenerate.

These are immutable to facilitate safe exchange.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Method Summary
 XyBounds getBounds()
          The bounds of the shape.
 XyPoint getCentroid()
          The center of the bounds of the shape.
 int getDataId()
          The data ID for this shape.
 int getDrawId()
          The Drawable ID for this shape.
 XyPoint getEndPoint()
          The last point in the shape.
 int getId()
          The ID for this shape, used to identify it in a database or other store.
 XyPoint getStartPoint()
          The first point in the shape.
 boolean hasZ()
          Returns true if this shape has a Z coordinate.
 boolean isOffset()
          Returns true if this shape has a rotation.
 boolean isRotated()
          Returns true if this shape has a rotation.
 boolean isSelectable()
          Returns true if this shape is selectable.
 T withDataId(int dataId)
          Returns a copy of this shape with the given data ID.
 T withDrawId(int dataId)
          Returns a copy of this shape with the given drawable ID.
 T withId(int id)
          Returns a copy of this shape with the given ID.
 T withIds(int id, int dataId, int drawIds)
          Returns a copy of this shape with the given IDs set.
 

Method Detail

getId

int getId()
The ID for this shape, used to identify it in a database or other store. If zero, it is unassigned.


getDataId

int getDataId()
The data ID for this shape. If zero, it is not associated with data.


getDrawId

int getDrawId()
The Drawable ID for this shape. If zero, it is not associated with a Drawable.


getCentroid

XyPoint getCentroid()
The center of the bounds of the shape.


getStartPoint

XyPoint getStartPoint()
The first point in the shape. May be a better choice for locating the shape than the center.


getEndPoint

XyPoint getEndPoint()
The last point in the shape. May be the same as the start point.


getBounds

XyBounds getBounds()
The bounds of the shape.


hasZ

boolean hasZ()
Returns true if this shape has a Z coordinate.


isRotated

boolean isRotated()
Returns true if this shape has a rotation.


isOffset

boolean isOffset()
Returns true if this shape has a rotation.


isSelectable

boolean isSelectable()
Returns true if this shape is selectable.


withId

T withId(int id)
Returns a copy of this shape with the given ID.


withDataId

T withDataId(int dataId)
Returns a copy of this shape with the given data ID.


withDrawId

T withDrawId(int dataId)
Returns a copy of this shape with the given drawable ID.


withIds

T withIds(int id,
          int dataId,
          int drawIds)
Returns a copy of this shape with the given IDs set.