Class MutablePath

  • All Implemented Interfaces:
    Shape


    public class MutablePath
    extends AbstractShape
    A shape that lets you modify individual segments.

    This shape has the notion of several distinct paths where each path begins with a separator moveoTo() instruction. There are some methods that treat this object as one long string of segments, and some methods that recognize that you can access each path separately.

    Several methods here match the signatures of GeneralPath methods for convenience. Internally field and methods are made private/final because of the thorough verification that happens as you manipulate this object: subclasses shouldn't let you position anything other than a SEG_MOVETO after a SEG_CLOSE, for example.

    • Constructor Detail

      • MutablePath

        public MutablePath(Shape s)
      • MutablePath

        public MutablePath()
    • Method Detail

      • setWindingRule

        public void setWindingRule(int newRule)
      • peek

        protected com.bric.geom.MutablePathSegment peek(int pathIndex)
      • close

        public void close()
      • close

        public void close(int pathIndex)
      • moveTo

        public int moveTo(double x,
                          double y)
        Parameters:
        x -
        y -
        Returns:
        the index of this new path
      • lineTo

        public void lineTo(double x,
                           double y)
      • lineTo

        public void lineTo(int pathIndex,
                           double x,
                           double y)
      • quadTo

        public void quadTo(double cx,
                           double cy,
                           double x,
                           double y)
      • quadTo

        public void quadTo(int pathIndex,
                           double cx,
                           double cy,
                           double x,
                           double y)
      • curveTo

        public void curveTo(double cx0,
                            double cy0,
                            double cx1,
                            double cy1,
                            double x,
                            double y)
      • curveTo

        public void curveTo(int pathIndex,
                            double cx0,
                            double cy0,
                            double cx1,
                            double cy1,
                            double x,
                            double y)
      • delete

        public void delete(int pathIndex,
                           int segmentIndex)
      • append

        public void append(Shape s)
      • releaseIterators

        protected void releaseIterators()
      • getPathCount

        public int getPathCount()
      • getSegmentCount

        public int getSegmentCount(int pathIndex)
      • getSegmentCount

        public int getSegmentCount()
      • getSegment

        public int getSegment(int pathIndex,
                              int segmentIndex,
                              double[] coords)
      • getSegment

        public int getSegment(int pathIndex,
                              int segmentIndex,
                              float[] coords)
      • getSegment

        public int getSegment(int index,
                              double[] coords)
      • getSegmentType

        public int getSegmentType(int pathIndex,
                                  int segmentIndex)
      • getSegmentType

        public int getSegmentType(int index)
      • getSegment

        public int getSegment(int index,
                              float[] coords)
      • setSegment

        public boolean setSegment(int pathIndex,
                                  int segmentIndex,
                                  int type,
                                  double[] coords)
      • setSegment

        public boolean setSegment(int index,
                                  int type,
                                  double[] coords)
        Redefine a segment. This lets you do anything without an exception: you could technically make a path begin a SEG_CLOSE, or place ten SEG_MOVETOs next to each other.
        Parameters:
        index -
        type -
        coords -
      • setSegment

        public boolean setSegment(int index,
                                  int type,
                                  float[] coords)
        Redefine a segment. This lets you do anything without an exception: you could technically make a path begin a SEG_CLOSE, or place ten SEG_MOVETOs next to each other.
        Parameters:
        index -
        type -
        coords -
      • isEmpty

        public boolean isEmpty()
      • reset

        public void reset()
      • getWindingRule

        public int getWindingRule()