public class DrawCompositeFigure extends BackgroundedCompositeFigure implements DrawFigure
All composite figures used on a Draw implementation should
be derived classes of this class, or implement the necessary code
to support the FigureListener class. They should also invoke
fireChanged in their translate and transform methods (but not if
calling super) and respect the transformFreely state.
Draw,
BackgroundedCompositeFigure,
DrawFigure| Modifier and Type | Field and Description |
|---|---|
protected EventListenerList |
listeners |
protected static boolean |
transformFreely
Hint that figures should ignore any transformation constraints
|
| Constructor and Description |
|---|
DrawCompositeFigure()
Construct a backgrounded composite figure with
no background and no children.
|
DrawCompositeFigure(Figure background)
Construct a backgrounded composite figure with the
given background and no children.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(FigureListener l)
Registers a listener for to be informed when figure changes
occur.
|
protected void |
fireChanged()
Send a FigureChangedEvent object specifying that this figure
has changed.
|
protected void |
fireCreated()
Send a FigureChangedEvent object specifying that this figure
has created to all listeners.
|
protected void |
fireRemoved()
Send a FigureChangedEvent object specifying that this figure
has been removed.
|
Composite |
getComposite()
Get the composite of the background figure.
|
Paint |
getFillPaint()
Get the fill paint of the background figure.
|
float |
getLineWidth()
Get line width
|
Paint |
getStrokePaint()
Get the outline paint of the background figure.
|
static boolean |
isTransformFreely()
Find out if this is an occasion when a figure should give up
any constraints and traneform freely.
|
void |
removeListener(FigureListener l)
Remove a listener.
|
void |
setComposite(AlphaComposite composite)
Set the composite of the background figure.
|
void |
setFillPaint(Paint fill)
Set the fill paint of the background figure.
|
void |
setLineWidth(float width)
Set line width
|
void |
setShape(Shape shape)
Set the background Figure using a Shape.
|
void |
setStrokePaint(Paint outline)
Set the outline paint of the background figure.
|
void |
setTransformFreely(boolean state)
Enable the hint that a figure should allow itself to transform
freely, rather than obey any constraints (this is meant for
figures that could not otherwise redraw themselves to fit a
resized
Draw, given their normal constraints,
e.g. |
void |
setVisible(boolean flag)
Set the visibility flag of this figure.
|
void |
transform(AffineTransform at)
Transform the figure.
|
void |
translate(double x,
double y)
Translate the figure the given distance, but only in X.
|
getBackgroundFigure, getBounds, paint, paint, pick, setBackgroundFigureadd, add, contains, figures, figuresFromBack, figuresFromFront, get, getChildren, getFigureCount, getOrigin, getShape, getTransformContext, indexOf, intersects, invalidateCachedBounds, pick, remove, remove, repaint, replaceChild, setIndex, toStringdecorate, undecoratecontains, getInteractor, getLayer, getParent, getToolTipText, getUserObject, hit, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, intersects, setInteractor, setParent, setToolTipTextisVisible, paint, paintgetTransformContext, repaint, repaintgetUserObject, setUserObjectprotected EventListenerList listeners
protected static boolean transformFreely
public DrawCompositeFigure()
public DrawCompositeFigure(Figure background)
public void translate(double x,
double y)
translate in interface Figuretranslate in class BackgroundedCompositeFigurepublic void transform(AffineTransform at)
transform in interface Figuretransform in class BackgroundedCompositeFigurepublic void setShape(Shape shape)
setShape in interface DrawFigurepublic void setFillPaint(Paint fill)
setFillPaint in interface DrawFigurepublic Paint getFillPaint()
getFillPaint in interface DrawFigurepublic void setStrokePaint(Paint outline)
setStrokePaint in interface DrawFigurepublic Paint getStrokePaint()
getStrokePaint in interface DrawFigurepublic void setComposite(AlphaComposite composite)
setComposite in interface DrawFigurepublic Composite getComposite()
getComposite in interface DrawFigurepublic void setLineWidth(float width)
setLineWidth in interface DrawFigurepublic float getLineWidth()
getLineWidth in interface DrawFigurepublic void setVisible(boolean flag)
AbstractFiguresetVisible in interface VisibleComponentsetVisible in interface DrawFiguresetVisible in class AbstractFigurepublic void addListener(FigureListener l)
addListener in interface DrawFigurel - the FigureListenerpublic void removeListener(FigureListener l)
removeListener in interface DrawFigurel - the FigureListenerprotected void fireCreated()
protected void fireRemoved()
protected void fireChanged()
public void setTransformFreely(boolean state)
Draw, given their normal constraints,
e.g. XRangeFigure).setTransformFreely in interface DrawFigurepublic static boolean isTransformFreely()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.