|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.toolbox.PathFigure
uk.ac.starlink.diva.DrawPathFigure
public class DrawPathFigure
DrawPathFigure extends the diva PathFigure class to add support for events that allow users of any derived figures to be made aware of any changes, i.e. figure creation, removal and transformations.
This base class should be used for non-filled figures, use DrawBasicFigure for filled types.
All figures used on a Draw
should be derived classes of this class
or DrawBasicFigure, or implement the necessary code to support the
DrawFigure
interface. They should also invoke fireChanged in their
translate and transform methods (but not if calling super) and
respect the transformFreely state.
Field Summary | |
---|---|
protected EventListenerList |
listeners
|
protected static boolean |
transformFreely
Hint that figures should ignore any transformation constraints. |
Constructor Summary | |
---|---|
DrawPathFigure(Shape shape)
Create a new figure with the given shape. |
|
DrawPathFigure(Shape shape,
float lineWidth)
Create a new figure with the given shape and width. |
|
DrawPathFigure(Shape shape,
Paint paint,
float lineWidth)
Create a new figure with the given paint and width. |
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. |
Paint |
getFillPaint()
Get the fill 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 |
setFillPaint(Paint fill)
Set the fill 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 with the supplied transform. |
void |
translate(double x,
double y)
Translate the figure with by the given distance. |
Methods inherited from class diva.canvas.toolbox.PathFigure |
---|
getBounds, getComposite, getDashArray, getLineWidth, getShape, getStroke, getStrokePaint, hit, paint, setComposite, setDashArray, setLineWidth, setShape, setStroke, setStrokePaint |
Methods inherited from class diva.canvas.AbstractFigure |
---|
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.ac.starlink.diva.DrawFigure |
---|
getComposite, getLineWidth, getStrokePaint, setComposite, setLineWidth, setShape, setStrokePaint |
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 static boolean transformFreely
protected EventListenerList listeners
Constructor Detail |
---|
public DrawPathFigure(Shape shape)
public DrawPathFigure(Shape shape, float lineWidth)
public DrawPathFigure(Shape shape, Paint paint, float lineWidth)
Method Detail |
---|
public void setFillPaint(Paint fill)
setFillPaint
in interface DrawFigure
public Paint getFillPaint()
getFillPaint
in interface DrawFigure
public void transform(AffineTransform at)
transform
in interface Figure
transform
in class PathFigure
public void translate(double x, double y)
translate
in interface Figure
translate
in class PathFigure
public void setVisible(boolean flag)
AbstractFigure
setVisible
in interface VisibleComponent
setVisible
in interface DrawFigure
setVisible
in class AbstractFigure
public void setTransformFreely(boolean state)
Draw
, given their normal constraints,
e.g. XRangeFigure).
setTransformFreely
in interface DrawFigure
public static boolean isTransformFreely()
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |