|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpicedt.graphic.view.highlighter.DefaultHighlighter
jpicedt.graphic.view.highlighter.CompositeHighlighter
public class CompositeHighlighter
A Highlighter for a BranchElement.
| Nested Class Summary | |
|---|---|
static class |
CompositeHighlighter.HighlightingMode
Local highlighting mode corresponding to each Element in the parent
BranchElement being highlighted Global highlighting mode corresponding to the 8 outer
control-points being highlighted |
| Field Summary | |
|---|---|
protected CompositeHighlighter.HighlightingMode |
highlightingMode
highlight mode (default to GLOBAL) |
| Fields inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter |
|---|
bounds, element, factory, pointIndexIterator, ptBuffer, rectBuffer, shape |
| Constructor Summary | |
|---|---|
CompositeHighlighter(BranchElement e,
DefaultHighlighterFactory f)
construct a new Highlighter for the given BranchElement. |
|
| Method Summary | |
|---|---|
BranchElement |
getElement()
returns the higlighted Element |
CompositeHighlighter.HighlightingMode |
getHighlightingMode()
Return the current highlighting mode. |
HitInfo |
hitTest(PEMouseEvent e)
Returns a HitInfo corresponding to the given mouse-event. |
boolean |
intersect(Rectangle2D r,
ArrayList<Element> list)
If this highligher intersects the given rectangle, add the associated BranchElement (or a
child Element thereof if it's more appropriate) and returns true. |
void |
paint(Graphics2D g,
Rectangle2D allocation,
double scale)
Render the Highlighter to the given graphic context. |
void |
setHighlightingMode(CompositeHighlighter.HighlightingMode mode)
set the current highlighting mode ; this influences the way the Highligther is painted,
but also the result returned by HitTest. |
protected void |
syncShape(double scale)
Synchronize the array of "shapes" needed to paint this highlighter, with the model ; |
void |
toggleHighlightingMode()
Toggle the current highlighting mode. |
| Methods inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter |
|---|
changedUpdate, getBounds, getControlPointsIterator, getHighlighterFactory, syncBounds |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CompositeHighlighter.HighlightingMode highlightingMode
GLOBAL)
| Constructor Detail |
|---|
public CompositeHighlighter(BranchElement e,
DefaultHighlighterFactory f)
Highlighter for the given BranchElement.
| Method Detail |
|---|
public BranchElement getElement()
Highlighter
getElement in interface HighlightergetElement in class DefaultHighlighterElement.public void setHighlightingMode(CompositeHighlighter.HighlightingMode mode)
Highligther is painted,
but also the result returned by HitTest.
mode - either LOCAL_MODE or GLOBAL_MODEpublic CompositeHighlighter.HighlightingMode getHighlightingMode()
public void toggleHighlightingMode()
protected void syncShape(double scale)
syncShape in class DefaultHighlighterscale - The current scale factor from-model-to-screen for the Graphics2D context ;
this may be used to scale down line thickess, etc… so that e.g. barbells appear with the
same size on the screen whatever the scale factor being set to the graphic context.
public void paint(Graphics2D g,
Rectangle2D allocation,
double scale)
GLOBAL mode, only the 8 control-points are rendered, whereas
in LOCAL mode, only children's highlighters are rendered.
paint in interface Highlighterpaint in class DefaultHighlighterallocation - current clippingscale - The current scale factor from-model-to-screen for the Graphics2D context ;
this may be used to scale down line thickess, etc… so that e.g. barbells appear with the
same size on the screen whatever the scale factor being set to the graphic context.public HitInfo hitTest(PEMouseEvent e)
HitInfo corresponding to the given mouse-event. In GLOBAL mode, hit
test occurs on the 8 control-points and the highlighter's stroke, while in LOCAL mode, it
occurs on the children's view and highlighter. Note that in the latter case, the returned
HitInfo is the same as the one given by invoking hitTest() directly on the
corresponding child (i.e., no HitInfo.Composite is returned whatsoever).
hitTest in interface HighlighterhitTest in class DefaultHighlighter
public boolean intersect(Rectangle2D r,
ArrayList<Element> list)
BranchElement (or a
child Element thereof if it's more appropriate) and returns true.
intersect in interface Highlighterintersect in class DefaultHighlighter
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||