http://www.jpicedt.org

jpicedt.graphic.view
Class DefaultHighlighterFactory.CompositeHighlighter

java.lang.Object
  extended by jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
      extended by 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
static 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
protected  java.lang.String highlightingMode
          highlight mode
static java.lang.String LOCAL_MODE
          Highlighting 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
DefaultHighlighterFactory.CompositeHighlighter(BranchElement e)
          construct a new Highlighter for the given PicGroup
 
Method Summary
 java.lang.String getHighlightingMode()
          Return the current highlighting mode
 HitInfo hitTest(PEMouseEvent e)
          Current implementation returns a HitInfo.Point if a click occured on one of the controlled-point indices returned by getControlPointsIterator() ; return null otherwise.
 void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D allocation, double scale)
          Render the Highlighter to the given graphic context.
 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.
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.DefaultHighlighterFactory.DefaultHighlighter
changedUpdate, getBounds, getControlPointsIterator, getElement, getHighlighterFactory, syncBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

DefaultHighlighterFactory.CompositeHighlighter

public DefaultHighlighterFactory.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:
syncShape in class DefaultHighlighterFactory.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:
paint in interface Highlighter
Overrides:
paint in class DefaultHighlighterFactory.DefaultHighlighter
allocation - current clipping
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.

hitTest

public HitInfo hitTest(PEMouseEvent e)
Description copied from class: DefaultHighlighterFactory.DefaultHighlighter
Current implementation returns a HitInfo.Point if a click occured on one of the controlled-point indices returned by getControlPointsIterator() ; return null otherwise.

Specified by:
hitTest in interface Highlighter
Overrides:
hitTest in class DefaultHighlighterFactory.DefaultHighlighter
Returns:
a HitInfo corresponding to the given mouse-event

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org