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

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


        if (transform == null) {
            // awt.94=transform can not be null
            throw new IllegalArgumentException(Messages.getString("awt.94")); //$NON-NLS-1$
        }
        if (!transform.isIdentity()){
            this.fTransform = new AffineTransform(transform);
        }
    }
View Full Code Here


        }
    }

    public AffineTransform getTransform() {
        if (fTransform != null){
            return new AffineTransform(fTransform);
        }
        return new AffineTransform();
    }
View Full Code Here

        }
        return anchor;
    }

    public void draw(Graphics2D graphics){
        AffineTransform at = graphics.getTransform();
        ShapePainter.paint(this, graphics);
        graphics.setTransform(at);
    }
View Full Code Here

        return new Color(readShort() >> 8, readShort() >> 8, readShort() >> 8,
                readShort() >> 8);
    }

    public AffineTransform readXFORM() throws IOException {
        return new AffineTransform(readFLOAT(), readFLOAT(), readFLOAT(),
                readFLOAT(), readFLOAT(), readFLOAT());
    }
View Full Code Here

            }
        }
    }

    public void draw(Graphics2D graphics){
        AffineTransform at = graphics.getTransform();
        ShapePainter.paint(this, graphics);
        new TextPainter(this).paint(graphics);
        graphics.setTransform(at);
    }
View Full Code Here

    public abstract FontRenderContext getFontRenderContext();

    public Shape getGlyphOutline(int glyphIndex, float x, float y) {
        Shape initialShape = getGlyphOutline(glyphIndex);
        AffineTransform trans = AffineTransform.getTranslateInstance(x, y);
        return trans.createTransformedShape(initialShape);
    }
View Full Code Here

        }
    }

    @Override
    public void draw(Graphics2D g2, float x, float y) {
        AffineTransform at = AffineTransform.getTranslateInstance(x, y);
        if (fStroke == STROKE){
            Stroke oldStroke = g2.getStroke();
            g2.setStroke(new BasicStroke());
            g2.draw(at.createTransformedShape(fShape));
            g2.setStroke(oldStroke);
        } else {
            g2.fill(at.createTransformedShape(fShape));
        }

    }
View Full Code Here

    public void render(EMFRenderer renderer) {
        // The BeginPath function opens a path bracket in the specified
        // device context.
        renderer.setPath(new GeneralPath(
            renderer.getWindingRule()));
        renderer.setPathTransform(new AffineTransform());
    }
View Full Code Here

            Rectangle2D oldBounds = shape.getBounds2D();
            float witdh = stroke.getLineWidth();

            // calcute a transformation for inside drawing
            // based on the stroke width
            AffineTransform at = new AffineTransform();
            if (oldBounds.getWidth() > 0) {
                at.scale(
                    (oldBounds.getWidth() - witdh) /
                        oldBounds.getWidth(), 1);
            }

            if (oldBounds.getHeight() > 0) {
                at.scale(1,
                    (oldBounds.getHeight() - witdh)
                        / oldBounds.getHeight());
            }

            // recalculate shape and its oldBounds
            shape = at.createTransformedShape(shape);
            Rectangle2D newBounds = shape.getBounds2D();

            // move the shape to the old origin + the line width offset
            AffineTransform moveBackTransform = AffineTransform.getTranslateInstance(
                oldBounds.getX() - newBounds.getX() + witdh / 2,
                oldBounds.getY() - newBounds.getY() + witdh / 2);
            shape = moveBackTransform.createTransformedShape(shape);

            // outline the shape using the simple basic stroke
            return stroke.createStrokedShape(shape);
        }
View Full Code Here

    @Override
    public void drawGlyphVector(Graphics2D g, GlyphVector glyphVector,
            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);

        drawClipGlyphVector(wr, color, glyphVector, (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

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.