algoanim.primitives
Class Polygon
java.lang.Object
algoanim.primitives.Primitive
algoanim.primitives.Polygon
public class Polygon
- extends Primitive
Represents a polygon defined by an arbitrary number of Nodes.
In contrast to a Polyline the figure is closed. The first and
the last Node are automatically connected.
- Author:
- Stephan Mehlhase
| Fields inherited from class algoanim.primitives.Primitive |
gen |
| Methods inherited from class algoanim.primitives.Primitive |
changeColor, exchange, getDisplayOptions, getName, hide, hide, moveBy, moveTo, moveVia, rotate, rotate, show, show |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Polygon
public Polygon(PolygonGenerator pg,
Node[] theNodes,
java.lang.String name,
DisplayOptions display,
PolygonProperties pp)
throws NotEnoughNodesException
- Instantiates the
Polygon and calls the create() method of
the associated PolygonGenerator.
- Parameters:
pg - the appropriate code Generator.theNodes - the nodes of this Polygon.name - the name of this Polygon.display - [optional] the DisplayOptions of this
Polygon.pp - [optional] the properties of this Polygon.
- Throws:
NotEnoughNodesException
getNodes
public Node[] getNodes()
- Returns the nodes of this
Polygon.
- Returns:
- the nodes of this
Polygon.
getProperties
public PolygonProperties getProperties()
- Returns the properties of this
Polygon.
- Returns:
- the properties of this
Polygon.
setName
public void setName(java.lang.String newName)
- Description copied from class:
Primitive
- Sets the name of this
Primitive.
- Overrides:
setName in class Primitive
- Parameters:
newName - the new name for this Primitive.- See Also:
Primitive.setName(java.lang.String)