Package java.awt.geom

Examples of java.awt.geom.PathIterator.currentSegment()


            //dx = xoff;
            //dy = yoff;
            PathIterator it = area.getPathIterator(null);
            while(!it.isDone()) {
                double[] coords = new double[6];
                int n = it.currentSegment(coords);
                if(n == PathIterator.SEG_MOVETO) {
                    out.println(".moveTo("+(coords[0]-dx)+","+(coords[1]-dy)+")");
                }
                if(n == PathIterator.SEG_LINETO) {
                    out.println(".lineTo("+(coords[0]-dx)+","+(coords[1]-dy)+")");
View Full Code Here


            int count = 0;
            Area area = shape.toArea();
            PathIterator it = area.getPathIterator(new AffineTransform());
            while(!it.isDone()) {
                double[] coords = new double[6];
                int n = it.currentSegment(coords);
                if(n == PathIterator.SEG_MOVETO) {
                    data.append(" M "+coords[0]+" "+coords[1]);
                }
                if(n == PathIterator.SEG_LINETO) {
                    data.append(" L " + coords[0]+" " +coords[1]);
View Full Code Here

            SArea area = (SArea) shape;
            Area jarea = area.toArea();
            PathIterator it = jarea.getPathIterator(null);
            while(!it.isDone()) {
                double[] coords = new double[6];
                int n = it.currentSegment(coords);
                if(n == PathIterator.SEG_MOVETO) {
                    out.start("move","x",""+coords[0],"y",""+coords[1]).end();
                }
                if(n == PathIterator.SEG_LINETO) {
                    out.start("lineto","x",""+coords[0],"y",""+coords[1]).end();
View Full Code Here

                    out.println("ctx.beginPath()");

                    PathIterator it = area.getPathIterator(null);
                    while(!it.isDone()) {
                        double[] coords = new double[6];
                        int n = it.currentSegment(coords);
                        if(n == PathIterator.SEG_MOVETO) {
                            out.println("ctx.moveTo("+(coords[0]-dx)+","+(coords[1]-dy)+");");
                        }
                        if(n == PathIterator.SEG_LINETO) {
                            out.println("ctx.lineTo("+(coords[0]-dx)+","+(coords[1]-dy)+");");
View Full Code Here

                                glyphOrientationAngle = 0;
                        }
                    }

                    while (!pi.isDone()) {
                        type = pi.currentSegment(pts);
                        if ((type == PathIterator.SEG_MOVETO) ||
                            (type == PathIterator.SEG_LINETO)) {
                            // LINETO or MOVETO
                            if (count > 4) break; // too many lines...
                            if (count == 4) {
View Full Code Here

    final PathIterator pi = shape.getPathIterator(null, 1.0);
    final float[] coords = new float[6];
    final float[] lastMove = new float[2];
    while (!pi.isDone())
    {
      switch (pi.currentSegment(coords))
      {
        case PathIterator.SEG_MOVETO :
          if (sb.length() != 0)
          {
            sb.append(",");
View Full Code Here

                    PathIterator pi = gbounds.getPathIterator(null);
                    Point2D.Float firstPt = null;

                    while (!pi.isDone()) {
                        type = pi.currentSegment(pts);
                        if ((type == PathIterator.SEG_MOVETO) ||
                            (type == PathIterator.SEG_LINETO)) {
                            // LINETO or MOVETO
                            if (count > 4) break; // too many lines...
                            if (count == 4) {
View Full Code Here

        PathIterator it = shape.getPathIterator(transform);
        double[] prev = null;
        double[] coords = new double[6];
        double[] first = new double[6];
        if(!it.isDone()) it.currentSegment(first); //first point
        while(!it.isDone()){
            int type = it.currentSegment(coords);
            if (prev != null ){
                Line line = new Line(group);
                if (stroke instanceof BasicStroke){
View Full Code Here

        double[] prev = null;
        double[] coords = new double[6];
        double[] first = new double[6];
        if(!it.isDone()) it.currentSegment(first); //first point
        while(!it.isDone()){
            int type = it.currentSegment(coords);
            if (prev != null ){
                Line line = new Line(group);
                if (stroke instanceof BasicStroke){
                    BasicStroke bs = (BasicStroke)stroke;
                    line.setLineWidth(bs.getLineWidth());
View Full Code Here

        }
        PathIterator it = shape.getPathIterator(transform);
        ArrayList pnt = new ArrayList();
        double[] coords = new double[6];
        while(!it.isDone()){
            int type = it.currentSegment(coords);
            if (type != PathIterator.SEG_CLOSE) {
                pnt.add(new Point((int)coords[0], (int)coords[1]));
            }
            it.next();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.