Package diva.util.java2d

Examples of diva.util.java2d.Polyline2D.moveTo()


        path.closePath();
        _shape = new BasicFigure(path, Color.red);
        layer.add(_shape);

        Polyline2D poly = new Polyline2D.Double();
        poly.moveTo(240, 120);
        poly.lineTo(280, 140);
        poly.lineTo(240, 160);
        poly.lineTo(280, 180);
        poly.lineTo(240, 200);
        poly.lineTo(280, 220);
View Full Code Here


            if (coords.length == 4) {
                s = new Line2D.Double(coords[0], coords[1], coords[2],
                        coords[3]);
            } else {
                Polyline2D poly = new Polyline2D.Double();
                poly.moveTo(coords[0], coords[1]);

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

            if (coords.length == 4) {
                s = new Line2D.Double(coords[0], coords[1], coords[2],
                        coords[3]);
            } else {
                Polyline2D poly = new Polyline2D.Double();
                poly.moveTo(coords[0], coords[1]);

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

        int dir;

        // System.out.println("routing, diff=(" + xDiff + ", " + yDiff + ")");
        if (((xDiff * xDiff) < (TOL * TOL)) && ((yDiff * yDiff) < (TOL * TOL))) {
            Polyline2D route = new Polyline2D.Double();
            route.moveTo(tail.getX(), tail.getY());
            return route;
        }

        //System.out.println("headDir = " + headDir);
        if (headDir == SwingConstants.WEST) {
View Full Code Here

     * but this time the shape is an instance of <b>diva.util.Polyline2D</b>.
     */
    public void createPolyline() {
        FigureLayer layer = graphicsPane.getForegroundLayer();
        Polyline2D path = new Polyline2D.Double();
        path.moveTo(240, 120);
        path.lineTo(280, 140);
        path.lineTo(240, 160);
        path.lineTo(280, 180);
        path.lineTo(240, 200);
        path.lineTo(280, 220);
View Full Code Here

            return pp;
        } else if (type.equals("polyline")) {
            double[] coords = parseCoordString((String) attributes
                    .get("points"));
            Polyline2D poly = new Polyline2D.Double();
            poly.moveTo(coords[0], coords[1]);

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

            return pp;
        } else if (type.equals("polygon")) {
            double[] coords = parseCoordString((String) attributes
                    .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]);
            }
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.