|
|||||||||
| 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.
| 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 Figurepublic java.awt.geom.Rectangle2D getBounds()
getBounds in interface Figurepublic Interactor getInteractor()
getInteractor in interface Figurepublic CanvasLayer getLayer()
getLayer in interface Figurepublic java.awt.geom.Point2D getOrigin()
getOrigin in interface FiguregetBounds()public CanvasComponent getParent()
getParent in interface CanvasComponentgetParent in interface Figurepublic abstract java.awt.Shape getShape()
getShape in interface Figurepublic TransformContext getTransformContext()
getTransformContext in interface CanvasComponentpublic java.lang.String getToolTipText()
getToolTipText in interface Figurepublic java.lang.Object getUserObject()
getUserObject in interface UserObjectContainerpublic boolean hit(java.awt.geom.Rectangle2D r)
hit in interface Figurepublic boolean intersects(java.awt.geom.Rectangle2D r)
intersects in interface Figurepublic boolean isVisible()
isVisible in interface VisibleComponentpublic 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 VisibleComponentpublic void repaint()
repaint in interface CanvasComponentpublic void repaint(DamageRegion d)
repaint in interface CanvasComponentpublic void setInteractor(Interactor interactor)
setInteractor in interface Figurepublic void setParent(CanvasComponent fc)
setParent in interface Figurepublic void setUserObject(java.lang.Object o)
setUserObject in interface UserObjectContainerpublic void setToolTipText(java.lang.String s)
setToolTipText in interface Figurepublic void setVisible(boolean flag)
setVisible in interface VisibleComponentpublic 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 | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||