public class BasicFigure extends AbstractFigure implements ShapedFigure
| Constructor and Description |
|---|
BasicFigure(java.awt.Shape shape)
Create a new figure with the given shape.
|
BasicFigure(java.awt.Shape shape,
float lineWidth)
Create a new figure with the given shape and outline width.
|
BasicFigure(java.awt.Shape shape,
int lineWidth)
Deprecated.
Use the float constructor instead.
|
BasicFigure(java.awt.Shape shape,
java.awt.Paint fill)
Create a new figure with the given paint pattern.
|
BasicFigure(java.awt.Shape shape,
java.awt.Paint fill,
float lineWidth)
Create a new figure with the given paint pattern and line
width.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of this figure.
|
java.awt.Composite |
getComposite()
Get the compositing operator
|
float[] |
getDashArray()
Get the dash array.
|
java.awt.Paint |
getFillPaint()
Get the fill paint
|
float |
getLineWidth()
Get the line width.
|
java.awt.geom.Point2D |
getOrigin()
Return the origin of the figure in the enclosing transform
context.
|
java.awt.Shape |
getShape()
Get the shape of this figure.
|
java.awt.Paint |
getStrokePaint()
Get the paint used to stroke this figure
|
boolean |
hit(java.awt.geom.Rectangle2D r)
Test if this figure intersects the given rectangle.
|
boolean |
isCentered()
Return whether the figure should be centered on its origin.
|
void |
paint(java.awt.Graphics2D g)
Paint the figure.
|
void |
setCentered(boolean centered)
Specify whether the figure should be centered on its origin.
|
void |
setComposite(java.awt.AlphaComposite c)
Set the compositing operation for this figure.
|
void |
setDashArray(float[] dashArray)
Set the dash array of the stroke.
|
void |
setFillPaint(java.awt.Paint p)
Set the fill paint.
|
void |
setLineWidth(float lineWidth)
Set the line width.
|
void |
setPrototypeShape(java.awt.Shape s)
Change the shape of the figure without modifying its other
properties, such as its position.
|
void |
setShape(java.awt.Shape s)
Set the shape of this figure.
|
void |
setStroke(java.awt.Stroke s)
Set the stroke
|
void |
setStrokePaint(java.awt.Paint p)
Set the stroke paint
|
void |
transform(java.awt.geom.AffineTransform at)
Transform the figure with the supplied transform.
|
contains, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible, translateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontains, getInteractor, getLayer, getParent, getToolTipText, intersects, setInteractor, setParent, setToolTipText, translateisVisible, paint, setVisiblegetTransformContext, repaint, repaintgetUserObject, setUserObjectpublic BasicFigure(java.awt.Shape shape)
@Deprecated
public BasicFigure(java.awt.Shape shape,
int lineWidth)
public BasicFigure(java.awt.Shape shape,
float lineWidth)
public BasicFigure(java.awt.Shape shape,
java.awt.Paint fill)
public BasicFigure(java.awt.Shape shape,
java.awt.Paint fill,
float lineWidth)
public java.awt.geom.Rectangle2D getBounds()
getBounds in interface FiguregetBounds in class AbstractFigurepublic java.awt.Composite getComposite()
public float[] getDashArray()
public java.awt.Paint getFillPaint()
public float getLineWidth()
public java.awt.geom.Point2D getOrigin()
getOrigin in interface FiguregetOrigin in class AbstractFigureAbstractFigure.getBounds()public java.awt.Shape getShape()
getShape in interface FiguregetShape in class AbstractFigurepublic java.awt.Paint getStrokePaint()
public boolean hit(java.awt.geom.Rectangle2D r)
hit in interface Figurehit in class AbstractFigurer - The rectangle to be checked.public boolean isCentered()
getOrigin(),
setCentered(boolean)public void paint(java.awt.Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigureg - The 2D graphics object that this object
it to be painted upon.public void setCentered(boolean centered)
centered - False to make the origin of the figure, as
returned by getOrigin(), be the upper left corner.getOrigin()public void setComposite(java.awt.AlphaComposite c)
public void setDashArray(float[] dashArray)
public void setFillPaint(java.awt.Paint p)
public void setLineWidth(float lineWidth)
public void setPrototypeShape(java.awt.Shape s)
public void setShape(java.awt.Shape s)
setShape in interface ShapedFigurepublic void setStrokePaint(java.awt.Paint p)
public void setStroke(java.awt.Stroke s)
public void transform(java.awt.geom.AffineTransform at)
transform in interface Figuretransform in class AbstractFigureat - The transform to be used.