Examples of GeneralPath


Examples of java.awt.geom.GeneralPath

            break;
        case RENDERTYPE_LATLON:
            int size = xpoints.length;

            for (int i = 0; i < size; i++) {
                GeneralPath gp = createShape(xpoints[i], ypoints[i], isPolygon);

                if (shape == null) {
                    shape = gp;
                } else {
                    ((GeneralPath) shape).append(gp, false);
View Full Code Here

Examples of java.awt.geom.GeneralPath

        int size = vector.size();

        // We could call create shape, but this is more efficient.
        int i, j;
        for (i = 0, j = 0; i < size; i += 2, j++) {
            GeneralPath gp = createShape((int[]) vector.get(i),
                    (int[]) vector.get(i + 1),
                    true);

            if (shape == null) {
                setShape(gp);
View Full Code Here

Examples of java.awt.geom.GeneralPath

     * attributes from the individual parts will be ignored. The
     * contributions will be kept geometrically separate
     * (disconnected) and their clipping areas will be ignored.
     */
    public Shape getGeometry() {
        GeneralPath geometry = null;
        Iterator it = iterator();
        while (it.hasNext()) {
            IconPart part = (IconPart) it.next();

            Shape shp = part.getGeometry();

            if (shp == null) {
                continue;
            }

            if (geometry == null) {
                geometry = new GeneralPath(shp);
            } else {
                geometry.append(shp, false);
            }
        }
        return geometry;
    }
View Full Code Here

Examples of java.awt.geom.GeneralPath

        if (length > xpoints.length - startIndex) {
            // Do as much as you can...
            length = xpoints.length - startIndex - 1;
        }

        GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, length);

        if (length > startIndex) {
            path.moveTo(xpoints[startIndex], ypoints[startIndex]);
            for (int j = startIndex + 1; j < length; j++) {
                path.lineTo(xpoints[j], ypoints[j]);
            }

            if (isPolygon) {
                path.closePath();
            }
        }

        return path;
    }
View Full Code Here

Examples of java.awt.geom.GeneralPath

            // We could call create shape, but this is more efficient.

            for (i = 0, j = 0; i < size; i += 2, j++) {
                if (doShapes) {
                    GeneralPath gp = BasicGeometry.createShape((int[]) vector.get(i),
                            (int[]) vector.get(i + 1),
                            isPolygon);
                    if (shape == null) {
                        shape = gp;
                    } else {
View Full Code Here

Examples of java.awt.geom.GeneralPath

            }

            int size = xpoints.length;

            for (int i = 0; i < size; i++) {
                GeneralPath gp = BasicGeometry.createShape(xpoints[i],
                        ypoints[i],
                        isPolygon);

                if (shape == null) {
                    shape = gp;
View Full Code Here

Examples of java.awt.geom.GeneralPath

        } else {
            geometry.regenerate(p);
        }

        if (geometry.isVisible()) {
            GeneralPath gp = (GeneralPath) geometry.getShape();

            if (gp == null) {
                return;
            }
View Full Code Here

Examples of java.awt.geom.GeneralPath

        } else {
            geometry.regenerate(p);
        }

        if (geometry.isVisible()) {
            GeneralPath gp = (GeneralPath) geometry.getShape();

            if (gp == null) {
                return;
            }
View Full Code Here

Examples of java.awt.geom.GeneralPath

                polyBounds.addPoint(pt.x + xoffset, currenty);
            }

            if (polyBounds != null) {
                if (useMaxWidthForBounds) {
                    setShape(new GeneralPath(polyBounds.getBounds()));
                } else {
                    setShape(new GeneralPath(polyBounds));
                }

                // Make sure the shape takes into account the current
                // rotation angle. Code taken from generate() method,
                // so it should match up with the drawn text.
                if (rotationAngle != DEFAULT_ROTATIONANGLE) {

                    Rectangle rect = polyBounds.getBounds();

                    double rx = rect.getX();
                    double rw = rect.getWidth();
                    double woffset = 0.0;

                    switch (justify) {
                    case JUSTIFY_LEFT:
                        // woffset = 0.0;
                        break;
                    case JUSTIFY_CENTER:
                        woffset = rw / 2;
                        break;
                    case JUSTIFY_RIGHT:
                        woffset = rw;
                    }

                    AffineTransform at = new AffineTransform();
                    at.rotate(rotationAngle, rx + woffset, pt.y);
                    PathIterator pi = shape.getPathIterator(at);
                    GeneralPath gp = new GeneralPath();
                    gp.append(pi, false);
                    shape = gp;
                }
            }

        } else {
View Full Code Here

Examples of java.awt.geom.GeneralPath

            lineWidth = ((BasicStroke) stroke).getLineWidth();
            wingTip += lineWidth;
            wingLength += lineWidth * 2;
        }

        GeneralPath shape = createArrowHead(locPoints[0],
                locPoints[1],
                wingTip,
                wingLength);

        int numLocPoints = locPoints.length;
        for (int i = 2; i < numLocPoints - 1; i += 2) {
            shape.append(createArrowHead(locPoints[i],
                    locPoints[i + 1],
                    wingTip,
                    wingLength), false);
        }

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.