Package java.awt.geom

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


                Point2D p = new Point2D.Float(advance.x, advance.y);
                at.transform(p, p);

                double scale = width / p.getX();
                AffineTransform xform = AffineTransform.getScaleInstance(scale, 1.0);
                gp.transform(xform);
            }

            // put the parsed object in the cache
            name2outline.put(name, gp);
            name2width.put(name, advance);
View Full Code Here


        parseGlyph (r, gp, pt);

        // restore the start position
        pos = hold;

        gp.transform (at);

        return gp;
    }

    /**
 
View Full Code Here

        try {
            xformA.concatenate (at.createInverse ());
        } catch (NoninvertibleTransformException nte) {
            // oh well ...
        }
        pathA.transform (xformA);

        GeneralPath pathB = getOutline (b, getWidth (b, null));

        try {
            AffineTransform xformB = at.createInverse ();
View Full Code Here

        GeneralPath pathB = getOutline (b, getWidth (b, null));

        try {
            AffineTransform xformB = at.createInverse ();
            pathB.transform (xformB);
        } catch (NoninvertibleTransformException nte) {
            // ignore
        }

        gp.append (pathB, false);
View Full Code Here

        // the base transform scales the glyph to 1x1
        AffineTransform at = AffineTransform.getScaleInstance (1 / unitsPerEm,
                1 / unitsPerEm);
        at.concatenate (AffineTransform.getScaleInstance (widthfactor, 1));

        gp.transform (at);

        return gp;
    }

    /**
 
View Full Code Here

            // multiply the translations by units per em
            double[] matrix = g.getTransform (i);

            // transform the path
            path.transform (new AffineTransform (matrix));

            // add it to the global path
            gp.append (path, false);
        }
View Full Code Here

        CMap map = cmapTable.getCMap (mapIDs[0], mapIDs[1]);
        int glyphID = map.map (src);
        float advance = (float) hmtxTable.getAdvance (glyphID) / (float) unitsPerEm;

        float widthfactor = width / advance;
        gp.transform (AffineTransform.getScaleInstance (widthfactor, -1));

        return gp;
    }

    /**
 
View Full Code Here

        if ((rotate != null) && (angle != 0)) {
            /// we have rotation huston, please spin me
            getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
            shape1.transform(getTransform());
            shape2.transform(getTransform());
        }

        if (getFillPaint() != null) {
            g2.setPaint(getFillPaint());
            g2.fill(shape1);
View Full Code Here

        shape.append(new Arc2D.Double(0.0, -7.0, 10, 14, 154.5, 25.5,
                Arc2D.OPEN), true);
        shape.closePath();
        getTransform().setToTranslation(plotArea.getMinX(), plotArea.getMaxY());
        getTransform().scale(plotArea.getWidth(), plotArea.getHeight() / 3);
        shape.transform(getTransform());

        if ((rotate != null) && (angle != 0)) {
            /// we have rotation
            getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
            shape.transform(getTransform());
View Full Code Here

        shape.transform(getTransform());

        if ((rotate != null) && (angle != 0)) {
            /// we have rotation
            getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
            shape.transform(getTransform());
        }

        defaultDisplay(g2, shape);
    }
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.