Package diva.util.java2d

Examples of diva.util.java2d.Polygon2D.lineTo()


        // Create a star using a general path object
        Polygon2D p = new Polygon2D.Double();
        p.moveTo(-100.0f, -25.0f);
        p.lineTo(+100.0f, -25.0f);
        p.lineTo(-50.0f, +100.0f);
        p.lineTo(+0.0f, -100.0f);
        p.lineTo(+50.0f, +100.0f);
        p.closePath();

        // translate origin towards center of canvas
        AffineTransform at = new AffineTransform();
View Full Code Here


        Polygon2D p = new Polygon2D.Double();
        p.moveTo(-100.0f, -25.0f);
        p.lineTo(+100.0f, -25.0f);
        p.lineTo(-50.0f, +100.0f);
        p.lineTo(+0.0f, -100.0f);
        p.lineTo(+50.0f, +100.0f);
        p.closePath();

        // translate origin towards center of canvas
        AffineTransform at = new AffineTransform();
        at.translate(200.0f, 200.0f);
View Full Code Here

                    .get("points"));
            Polygon2D poly = new Polygon2D.Double();
            poly.moveTo(coords[0], coords[1]);

            for (int i = 2; i < coords.length; i += 2) {
                poly.lineTo(coords[i], coords[i + 1]);
            }

            poly.closePath();

            PaintedShape ps = new PaintedShape(poly);
View Full Code Here

            //at.translate(length, 0.0);
        }

        Polygon2D polygon = new Polygon2D.Double();
        polygon.moveTo(pos.x, pos.y);
        polygon.lineTo(
                pos.x + l2,
                pos.y + w);
        polygon.lineTo(
                pos.x + l1,
                pos.y);
View Full Code Here

        Polygon2D polygon = new Polygon2D.Double();
        polygon.moveTo(pos.x, pos.y);
        polygon.lineTo(
                pos.x + l2,
                pos.y + w);
        polygon.lineTo(
                pos.x + l1,
                pos.y);
        polygon.lineTo(
                pos.x + l2,
                pos.y - w);
View Full Code Here

                pos.x + l2,
                pos.y + w);
        polygon.lineTo(
                pos.x + l1,
                pos.y);
        polygon.lineTo(
                pos.x + l2,
                pos.y - w);
        polygon.closePath();
        polygon.transform(at);
        return polygon;
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.