org.opengis.go.display.primitive
Interface GraphicPolygon
-
- All Superinterfaces:
- Graphic
public interface GraphicPolygon extends Graphic
Defines a common abstraction for graphic representation of polygons. AGraphicPolygonconsists 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.)- Since:
- GO 1.0
-
-
Field Summary
-
Fields inherited from interface org.opengis.go.display.primitive.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
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddExteriorPoint(DirectPosition position)Adds a new point to the list of vertices in the exterior ring.voidaddInteriorPoint(int interiorRingIndex, DirectPosition position)Adds a new point to the list of vertices of an interior ring.intaddInteriorRing()Creates a new interior ring (hole) for this polygon.intaddInteriorRing(DirectPosition[] vertices)Creates a new interior ring for this polygon and immediately sets its points to those in the given array.DirectPositiongetExteriorPoint(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.DirectPositiongetInteriorPoint(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.intgetNumExteriorPoints()Returns the number of vertices in the exterior ring.intgetNumInteriorPoints(int interiorRingIndex)Returns the number of vertices in an interior ring.intgetNumInteriorRings()Returns the number of interior rings currently in this polygon.PathTypegetPathType()Returns the parameter that indicates how the "in-between" points between vertices are to be drawn.PolygonSymbolizergetPolygonSymbolizer()Returns theGraphicStylefor thisGraphicPolygon, which is required to be aPolygonSymbolizer.voidinsertExteriorPoint(int index, DirectPosition position)Inserts a new point into the list of vertices for the exterior ring.voidinsertInteriorPoint(int index, int interiorRingIndex, DirectPosition position)Inserts a new point into the list of vertices for an interior ring.booleanisAllowingNewVertices()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.DirectPositionremoveExteriorPoint(int index)Removes a position from the list of vertices for the exterior ring.DirectPositionremoveInteriorPoint(int index, int interiorRingIndex)Removes a position from the list of vertices for an interior ring.voidremoveInteriorRing(int interiorRingIndex)Removes an interior ring.voidsetAllowingNewVertices(boolean newValue)Sets the boolean that indicates whether clicking on an edge of this graphic linestring should insert a new vertex at that location.DirectPositionsetExteriorPoint(int index, DirectPosition position)Replaces a position in the list of vertices for the exterior ring.voidsetExteriorRing(DirectPosition[] newVertices)Clears the list of vertices in the exterior ring and adds all of the vertices in the given array.DirectPositionsetInteriorPoint(int index, int interiorRingIndex, DirectPosition position)Replaces a position in the list of vertices for an interior ring.voidsetInteriorRing(int interiorRingIndex, DirectPosition[] newVertices)Clears the list of vertices in an exterior ring and adds all of the vertices in the given array.voidsetInteriorRings(DirectPosition[][] interiorRingPoints)Clears the lists of vertices of all the interior rings and adds all of the vertices in the given arrays.voidsetPathType(PathType pathType)Sets the parameter that indicates how the "in-between" points between vertices should be drawn.-
Methods inherited from interface org.opengis.go.display.primitive.Graphic
addGraphicListener, cloneGraphic, dispose, fireGraphicEvent, getAutoEdit, getBlinking, getBlinkPattern, getClientProperty, getDragSelectable, getGraphicStyle, getMaxScale, getMinScale, getName, getParent, getPickable, getSelected, getSymbology, getVisible, getZOrderHint, isPassingEventsToParent, isShowingAnchorHandles, isShowingEditHandles, putClientProperty, refresh, removeGraphicListener, setAutoEdit, setBlinking, setBlinkPattern, setDragSelectable, setGraphicStyle, setMaxScale, setMinScale, setName, setParent, setPassingEventsToParent, setPickable, setSelected, setShowingAnchorHandles, setShowingEditHandles, setSymbology, setVisible, setZOrderHint
-
-
-
-
Method Detail
-
getExteriorPoint
DirectPosition getExteriorPoint(int index)
Returns a live reference to the vertex at the given index.- Parameters:
index- Index of the point to retrieve a reference to.- Returns:
- Returns a reference to the index-th vertex.
- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the given index is less than zero or greater than or equal to the number points in the exterior ring.
-
addExteriorPoint
void addExteriorPoint(DirectPosition position)
Adds a new point to the list of vertices in the exterior ring.- Parameters:
position- The new position to add to the list.
-
insertExteriorPoint
void insertExteriorPoint(int index, DirectPosition position)Inserts a new point into the list of vertices for the exterior ring.- Parameters:
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.- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the given index is less than zero or greater than or equal to the number points in the exterior ring.
-
setExteriorPoint
DirectPosition setExteriorPoint(int index, DirectPosition position)
Replaces a position in the list of vertices for the exterior ring.- Parameters:
index- The index of the point to replace.position- The point that will take the place of the existing one.- Returns:
- Returns the position that was previously in the given position.
- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the given index is less than zero or greater than or equal to the number points in the exterior ring.
-
removeExteriorPoint
DirectPosition removeExteriorPoint(int index)
Removes a position from the list of vertices for the exterior ring.- Parameters:
index- Index of the position to remove. All positions after this index are moved forward in the list.- Returns:
- Returns the DirectPosition previously at the given index.
- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the given index is less than zero or greater than or equal to the number points in the exterior ring.
-
getExteriorRing
DirectPosition[] getExteriorRing()
Returns a new array containing references to all of the vertices in the exterior ring.- Returns:
- A newly allocated array containing references to the vertices.
-
setExteriorRing
void setExteriorRing(DirectPosition[] newVertices)
Clears the list of vertices in the exterior ring and adds all of the vertices in the given array. This polygon will keep references to the DirectPositions in the array, but not the array object itself.
-
getNumExteriorPoints
int getNumExteriorPoints()
Returns the number of vertices in the exterior ring.
-
getInteriorPoint
DirectPosition getInteriorPoint(int index, int interiorRingIndex)
Returns a live reference to the vertex at the given index.- Parameters:
index- Index of the point to retrieve a reference to.interiorRingIndex- Index of the interior ring whose vertex is desired.- Returns:
- Returns a reference to the index-th vertex.
- Throws:
java.lang.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.
-
addInteriorPoint
void addInteriorPoint(int interiorRingIndex, DirectPosition position)Adds a new point to the list of vertices of an interior ring.- Parameters:
position- The new position to add to the list.interiorRingIndex- Index of the interior ring whose vertex list is to be modified.- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the interior ring index is less than zero or greater than or equal to the number of interior rings.
-
insertInteriorPoint
void insertInteriorPoint(int index, int interiorRingIndex, DirectPosition position)Inserts a new point into the list of vertices for an interior ring.- Parameters:
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.- Throws:
java.lang.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.
-
setInteriorPoint
DirectPosition setInteriorPoint(int index, int interiorRingIndex, DirectPosition position)
Replaces a position in the list of vertices for an interior ring.- Parameters:
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.- Returns:
- Returns the position that was previously in the given position.
- Throws:
java.lang.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.
-
removeInteriorPoint
DirectPosition removeInteriorPoint(int index, int interiorRingIndex)
Removes a position from the list of vertices for an interior ring.- Parameters:
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.- Returns:
- Returns the DirectPosition previously at the given index.
- Throws:
java.lang.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.
-
getInteriorRing
DirectPosition[] getInteriorRing(int interiorRingIndex)
Returns a new array containing references to all of the vertices in the exterior ring.- Parameters:
interiorRingIndex- Index of the interior ring whose vertex list is being requested.- Returns:
- A newly allocated array containing references to the vertices.
- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the interior ring index is less than zero or greater than or equal to the number of interior rings.
-
addInteriorRing
int addInteriorRing()
Creates a new interior ring (hole) for this polygon.- Returns:
- Returns the index of the newly created ring.
-
addInteriorRing
int addInteriorRing(DirectPosition[] vertices)
Creates a new interior ring for this polygon and immediately sets its points to those in the given array.- Returns:
- Returns the index of the newly created ring.
-
setInteriorRing
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. This polygon will keep references to the DirectPositions in the array, but not the array object itself.- Parameters:
interiorRingIndex- Index of the interior ring whose vertex list is to be modified.newVertices- The list of vertices to replace the existing ring with.- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the interior ring index is less than zero or greater than or equal to the number of interior rings.
-
getNumInteriorPoints
int getNumInteriorPoints(int interiorRingIndex)
Returns the number of vertices in an interior ring.- Parameters:
interiorRingIndex- Index of the interior ring to get a vertex count from.- Throws:
java.lang.IndexOutOfBoundsException- Throws this if the interior ring index is less than zero or greater than or equal to the number of interior rings.
-
removeInteriorRing
void removeInteriorRing(int interiorRingIndex)
Removes an interior ring.- Parameters:
interiorRingIndex- Index of the ring to remove.
-
getNumInteriorRings
int getNumInteriorRings()
Returns the number of interior rings currently in this polygon.
-
getInteriorRings
DirectPosition[][] getInteriorRings()
Returns a newly allocated two-dimensional array of points. The first index of the returned array chooses an interior ring. The second index runs over the vertices of that ring. The DirectPositions in the list are references to the same objects held by this polygon, but the array object is newly allocated.
-
setInteriorRings
void setInteriorRings(DirectPosition[][] interiorRingPoints)
Clears the lists of vertices of all the interior rings and adds all of the vertices in the given arrays. This polygon will keep references to the DirectPositions in the arrays, but not the array objecst themselves.
-
getPolygonSymbolizer
PolygonSymbolizer getPolygonSymbolizer()
Returns theGraphicStylefor thisGraphicPolygon, which is required to be aPolygonSymbolizer.- Returns:
- the GraphicPolygon's
GraphicStyle.
-
setPathType
void setPathType(PathType pathType)
Sets the parameter that indicates how the "in-between" points between vertices should be drawn.- Parameters:
pathType- One of the static constants indicating the method to use.
-
getPathType
PathType getPathType()
Returns the parameter that indicates how the "in-between" points between vertices are to be drawn.
-
isAllowingNewVertices
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.
-
setAllowingNewVertices
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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG