Package java.awt.geom

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


            // 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

            }

            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

        } else {
            geometry.regenerate(p);
        }

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

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

        } else {
            geometry.regenerate(p);
        }

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

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

                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

            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

        transform.concatenate(baseTransform);

        // Handle clip area in Graphics, first
        Shape clip = getClip();
        if (clip != null) {
            g.setClip(new GeneralPath(clip).createTransformedShape(transform));
        }

        Shape shape = new GeneralPath(geometry).createTransformedShape(transform);
        getAttributesForRendering(appDA).render((Graphics2D) g, shape, gradient);
    }
View Full Code Here

                    new LatLonPoint(lat2, lon2), // SE
                    lineType, nsegs, !isClear(fillPaint));
            int size = rects.size();

            for (int i = 0, j = 0; i < size; i += 2, j++) {
                GeneralPath gp = createShape((int[]) rects.get(i),
                        (int[]) rects.get(i + 1),
                        true);

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

   * @param s the size factor (equal to half the height of the diamond).
   * @return A diamond shape.
   */
  public static Shape createDiamond(final float s)
  {
    final GeneralPath p0 = new GeneralPath();
    p0.moveTo(0.0f, -s);
    p0.lineTo(s, 0.0f);
    p0.lineTo(0.0f, s);
    p0.lineTo(-s, 0.0f);
    p0.closePath();
    return p0;
  }
View Full Code Here

TOP

Related Classes of java.awt.geom.GeneralPath

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.