Package jpicedt.graphic.view
Class DefaultHighlighterFactory.AbstractCurveHighlighter
- java.lang.Object
-
- jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
-
- jpicedt.graphic.view.DefaultHighlighterFactory.AbstractCurveHighlighter
-
- All Implemented Interfaces:
Highlighter
- Enclosing class:
- DefaultHighlighterFactory
public class DefaultHighlighterFactory.AbstractCurveHighlighter extends DefaultHighlighterFactory.DefaultHighlighter
a Highlighter for any concrete implementation of jpicedt.graphic.model.AbstractCurve. This comprises tangents for non-straight segments, and is wrapped into a GeneralPath.
-
-
Field Summary
-
Fields inherited from class jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
bounds, element, pointIndexIterator, ptBuffer, rectBuffer, shape
-
-
Constructor Summary
Constructors Constructor Description AbstractCurveHighlighter(AbstractCurve curve)construct a new Highlighter for the given curve
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpaint(java.awt.Graphics2D g, java.awt.geom.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 renders tangents, finally paint first subdivision-point in black to help user know where closed-curve start exactly.protected voidsyncShape(double scale)Synchronizes the highlighter's tangents with the model.-
Methods inherited from class jpicedt.graphic.view.DefaultHighlighterFactory.DefaultHighlighter
changedUpdate, getBounds, getControlPointsIterator, getElement, getHighlighterFactory, hitTest, syncBounds
-
-
-
-
Constructor Detail
-
AbstractCurveHighlighter
public AbstractCurveHighlighter(AbstractCurve curve)
construct a new Highlighter for the given curve
-
-
Method Detail
-
syncShape
protected void syncShape(double scale)
Synchronizes the highlighter's tangents 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.
Current implementation paints end-points using the highlighter color if the given allocation intersects the bounds of this view, then renders tangents, finally paint first subdivision-point in black to help user know where closed-curve start exactly.- Specified by:
paintin interfaceHighlighter- Overrides:
paintin 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 lines/rectangle/... appear with the same length on the screen whatever the scale factor that's set to the graphic context.allocation- current clipping
-
-