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

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


    }

    @SuppressWarnings("deprecation")
    @Override
    public void drawString(Graphics2D g, String str, float x, float y) {
        AffineTransform at = g.getTransform();
        Rectangle c = g.getClipBounds();
        if (at != null){
            int atType = at.getType();
            if (atType == AffineTransform.TYPE_TRANSLATION) {
                c.translate((int)Math.round(at.getTranslateX()), (int)Math.round(at.getTranslateY()));
            }
        }
        WritableRaster wr = ((BufferedImageGraphics2D)g).getWritableRaster();
        ColorModel cm = ((BufferedImageGraphics2D)g).getColorModel();
        Rectangle rBounds = wr.getBounds();

        Object color = cm.getDataElements(g.getColor().getRGB(), null);

        drawClipString(wr, color, str, (FontPeerImpl) (g.getFont().getPeer()),
                (int)Math.round(x + at.getTranslateX()), (int)Math.round(y + at.getTranslateY()),
                Math.max(c.x,rBounds.x),
                Math.max(c.y,rBounds.y),
                Math.min((int)Math.round(c.getMaxX()), (int)Math.round(rBounds.getMaxX())),
                Math.min((int)Math.round(c.getMaxY()), (int)Math.round(rBounds.getMaxY())));
View Full Code Here


        }else{
            double scaleX = xform.getScaleX();
            double scaleY = xform.getScaleY();
            double scaledX = dstX / scaleX;
            double scaledY = dstY / scaleY;
            AffineTransform at = new AffineTransform();
            at.setToTranslation(scaledX, scaledY);
            xform.concatenate(at);
            sysxform.concatenate(xform);
            blit(srcX, srcY, srcSurf, 0, 0, dstSurf, width, height,
                    sysxform, comp, bgcolor, clip);
        }
View Full Code Here

    public void blit(int srcX, int srcY, Surface srcSurf, int dstX, int dstY,
            Surface dstSurf, int width, int height, AffineTransform sysxform,
            Composite comp, Color bgcolor, MultiRectArea clip) {

        if(sysxform == null) {
            sysxform = new AffineTransform();
        }
        int type = sysxform.getType();
        switch(type){
            case AffineTransform.TYPE_TRANSLATION:
                dstX += sysxform.getTranslateX();
View Full Code Here

        Rectangle transDstBlitBounds = getBounds2D(at, dstBlitBounds).getBounds();

        int translateX = transDstBlitBounds.x - transSrcBounds.x;
        int translateY = transDstBlitBounds.y - transSrcBounds.y;

        AffineTransform inv = null;
        try {
             inv = at.createInverse();
        } catch (NoninvertibleTransformException e) {
            return;
        }

        double[] m = new double[6];
        inv.getMatrix(m);

        int clipRects[];
        if(clip != null) {
            clipRects = clip.rect;
        } else {
View Full Code Here

        // For last position we don't have to transform !!
        if(glyphIndex==vector.length){
            return pos;
        }

        AffineTransform at = getGlyphTransform(glyphIndex);
        if ((at == null) || (at.isIdentity())){
            return pos;
        }

        pos.setLocation(pos.getX() + at.getTranslateX(), pos.getY() + at.getTranslateY());

        return pos;
    }
View Full Code Here

        }

        if ((trans == null) || (trans.isIdentity())) {
            glsTransforms[glyphIndex] = null;
        } else {
            glsTransforms[glyphIndex] = new AffineTransform(trans);
            layoutFlags = layoutFlags | FLAG_HAS_TRANSFORMS;
        }
    }
View Full Code Here

            throw new IndexOutOfBoundsException(Messages.getString("awt.43")); //$NON-NLS-1$
        }

        int idx  = glyphIndex << 1;

        AffineTransform fontTransform = this.transform;
        double xOffs = fontTransform.getTranslateX();
        double yOffs = fontTransform.getTranslateY();

        if (vector[glyphIndex].getWidth() == 0){
            return new Rectangle2D.Float((float)xOffs, (float)yOffs, 0, 0);
        }

        AffineTransform at = AffineTransform.getTranslateInstance(xOffs, yOffs);
        AffineTransform glyphTransform = getGlyphTransform(glyphIndex);

        if (transform.isIdentity() && ((glyphTransform == null) || glyphTransform.isIdentity())){
            Rectangle2D blackBox = vector[glyphIndex].getGlyphMetrics().getBounds2D();
            at.translate(visualPositions[idx], visualPositions[idx+1]);
            return(at.createTransformedShape(blackBox));
        }
View Full Code Here

        }

        int idx  = glyphIndex << 1;

        if (vector[glyphIndex].getWidth() == 0){
            AffineTransform fontTransform = this.transform;
            double xOffs = x + visualPositions[idx] + fontTransform.getTranslateX();
            double yOffs = y + visualPositions[idx+1] + fontTransform.getTranslateY();
            return new Rectangle((int)xOffs, (int)yOffs, 0, 0);
        }

        GeneralPath shape = (GeneralPath)this.getGlyphOutline(glyphIndex);

        AffineTransform at = AffineTransform.getTranslateInstance(x, y);

        if (frc != null){
            at.concatenate(frc.getTransform());
       
/*          if (frc.usesFractionalMetrics()){
                shape.transform(at);
                Rectangle2D bounds = shape.getBounds2D();
                Rectangle rect = new Rectangle();
View Full Code Here

        }

        GeneralPath gp = (GeneralPath)((GeneralPath)gvShapes[glyphIndex]).clone();

        /* Applying GlyphVector font transform */
        AffineTransform at = (AffineTransform)this.transform.clone();

        /* Applying Glyph transform */
        AffineTransform glyphAT = getGlyphTransform(glyphIndex);
        if (glyphAT != null){
            at.preConcatenate(glyphAT);
        }

        int idx  = glyphIndex << 1;
View Full Code Here

                    eq = (((CommonGlyphVector)glyphVector).visualPositions[idx] == this.visualPositions[idx]) &&
                        (((CommonGlyphVector)glyphVector).visualPositions[idx+1] == this.visualPositions[idx+1]) &&
                        (glyphVector.getGlyphCharIndex(i) == this.getGlyphCharIndex(i));

                    if (eq){
                        AffineTransform trans = glyphVector.getGlyphTransform(i);
                        if (trans == null){
                            eq = (this.glsTransforms[i] == null);
                        }else{
                            eq = this.glsTransforms[i].equals(trans);
                        }
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.