Package com.google.code.appengine.awt

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


    public Rectangle getBounds() {
        int x1 = (int)Math.floor(getMinX());
        int y1 = (int)Math.floor(getMinY());
        int x2 = (int)Math.ceil(getMaxX());
        int y2 = (int)Math.ceil(getMaxY());
        return new Rectangle(x1, y1, x2 - x1, y2 - y1);
    }
View Full Code Here


        super();

        this.size = size;
        this.doRestoreOnDispose = doRestoreOnDispose;

        deviceClip = (size != null ? new Rectangle(0, 0, size.width,
                size.height) : null);
        userClip = null;
        currentTransform = new AffineTransform();
        currentComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
        currentStroke = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE,
View Full Code Here

        super(graphics);
        this.doRestoreOnDispose = doRestoreOnDispose;

        size = new Dimension(graphics.size);

        deviceClip = new Rectangle(graphics.deviceClip);
        userClip = (graphics.userClip != null) ? new Area(graphics.userClip)
                : null;
        currentTransform = new AffineTransform(graphics.currentTransform);
        currentComposite = graphics.currentComposite;
        currentStroke = graphics.currentStroke;
View Full Code Here

     * Gets the current clip in form of a Rectangle.
     *
     * @return current clip
     */
    public Rectangle getClipBounds(Rectangle r) {
        Rectangle bounds = getClipBounds();
        if (bounds != null)
            r.setBounds(bounds);
        return r;
    }
View Full Code Here

     * @param y rectangle for clipping
     * @param width rectangle for clipping
     * @param height rectangle for clipping
     */
    public void clipRect(int x, int y, int width, int height) {
        clip(new Rectangle(x, y, width, height));
    }
View Full Code Here

     * @param y rectangle for clipping
     * @param width rectangle for clipping
     * @param height rectangle for clipping
     */
    public void setClip(int x, int y, int width, int height) {
        setClip(new Rectangle(x, y, width, height));
    }
View Full Code Here

        this(new FileOutputStream(file), size);
    }

    public EMFGraphics2D(OutputStream os, Dimension size) {
        super(size, false);
        this.imageBounds = new Rectangle(0, 0, size.width, size.height);
        init(os);
    }
View Full Code Here

            return;
        }

        // 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);
            }
        }
View Full Code Here

    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

        return getFontMetrics(getFont());
    }

    public boolean hitClip(int x, int y, int width, int height) {
        // TODO: Create package private method Rectangle.intersects(int, int, int, int);
        return getClipBounds().intersects(new Rectangle(x, y, width, height));
    }
View Full Code Here

TOP

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

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.