public class ArrowShape extends ShapeDelegate
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TOOL_KEY |
Constructor and Description |
---|
ArrowShape() |
ArrowShape(java.awt.geom.Point2D origin,
float length,
float angle,
float shaftWidth,
float headLength,
float headWidth) |
ArrowShape(java.awt.geom.Point2D origin,
float length,
float angle,
float shaftWidth,
float headLength,
float headWidth,
boolean doubleSided) |
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
|
float |
getAngle() |
float |
getHeadLength() |
float |
getHeadWidth() |
float |
getLength() |
java.awt.geom.Point2D |
getOrigin() |
float |
getShaftWidth() |
java.awt.Shape |
getShape()
The AWT shape this delegate produces
|
java.awt.geom.Point2D |
getTipPoint() |
java.lang.String |
getToolKey() |
boolean |
isDoubleSided() |
boolean |
isRotatable()
Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent
rotate their shape after the fact.
|
boolean |
isSymmetric() |
void |
rotate(double angle,
java.awt.geom.Point2D anchor) |
void |
setAngle(float angle) |
void |
setDoubleSided(boolean doubleSided) |
void |
setHeadLength(float headLength) |
void |
setHeadWidth(float headWidth) |
void |
setLength(float length) |
void |
setOrigin(java.awt.geom.Point2D origin) |
void |
setShaftWidth(float shaftWidth) |
void |
translateShape(double dX,
double dY)
Move the shape using the provided offsets.
|
void |
updateShape() |
createArea, getBounds2D, getCenterpoint
public static final java.lang.String TOOL_KEY
public ArrowShape()
public ArrowShape(java.awt.geom.Point2D origin, float length, float angle, float shaftWidth, float headLength, float headWidth)
public ArrowShape(java.awt.geom.Point2D origin, float length, float angle, float shaftWidth, float headLength, float headWidth, boolean doubleSided)
public java.lang.String getToolKey()
getToolKey
in class ShapeDelegate
public java.awt.Shape getShape()
ShapeDelegate
getShape
in class ShapeDelegate
public boolean isSymmetric()
isSymmetric
in class ShapeDelegate
public boolean isRotatable()
ShapeDelegate
isRotatable
in class ShapeDelegate
public void rotate(double angle, java.awt.geom.Point2D anchor)
rotate
in class ShapeDelegate
public java.awt.geom.Point2D getTipPoint()
public void updateShape()
public void translateShape(double dX, double dY)
ShapeDelegate
translateShape
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 java.awt.geom.GeneralPath convertToPath()
ShapeDelegate
convertToPath
in class ShapeDelegate
public java.awt.geom.Point2D getOrigin()
public void setOrigin(java.awt.geom.Point2D origin)
public float getLength()
public void setLength(float length)
public float getAngle()
public void setAngle(float angle)
public float getShaftWidth()
public void setShaftWidth(float shaftWidth)
public float getHeadLength()
public void setHeadLength(float headLength)
public float getHeadWidth()
public void setHeadWidth(float headWidth)
public boolean isDoubleSided()
public void setDoubleSided(boolean doubleSided)