Package eu.woolplatform.utils.geom
Class Polygon
- java.lang.Object
-
- eu.woolplatform.utils.geom.Polygon
-
public class Polygon extends Object
This class defines a polygon.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPoints(Point... points)Adds the specified points.RectgetBounds()Returns the bounding rectangle for this polygon.List<Point>getPoints()Returns the points for this polygonvoidoffset(double dx, double dy)Moves this polygon by the specified offset.voidrotate(float angle)Rotates this polygon by the specified number of degrees around the first point.voidsetPoints(Point... points)Sets the points.voidsetPoints(List<Point> points)Sets the points.StringtoString()
-
-
-
Method Detail
-
getPoints
public List<Point> getPoints()
Returns the points for this polygon- Returns:
- the points for this polygon
-
setPoints
public void setPoints(List<Point> points)
Sets the points.- Parameters:
points- the points
-
setPoints
public void setPoints(Point... points)
Sets the points.- Parameters:
points- the points
-
addPoints
public void addPoints(Point... points)
Adds the specified points.- Parameters:
points- the points
-
getBounds
public Rect getBounds()
Returns the bounding rectangle for this polygon.- Returns:
- the bounding rectangle for this polygon
-
offset
public void offset(double dx, double dy)Moves this polygon by the specified offset.- Parameters:
dx- the offset along the X axisdy- the offset along the Y axis
-
rotate
public void rotate(float angle)
Rotates this polygon by the specified number of degrees around the first point.- Parameters:
angle- the angle in degrees
-
-