public class PolygonShape extends ShapeDelegate
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TOOL_KEY |
Constructor and Description |
---|
PolygonShape() |
PolygonShape(boolean star,
int vertices,
float radius,
double startingAngle,
float starRadius,
double starStartingAngle,
java.awt.geom.Point2D center)
Sets all polygon props and then creates the shape.
|
Modifier and Type | Method and Description |
---|---|
boolean |
alterShape(java.awt.geom.Rectangle2D newRect)
Directly modify the shape's frame so that it fits tightly within the new framing rectangle.
|
java.awt.geom.GeneralPath |
convertToPath()
Convert this shape to a GeneralPath
|
java.awt.geom.Point2D |
getCenter() |
java.awt.geom.Point2D |
getCenterpoint(java.awt.geom.Rectangle2D bounds,
java.awt.geom.Point2D rv) |
float |
getRadius() |
java.awt.Shape |
getShape()
The AWT shape this delegate produces
|
float |
getStarRadius() |
java.awt.geom.Point2D |
getStarRadiusPoint() |
double |
getStarStartingAngle() |
double |
getStartingAngle() |
java.awt.geom.Point2D |
getTipPoint() |
java.lang.String |
getToolKey() |
int |
getVertices() |
boolean |
isRotatable()
Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent
rotate their shape after the fact.
|
boolean |
isStar() |
boolean |
isSymmetric() |
void |
rotate(double angle,
java.awt.geom.Point2D anchor) |
void |
setByCenter(java.awt.geom.Point2D center) |
void |
setCenter(java.awt.geom.Point2D center) |
void |
setRadius(float radius) |
void |
setStar(boolean star) |
void |
setStarRadius(float starRadius) |
void |
setStarStartingAngle(double starStartingAngle) |
void |
setStartingAngle(double startingAngle) |
void |
setVertices(int vertices) |
void |
translateShape(double dX,
double dY)
Move the shape using the provided offsets.
|
void |
updateShape() |
createArea, getBounds2D
public static final java.lang.String TOOL_KEY
public PolygonShape()
public PolygonShape(boolean star, int vertices, float radius, double startingAngle, float starRadius, double starStartingAngle, java.awt.geom.Point2D center)
public java.lang.String getToolKey()
getToolKey
in class ShapeDelegate
public boolean isSymmetric()
isSymmetric
in class ShapeDelegate
public java.awt.Shape getShape()
ShapeDelegate
getShape
in class ShapeDelegate
public java.awt.geom.Point2D getCenterpoint(java.awt.geom.Rectangle2D bounds, java.awt.geom.Point2D rv)
getCenterpoint
in class ShapeDelegate
public boolean alterShape(java.awt.geom.Rectangle2D newRect)
ShapeDelegate
alterShape
in class ShapeDelegate
newRect
- The new bounding rectangle for the shape.public void updateShape()
public void translateShape(double dX, double dY)
ShapeDelegate
translateShape
in class ShapeDelegate
public java.awt.geom.GeneralPath convertToPath()
ShapeDelegate
convertToPath
in class ShapeDelegate
public java.awt.geom.Point2D getCenter()
public void setCenter(java.awt.geom.Point2D center)
public float getRadius()
public void setRadius(float radius)
public float getStarRadius()
public void setStarRadius(float starRadius)
public double getStarStartingAngle()
public void setStarStartingAngle(double starStartingAngle)
public double getStartingAngle()
public void setStartingAngle(double startingAngle)
public boolean isStar()
public void setStar(boolean star)
public int getVertices()
public void setVertices(int vertices)
public java.awt.geom.Point2D getTipPoint()
public java.awt.geom.Point2D getStarRadiusPoint()
public void setByCenter(java.awt.geom.Point2D center)
public boolean isRotatable()
ShapeDelegate
isRotatable
in class ShapeDelegate
public void rotate(double angle, java.awt.geom.Point2D anchor)
rotate
in class ShapeDelegate