Package VisualLogic

Examples of VisualLogic.PathPoint


    public void jSetClosePath(boolean value) {
        closePath = value;
    }

    public GeneralPath parsepath(double zoomX, double zoomY) {
        PathPoint p;
        String cmd;

        GeneralPath path = new GeneralPath();

        if (points.size() > 0) {
            p = points.get(0);

            if (!p.commando.equalsIgnoreCase("MOVETO")) {
                int x = (int) (p.p.x * zoomX);
                int y = (int) (p.p.y * zoomY);
                path.moveTo(x, y);
            }
        }

        for (int i = 0; i < points.size(); i++) {
            p = points.get(i);
            cmd = p.commando;
            int x = (int) (p.p.x * zoomX);
            int y = (int) (p.p.y * zoomY);

            if (cmd.equalsIgnoreCase("MOVETO")) {
                path.moveTo(x, y);
            } else if (cmd.equalsIgnoreCase("LINETO")) {
                path.lineTo(x, y);
            } else if (cmd.equalsIgnoreCase("CURVETO")) {
                if (i > 0) {
                    PathPoint p_1 = points.get(i - 1);

                    if (p_1.commando.equalsIgnoreCase("CURVETO")) {
                        path.curveTo((int) (p_1.p2.x * zoomX), (int) (p_1.p2.y * zoomY), (int) (p.p1.x * zoomX), (int) (p.p1.y * zoomY), x, y);
                    } else {
                        path.curveTo((int) (p_1.p.x * zoomX), (int) (p_1.p.y * zoomY), (int) (p.p1.x * zoomX), (int) (p.p1.y * zoomY), x, y);
View Full Code Here


            int d2 = d / 2;
            int smallD = 5;

            Point point;
            for (int i = 0; i < points.size(); i++) {
                PathPoint p = points.get(i);
                point = p.p;

                if (i == 0) {
                    g.setColor(Color.RED);
View Full Code Here

            this.tags[index] = tag;
        }
    }

    public void jAddPathPoint(String commando, Point p, Point p1, Point p2) {
        PathPoint path = new PathPoint();
        path.commando = commando;
        path.p = p;
        path.p1 = p1;
        path.p2 = p2;
        points.add(path);
View Full Code Here

TOP

Related Classes of VisualLogic.PathPoint

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.