Package jpicedt.graphic.view
Class DefaultHighlighterFactory.CompositeHighlighter
- java.lang.Object
-
- jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
-
- jpicedt.graphic.view.DefaultHighlighterFactory.CompositeHighlighter
-
- All Implemented Interfaces:
Highlighter
- Enclosing class:
- DefaultHighlighterFactory
public class DefaultHighlighterFactory.CompositeHighlighter extends DefaultHighlighterFactory.DefaultHighlighter
an Highlighter for a BranchElement
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGLOBAL_MODEHighlighting mode corresponding to the selection-handler behaving as if it were a PicGroup, hence its 8 control-points only are highlightedprotected java.lang.StringhighlightingModehighlight modestatic java.lang.StringLOCAL_MODEHighlighting mode corresponding to each Element belonging to the selection is highlighted-
Fields inherited from class jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
bounds, element, pointIndexIterator, ptBuffer, rectBuffer, shape
-
-
Constructor Summary
Constructors Constructor Description CompositeHighlighter(BranchElement e)construct a new Highlighter for the given PicGroup
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHighlightingMode()Return the current highlighting modeHitInfohitTest(PEMouseEvent e)Current implementation returns a HitInfo.Point if a click occured on one of the controlled-point indices returned bygetControlPointsIterator(); return null otherwise.voidpaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)Render the Highlighter to the given graphic context.voidsetHighlightingMode(java.lang.String mode)set the current highlighting mode ; this influences the way the Highligther is painted, but also the result returned by HitTest.protected voidsyncShape(double scale)Synchronize the array of "shapes" needed to paint this highlighter, with the model ;voidtoggleHighlightingMode()Toggle the current highlighting mode-
Methods inherited from class jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
changedUpdate, getBounds, getControlPointsIterator, getElement, getHighlighterFactory, syncBounds
-
-
-
-
Field Detail
-
LOCAL_MODE
public static final java.lang.String LOCAL_MODE
Highlighting mode corresponding to each Element belonging to the selection is highlighted- See Also:
- Constant Field Values
-
GLOBAL_MODE
public static final java.lang.String GLOBAL_MODE
Highlighting mode corresponding to the selection-handler behaving as if it were a PicGroup, hence its 8 control-points only are highlighted- See Also:
- Constant Field Values
-
highlightingMode
protected java.lang.String highlightingMode
highlight mode
-
-
Constructor Detail
-
CompositeHighlighter
public CompositeHighlighter(BranchElement e)
construct a new Highlighter for the given PicGroup
-
-
Method Detail
-
setHighlightingMode
public void setHighlightingMode(java.lang.String mode)
set the current highlighting mode ; this influences the way the Highligther is painted, but also the result returned by HitTest.- Parameters:
mode- or LOCAL_MODE or GLOBAL_MODE
-
getHighlightingMode
public java.lang.String getHighlightingMode()
Return the current highlighting mode
-
toggleHighlightingMode
public void toggleHighlightingMode()
Toggle the current highlighting mode
-
syncShape
protected void syncShape(double scale)
Synchronize the array of "shapes" needed to paint this highlighter, with the model ;- Overrides:
syncShapein classDefaultHighlighterFactory.DefaultHighlighter- Parameters:
scale- 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.
-
paint
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)Render the Highlighter to the given graphic context.- Specified by:
paintin interfaceHighlighter- Overrides:
paintin classDefaultHighlighterFactory.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.
-
hitTest
public HitInfo hitTest(PEMouseEvent e)
Description copied from class:DefaultHighlighterFactory.DefaultHighlighterCurrent implementation returns a HitInfo.Point if a click occured on one of the controlled-point indices returned bygetControlPointsIterator(); return null otherwise.- Specified by:
hitTestin interfaceHighlighter- Overrides:
hitTestin classDefaultHighlighterFactory.DefaultHighlighter- Returns:
- a HitInfo corresponding to the given mouse-event
-
-