http://www.jpicedt.org

jpicedt.graphic.view
Class AbstractCurveView

java.lang.Object
  extended by jpicedt.graphic.view.AbstractView
      extended by jpicedt.graphic.view.LeafElementView
          extended by jpicedt.graphic.view.AbstractCurveView
All Implemented Interfaces:
View
Direct Known Subclasses:
AbstractCurveView, AbstractCurveView

public class AbstractCurveView
extends LeafElementView

a View for rendering any concrete implementation of jpicedt.graphic.model.AbstractCurve. The added value wrt to LeafElementView is related to the painting of dots.


Field Summary
protected  Paint dotDrawPaint
           
protected  Paint dotFillPaint
           
protected  Shape dotShape
           
protected  ArrayList<Shape> dotShapeList
           
protected  Stroke dotStroke
           
 
Fields inherited from class jpicedt.graphic.view.LeafElementView
attrFactory, interiorPaint, leftArrow, outlinePaint, outlineStroke, overstrikeStroke, rightArrow, shadow, shadowPaint, shape
 
Fields inherited from class jpicedt.graphic.view.AbstractView
bounds, element, highlighter
 
Constructor Summary
AbstractCurveView(AbstractCurve curve, AttributesViewFactory f)
          construct a new View for the given curve
 
Method Summary
 void paint(Graphics2D g, Rectangle2D a)
          Render the View to the given graphic context.
protected  void syncArrowsAttributes()
          Synchronizes arrows' specific attributes with the model.
protected  void syncAttributes()
          Inherits from superclass, except where painting dots is concerned, where this method delegates to syncDotShapeAttributes() to create the appropriate Shape.
protected  void syncDotShapeAttributes()
          Computes the Shape (centered at 0,0) used for drawing polygon's dots, built from the current attributes; set this.dotShape to null if POLYDOTS_STYLE==NONE or if dotting is not supported by the factory.
protected  void syncDotShapeList()
          sync the ArrayList containing the dot's shapes to be painted, with the current model geometry.
protected  void syncShape()
          Inherits from superclass, except where updating dot's geometry is concerned, where this method delegates to syncDotShapeList() to create the appropriate Shape.
 
Methods inherited from class jpicedt.graphic.view.LeafElementView
changedUpdate, hitTest, intersect, syncArrowsGeometry, syncBounds, syncShadow
 
Methods inherited from class jpicedt.graphic.view.AbstractView
getBounds, getContainer, getDrawing, getElement, getGraphics, getHighlighter, getParentView, getViewFactory, hitTest, intersect, paintHighlighter, repaint, setElement, setHighlighter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dotShape

protected Shape dotShape

dotShapeList

protected ArrayList<Shape> dotShapeList

dotStroke

protected Stroke dotStroke

dotFillPaint

protected Paint dotFillPaint

dotDrawPaint

protected Paint dotDrawPaint
Constructor Detail

AbstractCurveView

public AbstractCurveView(AbstractCurve curve,
                         AttributesViewFactory f)
construct a new View for the given curve

Method Detail

syncArrowsAttributes

protected void syncArrowsAttributes()
Synchronizes arrows' specific attributes with the model. Called from syncAttributes(). This implementation creates arrows only if the model is an open curve.

Overrides:
syncArrowsAttributes in class LeafElementView

syncAttributes

protected void syncAttributes()
Inherits from superclass, except where painting dots is concerned, where this method delegates to syncDotShapeAttributes() to create the appropriate Shape.

Overrides:
syncAttributes in class LeafElementView

syncShape

protected void syncShape()
Inherits from superclass, except where updating dot's geometry is concerned, where this method delegates to syncDotShapeList() to create the appropriate Shape.

Overrides:
syncShape in class LeafElementView

syncDotShapeAttributes

protected void syncDotShapeAttributes()
Computes the Shape (centered at 0,0) used for drawing polygon's dots, built from the current attributes; set this.dotShape to null if POLYDOTS_STYLE==NONE or if dotting is not supported by the factory.

This method gets invoked by syncAttributes as part of the delegation mechanism, when dot's style has changed.


syncDotShapeList

protected void syncDotShapeList()
sync the ArrayList containing the dot's shapes to be painted, with the current model geometry. Called by changedUpdate() in response to a GEOMETRY_CHANGE event. Assume syncDotShapeAttributes() has been called before.


paint

public void paint(Graphics2D g,
                  Rectangle2D a)
Render the View to the given graphic context.

Specified by:
paint in interface View
Overrides:
paint in class LeafElementView
a - the current graphic clip

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org