|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
public abstract class AbstractFigure
AbstractFigure is an abstract superclass implementing the Figure interface. Each subclass is assumed to have some persistent screen representation. They are responsible for knowing how to repaint themselves on the screen and find out where they and how to move themselves. They are not required to know when to repaint, as that is done by the canvas they are drawn on.
Constructor Summary | |
---|---|
AbstractFigure()
|
Method Summary | |
---|---|
boolean |
contains(Point2D p)
Test whether this figure contains the point given. |
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. |
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 Shape |
getShape()
Get the outline shape of this figure. |
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. |
Object |
getUserObject()
Get the user object of this figure. |
boolean |
hit(Rectangle2D r)
Test if this figure intersects the given rectangle, and the interior of the figure is not transparent to hits. |
boolean |
intersects(Rectangle2D r)
Test if this figure intersects the given rectangle. |
boolean |
isVisible()
Test the visibility flag of this figure. |
abstract void |
paint(Graphics2D g)
Paint the figure. |
void |
paint(Graphics2D g,
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(String s)
Set the tooltip string for this figure. |
void |
setUserObject(Object o)
Set the user object. |
void |
setVisible(boolean flag)
Set the visibility flag of this figure. |
abstract void |
transform(AffineTransform at)
Transform the figure with the supplied transform. |
void |
translate(double x,
double y)
Move the figure the indicated distance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractFigure()
Method Detail |
---|
public boolean contains(Point2D p)
contains
in interface Figure
public Rectangle2D getBounds()
getBounds
in interface Figure
public Interactor getInteractor()
getInteractor
in interface Figure
public CanvasLayer getLayer()
getLayer
in interface Figure
public Point2D getOrigin()
getOrigin
in interface Figure
getBounds()
public CanvasComponent getParent()
getParent
in interface CanvasComponent
getParent
in interface Figure
public abstract Shape getShape()
getShape
in interface Figure
public TransformContext getTransformContext()
getTransformContext
in interface CanvasComponent
public String getToolTipText()
getToolTipText
in interface Figure
public Object getUserObject()
getUserObject
in interface UserObjectContainer
public boolean hit(Rectangle2D r)
hit
in interface Figure
public boolean intersects(Rectangle2D r)
intersects
in interface Figure
public boolean isVisible()
isVisible
in interface VisibleComponent
public abstract void paint(Graphics2D g)
paint
in interface VisibleComponent
public void paint(Graphics2D g, Rectangle2D r)
paint
in interface VisibleComponent
public void repaint()
repaint
in interface CanvasComponent
public void repaint(DamageRegion d)
repaint
in interface CanvasComponent
public void setInteractor(Interactor interactor)
setInteractor
in interface Figure
public void setParent(CanvasComponent fc)
setParent
in interface Figure
public void setUserObject(Object o)
setUserObject
in interface UserObjectContainer
public void setToolTipText(String s)
setToolTipText
in interface Figure
public void setVisible(boolean flag)
setVisible
in interface VisibleComponent
public abstract void transform(AffineTransform at)
transform
in interface Figure
public void translate(double x, double y)
translate
in interface Figure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |