|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.AbstractFigureContainer
diva.canvas.CompositeFigure
diva.canvas.toolbox.BackgroundedCompositeFigure
uk.ac.starlink.diva.DrawCompositeFigure
public class DrawCompositeFigure
DrawCompositeFigure extends the Diva BackgroundedCompositeFigure class to add support for events that allow users of any derived figures to be made aware of any changes, i.e. composite figure creation, removal and transformations.
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
Field Summary | |
---|---|
protected EventListenerList |
listeners
|
protected static boolean |
transformFreely
Hint that figures should ignore any transformation constraints |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class diva.canvas.toolbox.BackgroundedCompositeFigure |
---|
getBackgroundFigure, getBounds, paint, paint, pick, setBackgroundFigure |
Methods inherited from class diva.canvas.CompositeFigure |
---|
add, add, contains, figures, figuresFromBack, figuresFromFront, get, getChildren, getFigureCount, getOrigin, getShape, getTransformContext, indexOf, intersects, invalidateCachedBounds, pick, remove, remove, repaint, replaceChild, setIndex, toString |
Methods inherited from class diva.canvas.AbstractFigureContainer |
---|
decorate, undecorate |
Methods inherited from class diva.canvas.AbstractFigure |
---|
contains, getInteractor, getLayer, getParent, getToolTipText, getUserObject, hit, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface diva.canvas.Figure |
---|
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, intersects, setInteractor, setParent, setToolTipText |
Methods inherited from interface diva.canvas.VisibleComponent |
---|
isVisible, paint, paint |
Methods inherited from interface diva.canvas.CanvasComponent |
---|
getTransformContext, repaint, repaint |
Methods inherited from interface diva.util.UserObjectContainer |
---|
getUserObject, setUserObject |
Field Detail |
---|
protected EventListenerList listeners
protected static boolean transformFreely
Constructor Detail |
---|
public DrawCompositeFigure()
public DrawCompositeFigure(Figure background)
Method Detail |
---|
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |