public abstract class GMLShape extends GMLObject
Modifier | Constructor and Description |
---|---|
protected |
GMLShape(int id)
Construct a GMLShape.
|
protected |
GMLShape(int id,
java.util.List<GMLDirectedEdge> edges)
Construct a GMLShape.
|
protected |
GMLShape(int id,
java.util.List<GMLDirectedEdge> edges,
java.util.List<java.lang.Integer> neighbours)
Construct a GMLShape.
|
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
getBounds()
Get the bounds of this shape.
|
double |
getCentreX()
Get the x coordinate of the centroid of this shape.
|
double |
getCentreY()
Get the y coordinate of the centroid of this shape.
|
Point2D |
getCentroid()
Get the centroid of this shape.
|
java.util.List<GMLCoordinates> |
getCoordinates()
Get the coordinates of the apexes of this shape.
|
java.util.List<GMLDirectedEdge> |
getEdges()
Get the edges of this shape.
|
java.lang.Integer |
getNeighbour(GMLDirectedEdge edge)
Get the ID of the neighbour through a particular edge.
|
java.lang.Integer |
getNeighbour(GMLEdge edge)
Get the ID of the neighbour through a particular edge.
|
java.util.List<GMLCoordinates> |
getUnderlyingCoordinates()
Get the coordinates of the edges that make up this shape.
|
java.util.List<GMLNode> |
getUnderlyingNodes()
Get the nodes of the edges that make up this shape.
|
boolean |
hasNeighbour(GMLDirectedEdge edge)
Find out if an edge has a neighbour.
|
boolean |
hasNeighbour(GMLEdge edge)
Find out if an edge has a neighbour.
|
void |
removeEdge(GMLEdge edge)
Remove an edge from this shape.
|
void |
reorderEdges(java.util.List<GMLDirectedEdge> newEdges)
Reorder the list of edges.
|
void |
replaceEdge(GMLDirectedEdge oldEdge,
GMLDirectedEdge... newEdges)
Replace a GMLDirectedEdge with a set of new edges.
|
void |
setCoordinates(java.util.List<GMLCoordinates> newPoints)
Set the coordinates of the apexes of this shape.
|
void |
setEdges(java.util.List<GMLDirectedEdge> newEdges)
Set the list of edges.
|
void |
setNeighbour(GMLDirectedEdge edge,
java.lang.Integer neighbour)
Set the ID of the neighbour through a particular edge.
|
void |
setNeighbour(GMLEdge edge,
java.lang.Integer neighbour)
Set the ID of the neighbour through a particular edge.
|
protected GMLShape(int id)
id
- The ID of the shape.protected GMLShape(int id, java.util.List<GMLDirectedEdge> edges)
id
- The ID of the shape.edges
- The edges of the shape.protected GMLShape(int id, java.util.List<GMLDirectedEdge> edges, java.util.List<java.lang.Integer> neighbours)
id
- The ID of the shape.edges
- The edges of the shape.neighbours
- The neighbours of each edge.public java.util.List<GMLDirectedEdge> getEdges()
public void setEdges(java.util.List<GMLDirectedEdge> newEdges)
newEdges
- The new edge list.public void reorderEdges(java.util.List<GMLDirectedEdge> newEdges)
newEdges
- The reordered edge list.public void replaceEdge(GMLDirectedEdge oldEdge, GMLDirectedEdge... newEdges)
oldEdge
- The edge to replace.newEdges
- The new edges.public void removeEdge(GMLEdge edge)
edge
- The underlying edge to remove.public java.lang.Integer getNeighbour(GMLDirectedEdge edge)
edge
- The edge to look up.public void setNeighbour(GMLDirectedEdge edge, java.lang.Integer neighbour)
edge
- The edge to set the neighbour of.neighbour
- The new neighbour ID for that edge. This may be null.public boolean hasNeighbour(GMLDirectedEdge edge)
edge
- The edge to look up.public java.lang.Integer getNeighbour(GMLEdge edge)
edge
- The edge to look up.public void setNeighbour(GMLEdge edge, java.lang.Integer neighbour)
edge
- The edge to set the neighbour of.neighbour
- The new neighbour ID for that edge. This may be null.public boolean hasNeighbour(GMLEdge edge)
edge
- The edge to look up.public java.util.List<GMLCoordinates> getUnderlyingCoordinates()
public java.util.List<GMLNode> getUnderlyingNodes()
public java.util.List<GMLCoordinates> getCoordinates()
public void setCoordinates(java.util.List<GMLCoordinates> newPoints)
newPoints
- The new apex coordinates.public double getCentreX()
public double getCentreY()
public java.awt.geom.Rectangle2D getBounds()
public Point2D getCentroid()