Package org.jemmy

Examples of org.jemmy.Rectangle


     * @param local
     * @return
     * @see #toLocal(org.jemmy.Point)
     */
    public Point toAbsolute(Point local) {
        Rectangle bounds = getScreenBounds();
        return local.translate(bounds.x, bounds.y);
    }
View Full Code Here


     * @param local
     * @return coordinates which should be used for mouse operations.
     * @see #toAbsolute(org.jemmy.Point)
     */
    public Point toLocal(Point local) {
        Rectangle bounds = getScreenBounds();
        return local.translate(-bounds.x, -bounds.y);
    }
View Full Code Here

     * actual capturing.
     *
     * @return TODO find a replacement
     */
    public Image getScreenImage() {
        Rectangle bounds = getScreenBounds();
        return getScreenImage(new Rectangle(0, 0, bounds.width, bounds.height));
    }
View Full Code Here

     * saved if null.
     * @param diffID ID of a diff image to save in case of failure. No image
     * saved if null.
     */
    public void waitImage(final Image golden, String resID, String diffID) {
        Rectangle bounds = getScreenBounds();
        waitImage(golden, new Rectangle(0, 0, bounds.width, bounds.height), resID, diffID);
    }
View Full Code Here

    protected Rectangle getArea() {
        return constructArea(wrap, includeControl, hr, vr);
    }

    private static Rectangle constructArea(Wrap wrap, boolean includeControl, int hr, int vr) {
        Rectangle res = new Rectangle();
        res.width = MAX_SCREEN_SIZE;
        res.height = MAX_SCREEN_SIZE;
        Rectangle bounds = wrap.getScreenBounds();
        if (hr != 0) {
            if (hr < 0) {
                res.x = -MAX_SCREEN_SIZE + bounds.x + (includeControl ? bounds.width : 0);
            } else {
                res.x = bounds.x + (includeControl ? 0 : bounds.width);
View Full Code Here

     * rectangle to match the lookup
     */
    protected abstract Rectangle getBounds(CONTROL control);

    public boolean check(CONTROL control) {
        Rectangle a = getArea();
        Rectangle bounds = getBounds(control);
        return bounds.x >= a.x && bounds.y >= a.y &&
                (bounds.x + bounds.width) <= (a.x + a.width) &&
                (bounds.y + bounds.height) <= (a.y + a.height);
    }
View Full Code Here

            pos.x += cnt.getLocation().x;
            pos.y += cnt.getLocation().y;
        } while((cnt = cnt.getParent()) != null);
        //SwingUtilities.convertPointToScreen(pos, getControl());

        return new Rectangle(pos.x, pos.y, oper.getWidth(), oper.getHeight());
    }
View Full Code Here

            }
        });
    }

    static Point getAbsolute(MouseTarget target, Point p) {
        Rectangle screenBounds = target.getScreenBounds();
        return new Point(p.x + screenBounds.x, p.y + screenBounds.y);
    }
View Full Code Here

     *
     * @param r
     * @return org.jemmy.Rectangle
     */
    public static Rectangle convert(java.awt.Rectangle r) {
        return new Rectangle(r.x, r.y, r.width, r.height);
    }
View Full Code Here

        } catch (ClassNotFoundException ex) {
        }
    }

    public Image capture(Wrap<?> control, Rectangle area) {
        Rectangle rect = new Rectangle();
        Rectangle bounds = control.getScreenBounds();
        rect.x = bounds.x + area.x;
        rect.y = bounds.y + area.y;
        rect.width = area.width;
        rect.height = area.height;
        return RobotDriver.createScreenCapture(rect);
View Full Code Here

TOP

Related Classes of org.jemmy.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.