|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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.
Yellow |
Field Summary | |
---|---|
private Interactor |
_interactor
The interactor |
private CanvasComponent |
_parent
This figure's parent |
private java.lang.String |
_toolTipText
The tooltip |
private java.lang.Object |
_userObject
The user object |
private boolean |
_visibility
The visibility flag. |
Constructor Summary | |
---|---|
AbstractFigure()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Interactor _interactor
private java.lang.Object _userObject
private boolean _visibility
private CanvasComponent _parent
private java.lang.String _toolTipText
Constructor Detail |
---|
public AbstractFigure()
Method Detail |
---|
public boolean contains(java.awt.geom.Point2D p)
contains
in interface Figure
public java.awt.geom.Rectangle2D getBounds()
getBounds
in interface Figure
public Interactor getInteractor()
getInteractor
in interface Figure
public CanvasLayer getLayer()
getLayer
in interface Figure
public java.awt.geom.Point2D getOrigin()
getOrigin
in interface Figure
getBounds()
public CanvasComponent getParent()
getParent
in interface CanvasComponent
getParent
in interface Figure
public abstract java.awt.Shape getShape()
getShape
in interface Figure
public TransformContext getTransformContext()
getTransformContext
in interface CanvasComponent
public java.lang.String getToolTipText()
getToolTipText
in interface Figure
public java.lang.Object getUserObject()
getUserObject
in interface UserObjectContainer
public boolean hit(java.awt.geom.Rectangle2D r)
hit
in interface Figure
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface Figure
public boolean isVisible()
isVisible
in interface VisibleComponent
public abstract void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
public void paint(java.awt.Graphics2D g, java.awt.geom.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(java.lang.Object o)
setUserObject
in interface UserObjectContainer
public void setToolTipText(java.lang.String s)
setToolTipText
in interface Figure
public void setVisible(boolean flag)
setVisible
in interface VisibleComponent
public abstract void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
public void translate(double x, double y)
translate
in interface Figure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |