Java Code Examples for java.awt.Rectangle.setFrame()

The following are Jave code examples for showing how to use setFrame() of the java.awt.Rectangle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: SunGraphics2D.java   View Source Code Vote up 7 votes
public Rectangle getClipBounds(Rectangle r) {
    if (clipState != CLIP_DEVICE) {
        if (transformState <= TRANSFORM_INT_TRANSLATE) {
            if (usrClip instanceof Rectangle) {
                r.setBounds((Rectangle) usrClip);
            } else {
                r.setFrame(usrClip.getBounds2D());
            }
            r.translate(-transX, -transY);
        } else {
            r.setFrame(getClip().getBounds2D());
        }
    } else if (r == null) {
        throw new NullPointerException("null rectangle parameter");
    }
    return r;
}
 
Example 2
Project: jdk8u-jdk   File: SunGraphics2D.java   View Source Code Vote up 6 votes
public Rectangle getClipBounds(Rectangle r) {
    if (clipState != CLIP_DEVICE) {
        if (transformState <= TRANSFORM_INT_TRANSLATE) {
            if (usrClip instanceof Rectangle) {
                r.setBounds((Rectangle) usrClip);
            } else {
                r.setFrame(usrClip.getBounds2D());
            }
            r.translate(-transX, -transY);
        } else {
            r.setFrame(getClip().getBounds2D());
        }
    } else if (r == null) {
        throw new NullPointerException("null rectangle parameter");
    }
    return r;
}
 
Example 3
Project: openjdk-jdk10   File: SunGraphics2D.java   View Source Code Vote up 6 votes
public Rectangle getClipBounds(Rectangle r) {
    if (clipState != CLIP_DEVICE) {
        if (transformState <= TRANSFORM_INT_TRANSLATE) {
            if (usrClip instanceof Rectangle) {
                r.setBounds((Rectangle) usrClip);
            } else {
                r.setFrame(usrClip.getBounds2D());
            }
            r.translate(-transX, -transY);
        } else {
            r.setFrame(getClip().getBounds2D());
        }
    } else if (r == null) {
        throw new NullPointerException("null rectangle parameter");
    }
    return r;
}
 
Example 4
Project: ramus   File: DataLoader.java   View Source Code Vote up 5 votes
public static Rectangle readRectangle(final InputStream stream)
        throws IOException {
    final double x = readDouble(stream);
    final double y = readDouble(stream);
    final double w = readDouble(stream);
    final double h = readDouble(stream);
    final Rectangle rec = new Rectangle();
    rec.setFrame(x, y, w, h);
    return rec;
}