public abstract class AbstractFigureContainer extends AbstractFigure implements FigureContainer
Constructor and Description |
---|
AbstractFigureContainer() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
contains(Figure f)
Test if the given figure is a child of this composite.
|
void |
decorate(Figure child,
FigureDecorator decorator)
Decorate a child figure, replacing the reference to the
child figure with the decorator.
|
abstract java.util.Iterator |
figures()
Return an iteration of the children, in an undefined order.
|
abstract java.util.Iterator |
figuresFromBack()
Return an iteration of the children, from
back to front.
|
abstract java.util.Iterator |
figuresFromFront()
Return an iteration of the children, from
front to back.
|
abstract int |
getFigureCount()
Return the number of child figures in this container.
|
void |
paint(java.awt.Graphics2D g)
Paint this composite figure onto a 2D graphics object.
|
Figure |
pick(java.awt.geom.Rectangle2D region)
Given a rectangle, return the top-most descendent figure
that it hits.
|
Figure |
pick(java.awt.geom.Rectangle2D region,
Filter filter)
Given a rectangle, return the top-most descendent figure
that it hits that is accepted by the given filter.
|
void |
repaint(DamageRegion d)
Accept notification that a repaint has occurred somewhere
in the hierarchy below this container.
|
protected abstract void |
replaceChild(Figure child,
Figure replacement)
Replace the first figure with the second.
|
void |
transform(java.awt.geom.AffineTransform at)
Transform this figure with the supplied transform.
|
void |
translate(double x,
double y)
Translate this figure by the given distance.
|
void |
undecorate(FigureDecorator decorator)
Remove a figure from the given decorator and add
it back into this container.
|
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, remove
isVisible, paint, setVisible
getParent, getTransformContext, repaint
public void decorate(Figure child, FigureDecorator decorator)
decorate
in interface FigureContainer
child
- The child figure.decorator
- The decorator.public abstract boolean contains(Figure f)
contains
in interface FigureContainer
contains
in interface FigureSet
f
- The figure to be searched forpublic abstract java.util.Iterator figures()
public abstract java.util.Iterator figuresFromBack()
figuresFromBack
in interface FigureSet
public abstract java.util.Iterator figuresFromFront()
figuresFromFront
in interface FigureSet
public abstract int getFigureCount()
getFigureCount
in interface FigureContainer
public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
g
- The 2D graphics object that this object
it to be painted upon.public Figure pick(java.awt.geom.Rectangle2D region)
pick
in interface FigureContainer
region
- The rectanglepublic Figure pick(java.awt.geom.Rectangle2D region, Filter filter)
pick
in interface FigureContainer
region
- The rectanglefilter
- The filterpublic void repaint(DamageRegion d)
repaint
in interface CanvasComponent
repaint
in class AbstractFigure
d
- The region where a repaint has occurred.protected abstract void replaceChild(Figure child, Figure replacement)
child
- The figure to be replaced.replacement
- The replacement figure.public void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
at
- The transform to be used.public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
x
- The x value to be moved.y
- The y value to be moved.public void undecorate(FigureDecorator decorator)
undecorate
in interface FigureContainer
decorator
- The decorator