http://www.jpicedt.org

jpicedt.graphic.view.highlighter
Class SmoothPolygonHighlighter

java.lang.Object
  extended by jpicedt.graphic.view.highlighter.DefaultHighlighter
      extended by jpicedt.graphic.view.highlighter.SmoothPolygonHighlighter
All Implemented Interfaces:
Highlighter

public class SmoothPolygonHighlighter
extends DefaultHighlighter

a Highlighter for SmoothPolygon. So far, it is based on AbstractCurveHighlighter, except where computing tangents is concerned, since for SmoothPolygon's, tangents are specified by polygon-point's rather than Bezier-points.

Since:
jPicEdt 1.4
Version:
$Id: SmoothPolygonHighlighter.java,v 1.4 2013/03/27 06:54:06 vincentb1 Exp $
Author:
Sylvain Reynal

Field Summary
 
Fields inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter
bounds, element, factory, pointIndexIterator, ptBuffer, rectBuffer, shape
 
Constructor Summary
SmoothPolygonHighlighter(PicSmoothPolygon curve, DefaultHighlighterFactory f)
          construct a new Highlighter for the given smooth-polygon
 
Method Summary
 PicSmoothPolygon getElement()
          returns the higlighted Element
protected  void syncShape(double scale)
          Synchronizes the highlighter's tangents with the model.
 
Methods inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter
changedUpdate, getBounds, getControlPointsIterator, getHighlighterFactory, hitTest, intersect, paint, syncBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmoothPolygonHighlighter

public SmoothPolygonHighlighter(PicSmoothPolygon curve,
                                DefaultHighlighterFactory f)
construct a new Highlighter for the given smooth-polygon

Method Detail

getElement

public PicSmoothPolygon getElement()
Description copied from interface: Highlighter
returns the higlighted Element

Specified by:
getElement in interface Highlighter
Overrides:
getElement in class DefaultHighlighter
Returns:
the higlighted Element.

syncShape

protected void syncShape(double scale)
Synchronizes the highlighter's tangents with the model. This method is called from inside syncShape() only, and is overriden so as to compute tangents based on polygon's points rather than Bezier-points. Also compute the ``envelope'' polygon which is used for adding a new point (hitTest method).

Overrides:
syncShape in class 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.

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org