Package java.awt.geom

Examples of java.awt.geom.GeneralPath.moveTo()


     */
    public void draw(Graphics2D g, int width, int height) {
        g.setColor(new Color(data[0], data[1], data[2], data[3]));

        GeneralPath path = new GeneralPath();
        path.moveTo(data[4] * width, data[5] * height);
       
        int polygonLength = (data.length - 4) / 2;
        for (int j = 1; j < polygonLength; j++) {
            path.lineTo(data[4 + j * 2] * width, data[5 + j * 2] * height);
        }
View Full Code Here


     * @see java.awt.Graphics#drawPolyline(int[], int[], int)
     */
    public final void drawPolyline(int[] xPoints, int[] yPoints, int npoints) {
        final GeneralPath path = new GeneralPath(GeneralPath.WIND_NON_ZERO,
            npoints * 2);
        path.moveTo(xPoints[0], yPoints[0]);
        for (int i = 1; i < npoints; i++) {
            path.lineTo(xPoints[i], yPoints[i]);
        }
        draw(path);
    }
View Full Code Here

        fill(new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN));
    }

    public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
        final GeneralPath path = new GeneralPath(GeneralPath.WIND_NON_ZERO, nPoints * 2);
        path.moveTo(xPoints[0], yPoints[0]);
        for (int i = 1; i < nPoints; i++) {
            path.lineTo(xPoints[i], yPoints[i]);
        }
        draw(path);
    }
View Full Code Here

    public void render(Surface surface, Shape clip, AffineTransform tx, CharSequence text,
            int x, int y, Color c) {
        try {
            final GeneralPath gp = new GeneralPath();
            gp.moveTo(x, y);

            final GlyphTable glyphTable = fontData.getGlyphTable();
            final CMapTable cmapTable = fontData.getCMapTable();
            final HorizontalHeaderTable hheadTable = fontData
                .getHorizontalHeaderTable();
View Full Code Here

            GeneralPath gp = new GeneralPath();
            if (dist < 2*sz) {
                // Close enough to merge with previous char...
                System.arraycopy(boxes, 0, chull, 0, 8);
                int npts = makeConvexHull(chull, 8);
                gp.moveTo(chull[0].x, chull[0].y);
                for(int n=1; n<npts; n++)
                    gp.lineTo(chull[n].x, chull[n].y);
                gp.closePath();
            } else {
                // Merge all previous areas
View Full Code Here

                mergeAreas(shape, areas, nAreas);
                nAreas = 0; // Start fresh...

                // Then just add box (add the previous char box if first pts)
                if (i==2) {
                    gp.moveTo(boxes[0].x, boxes[0].y);
                    gp.lineTo(boxes[1].x, boxes[1].y);
                    gp.lineTo(boxes[2].x, boxes[2].y);
                    gp.lineTo(boxes[3].x, boxes[3].y);
                    gp.closePath();
                    shape.append(gp, false);
View Full Code Here

                    gp.lineTo(boxes[3].x, boxes[3].y);
                    gp.closePath();
                    shape.append(gp, false);
                    gp.reset();
                }
                gp.moveTo(boxes[4].x, boxes[4].y);
                gp.lineTo(boxes[5].x, boxes[5].y);
                gp.lineTo(boxes[6].x, boxes[6].y);
                gp.lineTo(boxes[7].x, boxes[7].y);
                gp.closePath();
            }
View Full Code Here

                float y1 = (float)(y0+fullBounds.getHeight());
                // Build the bounds rect the way things expect to see it...
                if (flippedH[i]) {
                    if (flippedV[i]) {
                        GeneralPath gp = new GeneralPath();
                        gp.moveTo(x1,y1);
                        gp.lineTo(x0,y1);
                        gp.lineTo(x0,y0);
                        gp.lineTo(x1,y0);
                        gp.lineTo(x1,y1);
                        gp.closePath();
View Full Code Here

                        gp.lineTo(x1,y1);
                        gp.closePath();
                        tempLogicalBounds[i] = gp;
                    } else {
                        GeneralPath gp = new GeneralPath();
                        gp.moveTo(x1,y0);
                        gp.lineTo(x0,y0);
                        gp.lineTo(x0,y1);
                        gp.lineTo(x1,y1);
                        gp.lineTo(x1,y0);
                        gp.closePath();
View Full Code Here

                        tempLogicalBounds[i] = gp;
                    }
                } else {
                    if (flippedV[i]) {
                        GeneralPath gp = new GeneralPath();
                        gp.moveTo(x0,y1);
                        gp.lineTo(x1,y1);
                        gp.lineTo(x1,y0);
                        gp.lineTo(x0,y0);
                        gp.lineTo(x0,y1);
                        gp.closePath();
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.