Package com.jgraph.gaeawt.java.awt.geom

Examples of com.jgraph.gaeawt.java.awt.geom.PathIterator


     * @param flatness - the rasterization flatness
     * @return a MultiRectArea of rasterized shape
     */
    public MultiRectArea rasterize(Shape shape, double flatness) {

        PathIterator path = shape.getPathIterator(null, flatness);

        // Shape is empty
        if (path.isDone()) {
            return new MultiRectArea();
        }

        makeBuffer(path, flatness);

View Full Code Here


      //TODO: Think about drawing the shape in one fillMultiRectArea call
      BasicStroke bstroke = (BasicStroke) stroke;
      JavaLineRasterizer.LineDasher ld = (bstroke.getDashArray() == null) ? null
          : new JavaLineRasterizer.LineDasher(bstroke.getDashArray(),
              bstroke.getDashPhase());
      PathIterator pi = s.getPathIterator(transform, 0.5);
      float[] points = new float[6];
      int x1 = Integer.MIN_VALUE;
      int y1 = Integer.MIN_VALUE;
      int cx1 = Integer.MIN_VALUE;
      int cy1 = Integer.MIN_VALUE;
      while (!pi.isDone())
      {
        switch (pi.currentSegment(points))
        {
          case PathIterator.SEG_MOVETO:
            x1 = (int) Math.floor(points[0]);
            y1 = (int) Math.floor(points[1]);
            cx1 = x1;
            cy1 = y1;
            break;
          case PathIterator.SEG_LINETO:
            int x2 = (int) Math.floor(points[0]);
            int y2 = (int) Math.floor(points[1]);
            fillMultiRectArea(JavaLineRasterizer.rasterize(x1, y1,
                x2, y2, null, ld, false));
            x1 = x2;
            y1 = y2;
            break;
          case PathIterator.SEG_CLOSE:
            x2 = cx1;
            y2 = cy1;
            fillMultiRectArea(JavaLineRasterizer.rasterize(x1, y1,
                x2, y2, null, ld, false));
            x1 = x2;
            y1 = y2;
            break;
        }
        pi.next();
      }
    }
    else
    {
      s = stroke.createStrokedShape(s);
View Full Code Here

    }, null);
  }

  private static void addToInstructionStream(InstructionStream is, Shape s)
  {
    PathIterator pi = s.getPathIterator(null);
    float[] coords = new float[6];

    while (!pi.isDone())
    {
      addPoints(is, pi, coords);
      pi.next();
    }
  }
View Full Code Here

TOP

Related Classes of com.jgraph.gaeawt.java.awt.geom.PathIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.