Package diva.util.java2d

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


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

            poly.closePath();

            PaintedShape ps = new PaintedShape(poly);
            processPaintedShapeAttributes(ps, attributes);
            return ps;
        } else if (type.equals("line")) {
View Full Code Here


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

            poly.closePath();

            PaintedShape ps = new PaintedShape(poly);
            processPaintedShapeAttributes(ps, attributes);
            return ps;
        } else if (type.equals("line")) {
View Full Code Here

            polygon.moveTo(_originX, _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY - _unit);
            polygon.lineTo(_originX + (3.0 * _unit), _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY + _unit);
            polygon.lineTo(_originX, _originY);
            polygon.closePath();
            _shape = polygon;
            break;
        }

        _shape = at.createTransformedShape(_shape);
View Full Code Here

        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);
        p.transform(at);
View Full Code Here

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

            poly.closePath();

            PaintedShape ps = new PaintedShape(poly);
            processPaintedShapeAttributes(ps, attributes);
            return ps;
        } else if (type.equals("text")) {
View Full Code Here

                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.