public abstract class ShapeDelegate
extends java.lang.Object
Constructor and Description |
---|
ShapeDelegate() |
Modifier and Type | Method and Description |
---|---|
abstract 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.Area |
createArea(java.awt.Shape shape,
float strokeWidth,
boolean filled)
Gives the delegate a chance to create the hit-testing area appropriate for it's shape.
|
java.awt.geom.Rectangle2D |
getBounds2D(java.awt.Shape shape)
Provides a way for the delegate to do custom calculation of the shape's bounds.
|
java.awt.geom.Point2D |
getCenterpoint(java.awt.geom.Rectangle2D bounds,
java.awt.geom.Point2D rv) |
abstract java.awt.Shape |
getShape()
The AWT shape this delegate produces
|
abstract java.lang.String |
getToolKey() |
boolean |
isRotatable()
Some shape delegates prefer to handle rotation themselves, instead of having the PathBasedVisionShape parent
rotate their shape after the fact.
|
abstract boolean |
isSymmetric() |
void |
rotate(double angle,
java.awt.geom.Point2D anchor) |
void |
translateShape(double dX,
double dY)
Move the shape using the provided offsets.
|
public abstract java.awt.Shape getShape()
public abstract boolean alterShape(java.awt.geom.Rectangle2D newRect)
newRect
- The new bounding rectangle for the shape.public void translateShape(double dX, double dY)
public java.awt.geom.Rectangle2D getBounds2D(java.awt.Shape shape)
return shape.getBounds2D();
public java.awt.geom.Area createArea(java.awt.Shape shape, float strokeWidth, boolean filled)
shape
- The shape, after applying rotation transform.strokeWidth
- The width of the stroke, of 0 if the path isn't strokedfilled
- Whether or not the shape will be filled with a paint.public java.awt.geom.Point2D getCenterpoint(java.awt.geom.Rectangle2D bounds, java.awt.geom.Point2D rv)
public java.awt.geom.GeneralPath convertToPath()
public abstract boolean isSymmetric()
public boolean isRotatable()
public void rotate(double angle, java.awt.geom.Point2D anchor)
public abstract java.lang.String getToolKey()