public interface Doodle
Details:
A Doodle
is a single, independent component of a Figure
.
Each doodle defines its boundaries, appearance, and relative depth in the figure.
Modifier and Type | Method and Description |
---|---|
boolean |
contains(AffineTransform iTransform,
Point2D iPoint)
Tests point for contact with doodle.
|
boolean |
draw(FigGraphics iG)
Renders doodle.
|
Rectangle2D |
getBounds(AffineTransform iTransform,
Rectangle2D oBounds)
Returns rectangular extent.
|
float |
getZOrder()
Determines rendering priority for overlapping shapes.
|
void |
setParent(ParentDoodle iParent)
Sets container.
|
void setParent(ParentDoodle iParent)
Details:
When a Doodle
is added to a CompoundDoodle
or directly to a Figure
, or set as the target of a decorator, this method is called to inform this Doodle
about its new container.
This hook is offered for convenience, and the implementation is not obligated to actually track its container if it doesn't want to.
However, by remembering its container, this Doodle
will be able to send refresh notices when it changes its own appearance.
Note that the containment model suggested by this method does not adequately deal with the situation where a Doodle
has more than one container.
If you wish to do something like this, you're on your own. :-)
iParent
- the containerboolean draw(FigGraphics iG)
Details:
draw(FigGraphics)
renders this doodle using the supplied graphics environment.
When the host FigureView
is repainting itself, it will probably call this method, albeit indirectly, to redraw its figure's components.
This method returns true
if drawing was successful, false
otherwise.
iG
- the graphics contextfloat getZOrder()
Details:
When two doodles in a figure overlap, one doodle must be displayed above the other.
getZOrder()
is called to determine which doodle is "higher."
Greater values win.
Rectangle2D getBounds(AffineTransform iTransform, Rectangle2D oBounds)
Details:
This method returns the rectangular extent of this Doodle
.
The rectangle returned is in logical (i.e. figure) units, not display units.
A provided AffineTransform
reveals the characteristics of the viewing context in which the bounds will be considered.
This information is meaningful only in Doodle
s that alter their logical form to accommodate the view, such as ViewDoodle
.
Most implementations will simply ignore this transform, and in some cases, this transform may be null
, indicating that the transform is a "don't-
Optionally, the caller may pass in a pre-null
, a new rectangle will be instantiated, initialized with the result, and returned.
In either case, the rectangle containing the result is returned.
iTransform
- the current viewing transformoBounds
- destination for resultboolean contains(AffineTransform iTransform, Point2D iPoint)
Details:
contains(AffineTransform, Point2D)
returns true
if the given point lies on this doodle, false
otherwise.
A provided AffineTransform
reveals the characteristics of the view where containment is being tested.
This is useful only for Doodle
s that alter their logical form in order to accommodate the view.
Most implementations will simply ignore this transform, and in some cases, this transform may be null
, indicating that the transform is not to be considered.
In any case, the point being tested is already in figure coordinates.
iTransform
- current viewing transformiPoint
- point to testCopyright © 2013. All Rights Reserved.