Class CurvedPolyline

  • All Implemented Interfaces:
    Shape


    public class CurvedPolyline
    extends AbstractShape
    A polyline that adds curvature to all nodes.

    TODO: this is loosely based on my perception of how the Google Docs freehand shape tool works, but the magnitude of the tangents still requires some adjusting.

    See Also:
    com.bric.plaf.CurvedPolylineCreationUI
    • Field Detail

      • windingRule

        protected int windingRule
    • Constructor Detail

      • CurvedPolyline

        public CurvedPolyline()
    • Method Detail

      • addPoint

        public void addPoint(Point2D p)
        Add a point to this shape.
      • addPoint

        public void addPoint(double x,
                             double y)
        Add a point to this shape.
      • getPointCount

        public int getPointCount()
        Return the number of points.
      • getPoint

        public Point2D getPoint(int index)
        Returns a specified point.
      • setPoint

        public boolean setPoint(int index,
                                double x,
                                double y)
        Redefine an existing point.
        Parameters:
        index - the index of the point to redefine.
        x - the new x-coordinate.
        y - the new y-coordinate.
        Returns:
        true if a change occurred.
      • toString

        public String toString()
        This expresses this shape as a series of points, written as "m [X] [Y] l [X] [Y] l [X] [Y] ..." Note that although this shape includes cubic data, it is expressed simply as points (linear data).
      • getPathIterator

        public PathIterator getPathIterator(AffineTransform at)
        Return a PathIterator representing this shape. This is thread-safe
      • setWindingRule

        public boolean setWindingRule(int newWindingRule)
        Set a winding rule.
        Parameters:
        newWindingRule - PathIterator.WIND_EVEN_ODD or PathIterator.WIND_NON_ZERO.
        Returns:
        true if a change occurred.
      • getWindingRule

        public int getWindingRule()