Package jpicedt.graphic.view
Class DefaultViewFactory.AbstractCurveView
- java.lang.Object
-
- jpicedt.graphic.view.AbstractView
-
- jpicedt.graphic.view.DefaultViewFactory.LeafElementView
-
- jpicedt.graphic.view.DefaultViewFactory.AbstractCurveView
-
- All Implemented Interfaces:
View,ViewConstants
- Direct Known Subclasses:
EepicViewFactory.AbstractCurveView,LatexViewFactory.AbstractCurveView
- Enclosing class:
- DefaultViewFactory
public class DefaultViewFactory.AbstractCurveView extends DefaultViewFactory.LeafElementView
a View for rendering any concrete implementation of jpicedt.graphic.model.AbstractCurve
-
-
Field Summary
Fields Modifier and Type Field Description protected Arrowarrow1protected PicVectorarrow1Dirprotected PicPointarrow1Locprotected Arrowarrow2protected PicVectorarrow2Dirprotected PicPointarrow2Locprotected java.awt.StrokearrowStrokeprotected java.awt.PaintdotDrawPaintprotected java.awt.PaintdotFillPaintprotected java.awt.ShapedotShapeprotected java.awt.StrokedotStrokeprotected booleanhasSegmentsprotected booleanisDotFilled-
Fields inherited from class jpicedt.graphic.view.DefaultViewFactory.LeafElementView
interiorPaint, lineWidth, outlinePaint, outlineStroke, overStrikeWidth, shadowBounds, shape
-
Fields inherited from class jpicedt.graphic.view.AbstractView
bounds, element, highlighter
-
Fields inherited from interface jpicedt.graphic.view.ViewConstants
BARBELL_SIZE, CLICK_DISTANCE
-
-
Constructor Summary
Constructors Constructor Description AbstractCurveView(AbstractCurve curve)construct a new View 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 a)Render the View to the given graphic context.protected voidsyncAttributes()Inherits from superclass, except where painting dots is concerned, where this method delegates tosyncDotShape()to create the appropriate Shape.protected voidsyncDotShape()Computes the Shape (centered at 0,0) used for drawing polygon's dots, built from the given attributes ; set it to null if POLYDOTS_STYLE==NONE or if dotting is not supported by the factory.protected voidsyncShape()Synchronize the "shape" variable with the model.-
Methods inherited from class jpicedt.graphic.view.DefaultViewFactory.LeafElementView
changedUpdate, getViewFactory, hitTest, syncBounds
-
Methods inherited from class jpicedt.graphic.view.AbstractView
getBounds, getContainer, getDrawing, getElement, getGraphics, getHighlighter, getParentView, hitTest, paintHighlighter, repaint, setElement, setHighlighter
-
-
-
-
Field Detail
-
arrowStroke
protected java.awt.Stroke arrowStroke
-
arrow1
protected Arrow arrow1
-
arrow2
protected Arrow arrow2
-
arrow1Dir
protected PicVector arrow1Dir
-
arrow2Dir
protected PicVector arrow2Dir
-
arrow1Loc
protected PicPoint arrow1Loc
-
arrow2Loc
protected PicPoint arrow2Loc
-
hasSegments
protected boolean hasSegments
-
dotShape
protected java.awt.Shape dotShape
-
isDotFilled
protected boolean isDotFilled
-
dotStroke
protected java.awt.Stroke dotStroke
-
dotFillPaint
protected java.awt.Paint dotFillPaint
-
dotDrawPaint
protected java.awt.Paint dotDrawPaint
-
-
Constructor Detail
-
AbstractCurveView
public AbstractCurveView(AbstractCurve curve)
construct a new View for the given curve
-
-
Method Detail
-
syncShape
protected void syncShape()
Synchronize the "shape" variable with the model. To reduce the burden for subclasses, this method callssyncTangentsafter having updated theshapefield. It is up to subclasses to adapt their behaviour according to the underlying model, if only computing tangents is different.- Overrides:
syncShapein classDefaultViewFactory.LeafElementView
-
syncAttributes
protected void syncAttributes()
Inherits from superclass, except where painting dots is concerned, where this method delegates tosyncDotShape()to create the appropriate Shape.- Overrides:
syncAttributesin classDefaultViewFactory.LeafElementView
-
syncDotShape
protected void syncDotShape()
Computes the Shape (centered at 0,0) used for drawing polygon's dots, built from the given attributes ; set it to null if POLYDOTS_STYLE==NONE or if dotting is not supported by the factory.This method gets invoked by
syncAttributesas part of the delegation mechanism, when style of dots has changed.
-
paint
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D a)Render the View to the given graphic context.- Specified by:
paintin interfaceView- Overrides:
paintin classDefaultViewFactory.LeafElementViewa- the current graphic clip
-
-