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, getBounds2Dpublic 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 ShapeDelegatepublic boolean isSymmetric()
isSymmetric in class ShapeDelegatepublic java.awt.Shape getShape()
ShapeDelegategetShape in class ShapeDelegatepublic java.awt.geom.Point2D getCenterpoint(java.awt.geom.Rectangle2D bounds,
java.awt.geom.Point2D rv)
getCenterpoint in class ShapeDelegatepublic boolean alterShape(java.awt.geom.Rectangle2D newRect)
ShapeDelegatealterShape in class ShapeDelegatenewRect - The new bounding rectangle for the shape.public void updateShape()
public void translateShape(double dX,
double dY)
ShapeDelegatetranslateShape in class ShapeDelegatepublic java.awt.geom.GeneralPath convertToPath()
ShapeDelegateconvertToPath in class ShapeDelegatepublic 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()
ShapeDelegateisRotatable in class ShapeDelegatepublic void rotate(double angle,
java.awt.geom.Point2D anchor)
rotate in class ShapeDelegate