|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphicPolygon
Defines a common abstraction for graphic representation of polygons.
A GraphicPolygon
consists of a an exterior ring of vertices
and a set of non-mutually-overlapping interior rings of vertices.
The exterior and interior rings of a polygon are defined by a list of
DirectPosition objects. Technically speaking, these rings are
required to be closed (i.e. the first and last points must coincide).
However, this interface allows the user to create lists where the first and
last points are not coincident. In such a case, the implementation of this
interface will assume that there is an additional segment between the first
and last points, completing the ring. (This will take place without
modifying the list of points.)
Field Summary |
---|
Fields inherited from interface Graphic |
---|
DEFAULT_AUTO_EDIT, DEFAULT_BLINK_PATTERN, DEFAULT_BLINKING, DEFAULT_DRAG_SELECTABLE, DEFAULT_MAX_SCALE, DEFAULT_MIN_SCALE, DEFAULT_PICKABLE, DEFAULT_SELECTED, DEFAULT_VISIBLE, DEFAULT_Z_ORDER |
Method Summary | |
---|---|
void |
addExteriorPoint(DirectPosition position)
Adds a new point to the list of vertices in the exterior ring. |
void |
addInteriorPoint(int interiorRingIndex,
DirectPosition position)
Adds a new point to the list of vertices of an interior ring. |
int |
addInteriorRing()
Creates a new interior ring (hole) for this polygon. |
int |
addInteriorRing(DirectPosition[] vertices)
Creates a new interior ring for this polygon and immediately sets its points to those in the given array. |
DirectPosition |
getExteriorPoint(int index)
Returns a live reference to the vertex at the given index. |
DirectPosition[] |
getExteriorRing()
Returns a new array containing references to all of the vertices in the exterior ring. |
DirectPosition |
getInteriorPoint(int index,
int interiorRingIndex)
Returns a live reference to the vertex at the given index. |
DirectPosition[] |
getInteriorRing(int interiorRingIndex)
Returns a new array containing references to all of the vertices in the exterior ring. |
DirectPosition[][] |
getInteriorRings()
Returns a newly allocated two-dimensional array of points. |
int |
getNumExteriorPoints()
Returns the number of vertices in the exterior ring. |
int |
getNumInteriorPoints(int interiorRingIndex)
Returns the number of vertices in an interior ring. |
int |
getNumInteriorRings()
Returns the number of interior rings currently in this polygon. |
PathType |
getPathType()
Returns the parameter that indicates how the "in-between" points between vertices are to be drawn. |
PolygonSymbolizer |
getPolygonSymbolizer()
Returns the GraphicStyle for this GraphicPolygon ,
which is required to be a PolygonSymbolizer . |
void |
insertExteriorPoint(int index,
DirectPosition position)
Inserts a new point into the list of vertices for the exterior ring. |
void |
insertInteriorPoint(int index,
int interiorRingIndex,
DirectPosition position)
Inserts a new point into the list of vertices for an interior ring. |
boolean |
isAllowingNewVertices()
Indicates whether clicking on an edge of this graphic linestring should insert a new vertex at that location when the object is in edit mode. |
DirectPosition |
removeExteriorPoint(int index)
Removes a position from the list of vertices for the exterior ring. |
DirectPosition |
removeInteriorPoint(int index,
int interiorRingIndex)
Removes a position from the list of vertices for an interior ring. |
void |
removeInteriorRing(int interiorRingIndex)
Removes an interior ring. |
void |
setAllowingNewVertices(boolean newValue)
Sets the boolean that indicates whether clicking on an edge of this graphic linestring should insert a new vertex at that location. |
DirectPosition |
setExteriorPoint(int index,
DirectPosition position)
Replaces a position in the list of vertices for the exterior ring. |
void |
setExteriorRing(DirectPosition[] newVertices)
Clears the list of vertices in the exterior ring and adds all of the vertices in the given array. |
DirectPosition |
setInteriorPoint(int index,
int interiorRingIndex,
DirectPosition position)
Replaces a position in the list of vertices for an interior ring. |
void |
setInteriorRing(int interiorRingIndex,
DirectPosition[] newVertices)
Clears the list of vertices in an exterior ring and adds all of the vertices in the given array. |
void |
setInteriorRings(DirectPosition[][] interiorRingPoints)
Clears the lists of vertices of all the interior rings and adds all of the vertices in the given arrays. |
void |
setPathType(PathType pathType)
Sets the parameter that indicates how the "in-between" points between vertices should be drawn. |
Method Detail |
---|
DirectPosition getExteriorPoint(int index)
index
- Index of the point to retrieve a reference to.
IndexOutOfBoundsException
- Throws this if the given index is less
than zero or greater than or equal to the number points in the exterior
ring.void addExteriorPoint(DirectPosition position)
position
- The new position to add to the list.void insertExteriorPoint(int index, DirectPosition position)
index
- The index that the new position will occupy after the
insert. All other points have their index increased by one.position
- The new position to add to the list.
IndexOutOfBoundsException
- Throws this if the given index is less
than zero or greater than or equal to the number points in the exterior
ring.DirectPosition setExteriorPoint(int index, DirectPosition position)
index
- The index of the point to replace.position
- The point that will take the place of the existing one.
IndexOutOfBoundsException
- Throws this if the given index is less
than zero or greater than or equal to the number points in the exterior
ring.DirectPosition removeExteriorPoint(int index)
index
- Index of the position to remove. All positions after this
index are moved forward in the list.
IndexOutOfBoundsException
- Throws this if the given index is less
than zero or greater than or equal to the number points in the exterior
ring.DirectPosition[] getExteriorRing()
void setExteriorRing(DirectPosition[] newVertices)
int getNumExteriorPoints()
DirectPosition getInteriorPoint(int index, int interiorRingIndex)
index
- Index of the point to retrieve a reference to.interiorRingIndex
- Index of the interior ring whose vertex is
desired.
IndexOutOfBoundsException
- Throws this if the vertex index is
less than zero or greater than or equal to the number of vertices in
the given interior ring. May also throw this if the interior ring
index is less than zero or greater than or equal to the number of
interior rings.void addInteriorPoint(int interiorRingIndex, DirectPosition position)
position
- The new position to add to the list.interiorRingIndex
- Index of the interior ring whose vertex list is
to be modified.
IndexOutOfBoundsException
- Throws this if the interior ring index
is less than zero or greater than or equal to the number of interior
rings.void insertInteriorPoint(int index, int interiorRingIndex, DirectPosition position)
index
- The index that the new position will occupy after the
insert. All other points have their index increased by one.interiorRingIndex
- Index of the interior ring whose vertex list is
to be modified.position
- The new position to add to the list.
IndexOutOfBoundsException
- Throws this if the vertex index is
less than zero or greater than or equal to the number of vertices in
the given interior ring. May also throw this if the interior ring
index is less than zero or greater than or equal to the number of
interior rings.DirectPosition setInteriorPoint(int index, int interiorRingIndex, DirectPosition position)
index
- The index of the point to replace.interiorRingIndex
- Index of the interior ring whose vertex list is
to be modified.position
- The point that will take the place of the existing one.
IndexOutOfBoundsException
- Throws this if the vertex index is
less than zero or greater than or equal to the number of vertices in
the given interior ring. May also throw this if the interior ring
index is less than zero or greater than or equal to the number of
interior rings.DirectPosition removeInteriorPoint(int index, int interiorRingIndex)
index
- Index of the position to remove. All positions after this
index are moved forward in the list.interiorRingIndex
- Index of the interior ring whose vertex list is
to be modified.
IndexOutOfBoundsException
- Throws this if the vertex index is
less than zero or greater than or equal to the number of vertices in
the given interior ring. May also throw this if the interior ring
index is less than zero or greater than or equal to the number of
interior rings.DirectPosition[] getInteriorRing(int interiorRingIndex)
interiorRingIndex
- Index of the interior ring whose vertex list is
being requested.
IndexOutOfBoundsException
- Throws this if the interior ring index
is less than zero or greater than or equal to the number of interior
rings.int addInteriorRing()
int addInteriorRing(DirectPosition[] vertices)
void setInteriorRing(int interiorRingIndex, DirectPosition[] newVertices)
interiorRingIndex
- Index of the interior ring whose vertex list is
to be modified.newVertices
- The list of vertices to replace the existing ring
with.
IndexOutOfBoundsException
- Throws this if the interior ring index
is less than zero or greater than or equal to the number of interior
rings.int getNumInteriorPoints(int interiorRingIndex)
interiorRingIndex
- Index of the interior ring to get a vertex count
from.
IndexOutOfBoundsException
- Throws this if the interior ring index
is less than zero or greater than or equal to the number of interior
rings.void removeInteriorRing(int interiorRingIndex)
interiorRingIndex
- Index of the ring to remove.int getNumInteriorRings()
DirectPosition[][] getInteriorRings()
void setInteriorRings(DirectPosition[][] interiorRingPoints)
PolygonSymbolizer getPolygonSymbolizer()
GraphicStyle
for this GraphicPolygon
,
which is required to be a PolygonSymbolizer
.
GraphicStyle
.void setPathType(PathType pathType)
pathType
- One of the static constants indicating the method to
use.PathType getPathType()
boolean isAllowingNewVertices()
void setAllowingNewVertices(boolean newValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |