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, setBackgroundFigure
add, add, contains, figures, figuresFromBack, figuresFromFront, get, getChildren, getFigureCount, getOrigin, getShape, getTransformContext, indexOf, intersects, invalidateCachedBounds, pick, remove, remove, repaint, replaceChild, setIndex, toString
decorate, undecorate
contains, getInteractor, getLayer, getParent, getToolTipText, getUserObject, hit, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, intersects, setInteractor, setParent, setToolTipText
isVisible, paint, paint
getTransformContext, repaint, repaint
getUserObject, setUserObject
protected EventListenerList listeners
protected static boolean transformFreely
public DrawCompositeFigure()
public DrawCompositeFigure(Figure background)
public void translate(double x, double y)
translate
in interface Figure
translate
in class BackgroundedCompositeFigure
public void transform(AffineTransform at)
transform
in interface Figure
transform
in class BackgroundedCompositeFigure
public void setShape(Shape shape)
setShape
in interface DrawFigure
public void setFillPaint(Paint fill)
setFillPaint
in interface DrawFigure
public Paint getFillPaint()
getFillPaint
in interface DrawFigure
public void setStrokePaint(Paint outline)
setStrokePaint
in interface DrawFigure
public Paint getStrokePaint()
getStrokePaint
in interface DrawFigure
public void setComposite(AlphaComposite composite)
setComposite
in interface DrawFigure
public Composite getComposite()
getComposite
in interface DrawFigure
public void setLineWidth(float width)
setLineWidth
in interface DrawFigure
public float getLineWidth()
getLineWidth
in interface DrawFigure
public void setVisible(boolean flag)
AbstractFigure
setVisible
in interface VisibleComponent
setVisible
in interface DrawFigure
setVisible
in class AbstractFigure
public void addListener(FigureListener l)
addListener
in interface DrawFigure
l
- the FigureListenerpublic void removeListener(FigureListener l)
removeListener
in interface DrawFigure
l
- 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 DrawFigure
public static boolean isTransformFreely()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.