Package com.google.code.appengine.awt

Examples of com.google.code.appengine.awt.Shape


     * Gets the current clip in form of a Rectangle.
     *
     * @return current clip
     */
    public Rectangle getClipBounds() {
        Shape clip = getClip();
        return (clip != null) ? getClip().getBounds() : null;
    }
View Full Code Here


     *
     * @param s used for clipping
     */
    public void setClip(Shape s) {

        Shape ts = transformShape(s);
        userClip = (ts != null) ? new Area(ts) : null;

        try {
            writeSetClip(s);
        } catch (IOException e) {
View Full Code Here

     * writeClip(Rectangle2D) or writeClip(Shape).
     *
     * @param s used for clipping
     */
    public void clip(Shape s) {
        Shape ts = transformShape(s);
        if (userClip != null) {
            if (ts != null) {
                userClip.intersect(new Area(ts));
            } else {
                userClip = null;
View Full Code Here

        graphics.translate(- bounds.getMinX(), - bounds.getMinY());
        graphics.fill(shape);
        graphics.dispose();

        // draw image
        Shape clip = getClip();
        clip(shape);
        drawImage(image, (int)bounds.getX(), (int)bounds.getY(), null);
        setClip(clip);
    }
View Full Code Here

    @Override
    public void finalize() {
    }

    public Rectangle getClipBounds(Rectangle r) {
        Shape clip = getClip();

        if (clip != null) {
            // TODO: Can we get shape bounds without creating Rectangle object?
            Rectangle b = clip.getBounds();
            r.x = b.x;
            r.y = b.y;
            r.width = b.width;
            r.height = b.height;
        }
View Full Code Here

        // See code marked FONTHACK elsewhere in this file
        // Create a GlyphVector for this single character.
        FontRenderContext orig = getContext();
        FontRenderContext frc = new FontRenderContext(null, orig
                .isAntiAliased(), orig.usesFractionalMetrics());
        Shape shape = font.createGlyphVector(frc, new char[] { getUnicode(i) })
                .getGlyphOutline(0);
        return orig.getTransform().createTransformedShape(shape);
    }
View Full Code Here

     */
    public void paint(Graphics2D g2) {
        this.g2 = g2;

        // store at leat clip and transformation
        Shape clip = g2.getClip();
        AffineTransform at = g2.getTransform();
        Map hints = g2.getRenderingHints();

        // some quality settings
        g2.setRenderingHint(
View Full Code Here

            int glyphIndex);

    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

     * @see         com.google.code.appengine.awt.Graphics#setClip(int, int, int, int)
     * @see         com.google.code.appengine.awt.Graphics#setClip(Shape)
     * @since       JDK1.1
     */
    public Rectangle getClipBounds(){
        Shape c = getClip();
        if (c==null) {
            return null;
        }
        return c.getBounds();
    }
View Full Code Here

     * @see #setTransform
     * @see #setComposite
     * @see #setClip(Shape)
     */
    public void drawGlyphVector(GlyphVector g, float x, float y) {
        Shape glyphOutline = g.getOutline(x, y);
        fill(glyphOutline);
    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.Shape

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.