public class ExcitableFigure extends Figure
Figure with features to support "excitability," or the ability to render a portion of the figure in an "excited" state, such as seen during mouse-
ExcitableDoodle to provide this feature.
In applications, a single figure may be rendered simultaneously in multiple views.
When the mouse hovers over a
Doodle, three behaviors are possible:
The most appropriate behavior depends on the application. This class supports all three behaviors.
|Constructor and Description|
|Modifier and Type||Method and Description|
Enables responses to mouse movement.
add, remove, sendDoodleChanged, subscribe, unsubscribe
contains, draw, getBounds, getDoodles, getDoodlesAt, getZOrder, hasDescendant, identifyDoodle, setZOrder
getDefaultOrigin, getParent, redraw, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void mouseMoved(InteractiveFigureView iView, Point2D iPoint, AffineTransform iTransform)
mouseMoved is called by
InteractiveFigureViewDelegate whenever the mouse has moved over this figure.
This allows the figure to support interactive functions which may be implemented in subclasses.
iView- the widget experiencing the mouse move
iPoint- the logical position of the mouse
public boolean paint(FigGraphics iG)
paint renders this figure using the supplied graphics environment.
Before this figure can be rendered correctly, its member shapes must be sorted by Z-
draw takes a "lazy" approach by re-sorting its members only when it has reason to believe that they may be unsorted.
There are two possible situations where re-sorting can be triggered:
1. Shapes have been added to this figure since the last time the collection was sorted.
When this situation occurs,
paint re-sorts the collection immediately before paint the figure.
2. While drawing the figure,
paint discovers unsorted shapes.
In this case, some painting may have already occurred, and
paint cannot continue, because continuing would result in an incorrect result.
paint simply re-
paint's only recourse is to abort the operation and signal to the client that it was unsuccessful.
It is then up to the client to call
The next time the client calls
paint will re-
The view, supplied as a
InteractiveFigureView, allows shapes to customize their appearance for various views.
For example, a shape could be configured to be invisible in one view, and visible in another.
Use of this parameter is optional, and
null is an acceptable value.
The caller of
paint should set this parameter to the widget on which the figure is being drawn.
(This model presupposes that each widget will only display one figure, an assumption that may be abandoned in the future.)
true if drawing was successful,
Copyright © 2013. All Rights Reserved.