public class Polygon extends BasicGraphicalElement
Constructor and Description |
---|
Polygon(GraphicAttributes attributes,
boolean closed)
Creates an instance of the specified graphic attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(GraphPoint point)
Adds a new point to the end of the list of points.
|
int |
getNumberOfPoints()
Returns the number points.
|
GraphPoint |
getPoint(int index)
Returns the point for the specified index.
|
boolean |
isClosed()
Returns true if this polygon is closed.
|
void |
removeAllPoints()
Removes all points.
|
void |
renderWith(Renderer renderer)
Renders this line with the specified
Renderer . |
void |
replacePointAt(int index,
GraphPoint point)
Replaces the point at the specified index by a new one.
|
getGraphicAttributes
public Polygon(GraphicAttributes attributes, boolean closed)
closed
- true if this polygon is closed.public boolean isClosed()
isClosed
in class BasicGraphicalElement
public int getNumberOfPoints()
public GraphPoint getPoint(int index)
public void addPoint(GraphPoint point)
public void removeAllPoints()
public void replacePointAt(int index, GraphPoint point)
public void renderWith(Renderer renderer)
Renderer
.renderer
- An instance of PolygonRenderer
.IllegalArgumentException
- if renderer is not
an instance of PolygonRenderer.Copyright © 2015. All Rights Reserved.