Package com.google.code.appengine.awt

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


        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();
                rect.setRect(bounds);
                return rect;
            }*/
        }
       
        shape.transform(at);

        Rectangle bounds = shape.getBounds();
        return new Rectangle((int)bounds.getX(), (int)bounds.getY(),
                            (int)bounds.getWidth()-1, (int)bounds.getHeight()-1);
        }
View Full Code Here


        if (bounds != null) {
            return bounds;
        }

        if (isEmpty()) {
            return bounds = new Rectangle();
        }

        int x1 = rect[1];
        int y1 = rect[2];
        int x2 = rect[3];
        int y2 = rect[4];
       
        for(int i = 5; i < rect[0]; i += 4) {
            int rx1 = rect[i + 0];
            int ry1 = rect[i + 1];
            int rx2 = rect[i + 2];
            int ry2 = rect[i + 3];
            if (rx1 < x1) {
                x1 = rx1;
            }
            if (rx2 > x2) {
                x2 = rx2;
            }
            if (ry1 < y1) {
                y1 = ry1;
            }
            if (ry2 > y2) {
                y2 = ry2;
            }
        }
       
        return bounds = new Rectangle(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
    }
View Full Code Here

        }

        rectangles = new Rectangle[(rect[0] - 1) / 4];
        int j = 0;
        for(int i = 1; i < rect[0]; i += 4) {
            rectangles[j++] = new Rectangle(
                    rect[i],
                    rect[i + 1],
                    rect[i + 2] - rect[i] + 1,
                    rect[i + 3] - rect[i + 1] + 1);
        }
View Full Code Here

    /**
     * Tests does rectangle intersect MultiRectArea object
     */
    public boolean intersects(double x, double y, double w, double h) {
        Rectangle r = new Rectangle();
        r.setRect(x, y, w, h);
        return intersects(r);
    }
View Full Code Here

        }
    }

    @Override
    public void clipRect(int x, int y, int width, int height) {
        clip(new Rectangle(x, y, width, height));
    }
View Full Code Here

    public void fillRect(int x, int y, int width, int height) {
        if (debugOutput) {
            System.err.println("CommonGraphics2D.fillRect("+x+", "+y+", "+width+", "+height+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
        }

        fill(new Rectangle(x, y, width, height));
    }
View Full Code Here

    public Rectangle getClipBounds() {
        if (clip == null) {
            return null;
        }

        Rectangle res = (Rectangle) clip.getBounds().clone();
        res.translate(-Math.round((float)transform.getTranslateX()), -Math.round((float)transform.getTranslateY()));
        return res;
    }
View Full Code Here

        bgColor = color;
    }

    @Override
    public void setClip(int x, int y, int width, int height) {
        setClip(new Rectangle(x, y, width, height));
    }
View Full Code Here

    /**
     * This method fills the given MultiRectArea with any paint.
     * @param mra MultiRectArea to fill
     */
    protected void fillMultiRectAreaPaint(MultiRectArea mra) {
        Rectangle rec = mra.getBounds();
        int x = rec.x;
        int y = rec.y;
        int w = rec.width;
        int h = rec.height;
        if(w <= 0 || h <= 0) {
View Full Code Here

   
    public void addDirtyRegion(Rectangle r){
        if (dirtyRegions == null) {
            dirtyRegions = new MultiRectArea(r);
        } else {
            Rectangle rects[] = dirtyRegions.getRectangles();
            if (rects.length == 1){
                if (rects[0].contains(r)) return;
            }
            dirtyRegions.add(r);
        }
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.