http://www.jpicedt.org

jpicedt.graphic.view.highlighter
Class EllipseHighlighter

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

public class EllipseHighlighter
extends DefaultHighlighter

a Highlighter for PicEllipse's. This comprises control-points and the surrounding parallelogram.

Since:
jPicEdt 1.4
Version:
$Id: EllipseHighlighter.java,v 1.4 2013/03/27 06:54:26 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
EllipseHighlighter(PicEllipse ellipse, DefaultHighlighterFactory f)
          construct a new Highlighter for the given ellipse
 
Method Summary
 PicEllipse getElement()
          returns the higlighted Element
 void paint(Graphics2D g, Rectangle2D allocation, double scale)
          Render the Highlighter to the given graphic context.
protected  void syncShape(double scale)
          Synchronize the "shape" variable with the model.
 
Methods inherited from class jpicedt.graphic.view.highlighter.DefaultHighlighter
changedUpdate, getBounds, getControlPointsIterator, getHighlighterFactory, hitTest, intersect, syncBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EllipseHighlighter

public EllipseHighlighter(PicEllipse ellipse,
                          DefaultHighlighterFactory f)
construct a new Highlighter for the given ellipse

Method Detail

getElement

public PicEllipse 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)
Synchronize the "shape" variable with the model.

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.

paint

public void paint(Graphics2D g,
                  Rectangle2D allocation,
                  double scale)
Render the Highlighter to the given graphic context.
Current implementation paints end-points using the highlighter color if the given allocation intersects the bounds of this view, then paint the surrounding parallelogram.

Specified by:
paint in interface Highlighter
Overrides:
paint 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 lines/rectangle/... appear with the same length on the screen whatever the scale factor that's set to the graphic context.
allocation - current clipping

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org