public class CompositeFigure extends AbstractFigureContainer
| Constructor and Description |
|---|
CompositeFigure()
Create a new composite figure containing no figures.
|
CompositeFigure(Figure background)
Construct a composite figure with the given figure as its
background.
|
CompositeFigure(ZList zlist)
Create a new composite figure containing no figures,
that uses the given z-list for its storage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Figure f)
Add a child figure to this composite.
|
void |
add(int index,
Figure f)
Insert a figure at the given position.
|
boolean |
contains(Figure f)
Test if the given figure is a child of this composite.
|
Iterator |
figures()
Return an iteration of the children, in an undefined order.
|
Iterator |
figuresFromBack()
Return an iteration of the children, from back to front.
|
Iterator |
figuresFromFront()
Return an iteration of the children, from front to back.
|
Figure |
get(int index)
Return the figure at the given index.
|
Figure |
getBackgroundFigure()
Get the background figure.
|
Rectangle2D |
getBounds()
Get the bounding box of this figure.
|
ZList |
getChildren()
Get the internal z-list.
|
int |
getFigureCount()
Return the number of elements in this container.
|
Point2D |
getOrigin()
Return the origin of the background figure in the enclosing
transform context.
|
Shape |
getShape()
Get the shape of this figure.
|
TransformContext |
getTransformContext()
Return the transform context of this figure.
|
int |
indexOf(Figure f)
Return the index of the given figure in the Z-list, or -1
if the figure is not in this list.
|
boolean |
intersects(Rectangle2D region)
Test if this figure intersects the given rectangle.
|
protected void |
invalidateCachedBounds() |
void |
paint(Graphics2D g)
Paint this composite figure onto a 2D graphics object.
|
void |
paint(Graphics2D g,
Rectangle2D region)
Paint this composite figure onto a 2D graphics object, within
the given region.
|
Figure |
pick(Rectangle2D region)
Get the picked figure.
|
Figure |
pick(Rectangle2D region,
Filter filter)
Given a rectangle, return the top-most descendent figure
that it hits that is accepted by the given filter.
|
void |
remove(Figure f)
Remove the given child from this composite.
|
void |
remove(int index)
Remove the figure at the given position in the list.
|
void |
repaint(DamageRegion d)
Accept notification that a repaint has occurred somewhere
in the hierarchy below this container.
|
protected void |
replaceChild(Figure child,
Figure replacement)
Replace the first figure, which must be a child, with the
second, which must not be a child.
|
void |
setBackgroundFigure(Figure background)
Set the background figure.
|
void |
setIndex(int index,
Figure f)
Set the index of the given figure.
|
String |
toString()
Return a string description of this figure
|
void |
transform(AffineTransform at)
Transform this figure with the supplied transform.
|
void |
translate(double x,
double y)
Translate this figure the given distance.
|
decorate, undecoratecontains, getInteractor, getLayer, getParent, getToolTipText, getUserObject, hit, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisVisible, setVisiblegetParent, repaintpublic CompositeFigure()
public CompositeFigure(ZList zlist)
public CompositeFigure(Figure background)
public void add(Figure f)
public void add(int index,
Figure f)
public boolean contains(Figure f)
contains in interface FigureContainercontains in interface FigureSetcontains in class AbstractFigureContainerpublic Iterator figures()
figures in interface FigureSetfigures in class AbstractFigureContainerpublic Iterator figuresFromBack()
figuresFromBack in interface FigureSetfiguresFromBack in class AbstractFigureContainerpublic Iterator figuresFromFront()
figuresFromFront in interface FigureSetfiguresFromFront in class AbstractFigureContainerpublic Figure get(int index)
IndexOutOfBoundsException - The index is out of range.public Figure getBackgroundFigure()
public Rectangle2D getBounds()
getBounds in interface FiguregetBounds in class AbstractFigurepublic ZList getChildren()
public int getFigureCount()
getFigureCount in interface FigureContainergetFigureCount in class AbstractFigureContainerpublic Point2D getOrigin()
getOrigin in interface FiguregetOrigin in class AbstractFigureAbstractFigure.getBounds()public Shape getShape()
getShape in interface FiguregetShape in class AbstractFigurepublic TransformContext getTransformContext()
getTransformContext in interface CanvasComponentgetTransformContext in class AbstractFigurepublic int indexOf(Figure f)
public boolean intersects(Rectangle2D region)
intersects in interface Figureintersects in class AbstractFigureprotected void invalidateCachedBounds()
public void paint(Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigureContainerpublic void paint(Graphics2D g, Rectangle2D region)
paint in interface VisibleComponentpaint in class AbstractFigurepublic Figure pick(Rectangle2D region)
pick in interface FigureContainerpick in class AbstractFigureContainerpublic Figure pick(Rectangle2D region, Filter filter)
pick in interface FigureContainerpick in class AbstractFigureContainerpublic void remove(Figure f)
public void remove(int index)
IndexOutOfBoundsException - The index is out of range.public void repaint(DamageRegion d)
repaint in interface CanvasComponentrepaint in class AbstractFigureContainerpublic void setBackgroundFigure(Figure background)
public void setIndex(int index,
Figure f)
IndexOutOfBoundsException - The new index is out of range.protected void replaceChild(Figure child, Figure replacement)
replaceChild in class AbstractFigureContainerpublic String toString()
public void transform(AffineTransform at)
transform in interface Figuretransform in class AbstractFigureContainerpublic void translate(double x,
double y)
translate in interface Figuretranslate in class AbstractFigureContainerCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.