Package java.awt.geom

Examples of java.awt.geom.GeneralPath.quadTo()


                    // use the starting point as end point
                    path.quadTo(nextPoint1.x, nextPoint1.y, startingPoint.x, startingPoint.y);
                }
                else
                {
                    path.quadTo(nextPoint1.x, nextPoint1.y, nextPoint2.x, nextPoint2.y);
                }
                if (nextPoint1.endOfContour || nextPoint2.endOfContour)
                {
                    endOfContour = true;
                    path.closePath();
View Full Code Here


            if (point.onCurve && !nextPoint1.onCurve && !nextPoint2.onCurve)
            {
                // interpolate endPoint
                int endPointX = midValue(nextPoint1.x, nextPoint2.x);
                int endPointY = midValue(nextPoint1.y, nextPoint2.y);
                path.quadTo(nextPoint1.x, nextPoint1.y, endPointX, endPointY);
                if (point.endOfContour || nextPoint1.endOfContour || nextPoint2.endOfContour)
                {
                    path.quadTo(nextPoint2.x, nextPoint2.y, startingPoint.x, startingPoint.y);
                    endOfContour = true;
                    path.closePath();
View Full Code Here

                int endPointX = midValue(nextPoint1.x, nextPoint2.x);
                int endPointY = midValue(nextPoint1.y, nextPoint2.y);
                path.quadTo(nextPoint1.x, nextPoint1.y, endPointX, endPointY);
                if (point.endOfContour || nextPoint1.endOfContour || nextPoint2.endOfContour)
                {
                    path.quadTo(nextPoint2.x, nextPoint2.y, startingPoint.x, startingPoint.y);
                    endOfContour = true;
                    path.closePath();
                }
                i+=2;
                lastCtrlPoint = nextPoint1;
View Full Code Here

                lastCtrlPoint = new Point(midValue(lastCtrlPoint.x, (int)lastEndPoint.getX()),
                        midValue(lastCtrlPoint.y, (int)lastEndPoint.getY()));
                // interpolate endPoint
                int endPointX = midValue((int)lastEndPoint.getX(), nextPoint1.x);
                int endPointY = midValue((int)lastEndPoint.getY(), nextPoint1.y);
                path.quadTo(lastCtrlPoint.x, lastCtrlPoint.y, endPointX, endPointY);
                if (point.endOfContour || nextPoint1.endOfContour)
                {
                    endOfContour = true;
                    path.closePath();
                }
View Full Code Here

                i++;
                continue;
            }
            if (!point.onCurve && nextPoint1.onCurve)
            {
                path.quadTo(point.x, point.y, nextPoint1.x, nextPoint1.y);
                if (point.endOfContour || nextPoint1.endOfContour)
                {
                    endOfContour = true;
                    path.closePath();
                }
View Full Code Here

                                break;
                            case java.awt.geom.PathIterator.SEG_LINETO:
                                s.lineTo(coords[0], coords[1]);
                                break;
                            case java.awt.geom.PathIterator.SEG_QUADTO:
                                s.quadTo(coords[0], coords[1], coords[2], coords[3]);
                                break;
                            case java.awt.geom.PathIterator.SEG_CUBICTO:
                                s.curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]);
                                break;
                            }
View Full Code Here

        GeneralPath path = new GeneralPath();
        path.moveTo(100f, 100f);
        path.lineTo(200f, 150f);
        path.lineTo(300f, 200f);
        path.quadTo(450f, 525f, 400f, 250f);
        path.closePath();

        PathLength pl = new PathLength(path);

        System.out.println("New Path Length created");
View Full Code Here

        System.out.println("Point at 3000 = " + pl.pointAtLength(3000f));

        path = new GeneralPath();
        path.moveTo(100f, 100f);
        path.lineTo(200f, 150f);
        path.quadTo(450f, 525f, 400f, 250f);
        path.closePath();
        pl = new PathLength(path);

        System.out.println("Path Length = " + pl.lengthOfPath());
        System.out.println("Point at 0 = " + pl.pointAtLength(0f));
View Full Code Here

        System.out.println("Point at 300 = " + pl.pointAtLength(300f));

        path = new GeneralPath();
        path.moveTo(100f, 100f);
        path.lineTo(200f, 150f);
        path.quadTo(450f, 525f, 400f, 250f);
        path.lineTo(300f, 200f);
        path.closePath();

        pl = new PathLength(path);
        System.out.println("Path Length = " + pl.lengthOfPath());
View Full Code Here

   
    GeneralPath graphics = new GeneralPath();
    graphics.moveTo(start1.x,start1.y);
    graphics.lineTo(inter1.x,inter1.y);
    graphics.lineTo(edge1.x,edge1.y);
    graphics.quadTo(edgeCntrl1.x,edgeCntrl1.y,end.x,end.y);
    graphics.quadTo(edgeCntrl2.x,edgeCntrl2.y,edge2.x,edge2.y);
    graphics.lineTo(inter2.x,inter2.y);
    graphics.lineTo(start2.x,start2.y);
    graphics.lineTo(start1.x,start1.y);
    graphics.closePath();
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.