Package java.awt.geom

Examples of java.awt.geom.AffineTransform.rotate()


    /**
     * Implements {@link SVGMatrix#rotate(float)}.
     */
    public SVGMatrix rotate(float angle) {
        AffineTransform tr = (AffineTransform)getAffineTransform().clone();
        tr.rotate(angle);
        return new SVGOMMatrix(tr);
    }

    /**
     * Implements {@link SVGMatrix#rotateFromVector(float,float)}.
View Full Code Here


    public SVGMatrix rotateFromVector(float x, float y) throws SVGException {
        if (x == 0 || y == 0) {
            throw new SVGOMException(SVGException.SVG_INVALID_VALUE_ERR, "");
        }
        AffineTransform tr = (AffineTransform)getAffineTransform().clone();
        tr.rotate(Math.atan2(y, x));
        return new SVGOMMatrix(tr);
    }

    /**
     * Implements {@link SVGMatrix#flipX()}.
View Full Code Here

            if (glyphRotation != 0f) {
                AffineTransform glyphTransform = gv.getGlyphTransform(i);
                if (glyphTransform == null) {
                    glyphTransform = new AffineTransform();
                }
                glyphTransform.rotate(glyphRotation);
                gv.setGlyphTransform(i, glyphTransform);
            }

            aciIndex += gv.getCharacterCount(i,i);
            ch = aci.setIndex(aciIndex);
View Full Code Here

                // Define the transform of the glyph
                AffineTransform glyphPathTransform = new AffineTransform();

                // rotate midline of glyph to be normal to path
                if (horizontal) {
                    glyphPathTransform.rotate(angle);
                } else {
                    glyphPathTransform.rotate(angle-(Math.PI/2));
                }

                // re-apply any offset eg from tspan, or spacing adjust
View Full Code Here

                // rotate midline of glyph to be normal to path
                if (horizontal) {
                    glyphPathTransform.rotate(angle);
                } else {
                    glyphPathTransform.rotate(angle-(Math.PI/2));
                }

                // re-apply any offset eg from tspan, or spacing adjust
                if (horizontal) {
                    glyphPathTransform.translate(0, glyphOffset);
View Full Code Here

        AffineTransform tempTrans = (AffineTransform)origTrans.clone();
       
        graphics.setColor(Color.black);
       
        tempTrans.translate(EDGE_WIDTH, mapPixelHeight);
        tempTrans.rotate(-Math.PI/2); //rotate 90 degrees
        tempTrans.translate(0, -mapPixelHeight - (mapPixelWidth - mapPixelHeight));
        graphics.setTransform(tempTrans);
       
        for (int i = 0; i <lineMiddles.length; i++) {
            //top bound
View Full Code Here

        AffineTransform origTrans = graphics.getTransform();
        AffineTransform tempTrans = (AffineTransform)origTrans.clone();
       
       
        graphics.setColor(Color.BLACK);
        tempTrans.rotate(Math.PI/2); //rotate 90 degrees
        tempTrans.translate(0, -mapPixelHeight - (mapPixelWidth - mapPixelHeight));
        graphics.setTransform(tempTrans);
       
        for (int i = 0; i <lineMiddles.length; i++) {
            //top bound
View Full Code Here

        if (fixedPoint == null) {
            fixedPoint = new Point(display.getWidth() / 2, display.getHeight() / 2);
        }
        AffineTransform t = new AffineTransform();
        t.translate(fixedPoint.getX(), fixedPoint.getY());
        t.rotate(rotation);
        t.scale(scaleFactorX, scaleFactorY);
        t.translate(-fixedPoint.getX(), -fixedPoint.getY());
        t.translate(translateX, translateY);
        t.concatenate(graphics.getTransform());
        graphics.setTransform(t);
View Full Code Here

    }

    public synchronized AffineTransform getTransform() {
        AffineTransform t = new AffineTransform();
        t.translate((double)display.getWidth()/(double)2, (double)display.getHeight()/(double)2);
        t.rotate(rotation);
        t.scale(scaleFactorX, scaleFactorY);
        t.translate((double)-display.getWidth()/(double)2, (double)-display.getHeight()/(double)2);
        t.translate(translateX, translateY);
        return t;
    }
View Full Code Here

        switch (rotation)
        {
        case 90:
            at.scale(viewBox.getWidth() / viewBox.getHeight(), viewBox.getHeight() / viewBox.getWidth());
            at.translate(0, viewBox.getWidth());
            at.rotate(-Math.PI / 2.0);
            break;
        case 180:
            at.translate(viewBox.getWidth(), viewBox.getHeight());
            at.rotate(-Math.PI);
            break;
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.