public abstract class AbstractFigure extends java.lang.Object implements Figure
Yellow |
Constructor and Description |
---|
AbstractFigure() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.awt.geom.Point2D p)
Test whether this figure contains the point given.
|
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of this figure.
|
Interactor |
getInteractor()
Return the interactor of this figure.
|
CanvasLayer |
getLayer()
Get the most immediate layer containing this figure.
|
java.awt.geom.Point2D |
getOrigin()
Return the origin of the figure in the enclosing transform
context, which in this base class is the center of the bounds
returned by getBounds().
|
CanvasComponent |
getParent()
Return the parent of this figure.
|
abstract java.awt.Shape |
getShape()
Get the outline shape of this figure.
|
java.lang.String |
getToolTipText()
Return the tooltip string for this figure, or null if the figure
does not have a tooltip.
|
TransformContext |
getTransformContext()
Return the transform context of the figure.
|
java.lang.Object |
getUserObject()
Get the user object of this figure.
|
boolean |
hit(java.awt.geom.Rectangle2D r)
Test if this figure intersects the given rectangle, and the
interior of the figure is not transparent to hits.
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
Test if this figure intersects the given rectangle.
|
boolean |
isVisible()
Test the visibility flag of this figure.
|
abstract void |
paint(java.awt.Graphics2D g)
Paint the figure.
|
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D r)
Repaint the figure in the given rectangle.
|
void |
repaint()
Schedule a repaint of the figure.
|
void |
repaint(DamageRegion d)
Schedule a repaint of the figure within the given damage
region.
|
void |
setInteractor(Interactor interactor)
Set the interactor of this figure.
|
void |
setParent(CanvasComponent fc)
Set the parent of this figure.
|
void |
setToolTipText(java.lang.String s)
Set the tooltip string for this figure.
|
void |
setUserObject(java.lang.Object o)
Set the user object.
|
void |
setVisible(boolean flag)
Set the visibility flag of this figure.
|
abstract void |
transform(java.awt.geom.AffineTransform at)
Transform the figure with the supplied transform.
|
void |
translate(double x,
double y)
Move the figure the indicated distance.
|
public boolean contains(java.awt.geom.Point2D p)
public java.awt.geom.Rectangle2D getBounds()
public Interactor getInteractor()
getInteractor
in interface Figure
Figure.setInteractor(Interactor)
public CanvasLayer getLayer()
public java.awt.geom.Point2D getOrigin()
getOrigin
in interface Figure
getBounds()
public CanvasComponent getParent()
getParent
in interface CanvasComponent
getParent
in interface Figure
Figure.setParent(CanvasComponent)
public abstract java.awt.Shape getShape()
public TransformContext getTransformContext()
getTransformContext
in interface CanvasComponent
public java.lang.String getToolTipText()
getToolTipText
in interface Figure
Figure.setToolTipText(String)
public java.lang.Object getUserObject()
getUserObject
in interface UserObjectContainer
public boolean hit(java.awt.geom.Rectangle2D r)
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface Figure
r
- The rectangle to be checked.public boolean isVisible()
isVisible
in interface VisibleComponent
public abstract void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
g
- The 2D graphics object that this object
it to be painted upon.public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D r)
paint
in interface VisibleComponent
g
- The 2D graphics object that this object
it to be painted upon.r
- The region.public void repaint()
repaint
in interface CanvasComponent
public void repaint(DamageRegion d)
repaint
in interface CanvasComponent
d
- The region where a repaint has occurred.public void setInteractor(Interactor interactor)
setInteractor
in interface Figure
interactor
- The interactor.Figure.getInteractor()
public void setParent(CanvasComponent fc)
setParent
in interface Figure
fc
- The parent of the figure.Figure.getParent()
public void setUserObject(java.lang.Object o)
setUserObject
in interface UserObjectContainer
o
- The user object.public void setToolTipText(java.lang.String s)
setToolTipText
in interface Figure
s
- The tool tip text.Figure.getToolTipText()
public void setVisible(boolean flag)
setVisible
in interface VisibleComponent
flag
- True if this object is to be visible.public abstract void transform(java.awt.geom.AffineTransform at)
public void translate(double x, double y)