Package com.google.code.appengine.awt.geom

Examples of com.google.code.appengine.awt.geom.AffineTransform


     * @return current font render context
     */
    public FontRenderContext getFontRenderContext() {
        // NOTE: not sure?
        // Fixed for VG-285
        return new FontRenderContext(new AffineTransform(1, 0, 0, 1, 0, 0),
                true, true);
    }
View Full Code Here


    public void writeGraphicsState() throws IOException {
        super.writeGraphicsState();
        // write a special matrix here to scale all written coordinates by a
        // factor of TWIPS
        AffineTransform n = AffineTransform.getScaleInstance(1.0 / TWIPS,
                1.0 / TWIPS);
        os.writeTag(new SetWorldTransform(n));
    }
View Full Code Here

    // delete pen and brush
    protected void writeImage(RenderedImage image, AffineTransform xform,
            Color bkg) throws IOException {
        os.writeTag(new SaveDC());

        AffineTransform imageTransform = new AffineTransform(
            1.0, 0.0, 0.0, -1.0, 0.0, image.getHeight());
        imageTransform.preConcatenate(xform);
        writeTransform(imageTransform);

        BufferedImage bufferedImage = ImageUtilities.createBufferedImage(
            image, null, null);
        AlphaBlend alphaBlend = new AlphaBlend(
            imageBounds,
            toUnit(0),
            toUnit(0),
            toUnit(image.getWidth()),
            toUnit(image.getHeight()),
            new AffineTransform(),
            bufferedImage,
            bkg);

        os.writeTag(alphaBlend);
        os.writeTag(new RestoreDC());
View Full Code Here

        // font transformation sould _not_ transform string position
        translate(x, y);

        // apply font transformation
        AffineTransform t = font.getTransform();
        if (!t.isIdentity()) {
            writeGraphicsSave();
            writeTransform(t);
        }

        TextW text = new TextW(new Point(0, 0), string, 0, dummy, widths);
        os.writeTag(new ExtTextOutW(imageBounds, EMFConstants.GM_ADVANCED, 1, 1, text));

        // revert font transformation
        if (!t.isIdentity()) {
            writeGraphicsRestore();
        }

        // translation for string position.
        translate(-x, -y);
View Full Code Here

     * ================================================================================ |
     * 6. Transformations
     * ================================================================================
     */
    protected void writeTransform(AffineTransform t) throws IOException {
        AffineTransform n = new AffineTransform(t.getScaleX(), t.getShearY(), t
                .getShearX(), t.getScaleY(), t.getTranslateX()
                * UNITS_PER_PIXEL * TWIPS, t.getTranslateY() * UNITS_PER_PIXEL
                * TWIPS);
        os.writeTag(new ModifyWorldTransform(n, EMFConstants.MWT_LEFTMULTIPLY));
    }
View Full Code Here

        os.writeTag(new ModifyWorldTransform(n, EMFConstants.MWT_LEFTMULTIPLY));
    }

    protected void writeSetTransform(AffineTransform t) throws IOException {
        // write a special matrix here to scale all written coordinates by a factor of TWIPS
        AffineTransform n = AffineTransform.getScaleInstance(1.0/TWIPS, 1.0/TWIPS);
        os.writeTag(new SetWorldTransform(n));
        // apply transform
        writeTransform(t);
    }
View Full Code Here

        }

        // if s == null the clip is reset to the imageBounds
        if (s == null && imageBounds != null) {
            s = new Rectangle(imageBounds);
            AffineTransform at = getTransform();
            if (at != null) {
                s = at.createTransformedShape(s);
            }
        }

        writePath(s);
        os.writeTag(new SelectClipPath(EMFConstants.RGN_COPY));
View Full Code Here

        return null;
    }

    public void draw(Graphics2D graphics){

        AffineTransform at = graphics.getTransform();

        Shape[] sh = getShapes();
        for (int i = 0; i < sh.length; i++) {
            sh[i].draw(graphics);
        }
View Full Code Here

                    arg2 = ttf.readShort();
                } else {
                    arg1 = ttf.readChar();
                    arg2 = ttf.readChar();
                }
                AffineTransform t = new AffineTransform();
                if (ttf.flagBit(ARGS_XY)) {
                    t.translate(arg1, arg2);
                } else {
                    System.err
                            .println("TTFGlyfTable: ARGS_ARE_POINTS not implemented.");
                }

                if (ttf.flagBit(SCALE)) {
                    double scale = ttf.readF2Dot14();
                    t.scale(scale, scale);
                } else if (ttf.flagBit(XY_SCALE)) {
                    double scaleX = ttf.readF2Dot14();
                    double scaleY = ttf.readF2Dot14();
                    t.scale(scaleX, scaleY);
                } else if (ttf.flagBit(TWO_BY_TWO)) {
                    System.err
                            .println("TTFGlyfTable: WE_HAVE_A_TWO_BY_TWO not implemented.");
                }
View Full Code Here

            image.getHeight(),
            BufferedImage.TYPE_INT_RGB);
        Graphics2D g = (Graphics2D)bufferedImage.getGraphics();
        g.setBackground(bkg);
        g.clearRect(0, 0, image.getWidth(), image.getHeight());
        g.drawRenderedImage(image, new AffineTransform());
        return bufferedImage;
    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.geom.AffineTransform

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.