Package org.jemmy.env

Examples of org.jemmy.env.Timeout


                    Logger.getLogger(Browser.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }, "FX app launch thread").start();

        new Waiter(new Timeout("launch start waiter", 10000)).ensureState(new State<Boolean>() {
            public Boolean reached() {
                try {
                    Thread.sleep(100); // otherwise mac doesn't start
                } catch (InterruptedException ex) {
                }
View Full Code Here


            @Override
            public void run(Object... parameters) {
                int toOrig;
                int dragAttempt = 0;
                Timeout moveTimeout = wrap.getEnvironment().getTimeout(Drag.IN_DRAG_TIMEOUT).clone();
                while((toOrig = condition.to()) != 0) {
                    Vector axis = getScrollVector().
                            multiply(toOrig).setLenght(dragDelta);
                    if (reverse) {
                        axis.multiply(-1);
                    }
                    Vector shift = axis.clone();
                    Wrap<?> knob = getKnob();
                    Point orig = new Point(knob.getScreenBounds().getX() + knob.getScreenBounds().getWidth()/2, knob.getScreenBounds().getY() + knob.getScreenBounds().getHeight()/2);
                    knob.mouse().move(knob.toLocal(orig.getLocation()));
                    knob.mouse().press();
                    wrap.getEnvironment().getTimeout(Drag.BEFORE_DRAG_TIMEOUT).sleep();
                    try {
                        while (condition.to() == toOrig) {
                            wrap.getEnvironment().getTimeout(Drag.IN_DRAG_TIMEOUT).sleep();
//                            Rectangle old_pos = knob.getScreenBounds();
                            knob.mouse().move(knob.toLocal(orig.getLocation().translate(shift)));
//                            if (old_pos.equals(knob.getScreenBounds())) { // TODO: it would be better to check if we achieve maximum position
//                                break;
//                            }
                            if(scroll.position() == scroll.minimum() || scroll.position() == scroll.maximum()) {
                                break;
                            }
                            shift.add(axis);
                        }
                    } finally {
                        wrap.getEnvironment().getTimeout(Drag.BEFORE_DROP_TIMEOUT).sleep();
                        knob.mouse().release();
                    }
                    dragAttempt++;
                    if(dragAttempt >= MAX_SCROLL_ATTEMPTS) {
                        //did what we could
                        return;
                    }
                    //slow dow the scrolling
                    moveTimeout.setValue((long) (moveTimeout.getValue() * 1.5));
                }
            }
        });
    }
View Full Code Here

                if ("localhost".equalsIgnoreCase(connectionHost)
                        || "127.0.0.1".equals(connectionHost)) {
                    // TODO Improve check for localhost
                    startServer();
                    Environment.getEnvironment().getTimeout("");
                    Timeout waitTime = new Timeout("connection wait time", 5 * 60000);
                    socket = new Waiter(waitTime).ensureState(new State<Socket>() {
                        Exception ex;
                        public Socket reached() {
                            Socket socket = null;
                            try {
View Full Code Here

     *
     * @param target
     */
    public MouseImpl(Wrap<?> target, AWTMap awtMap) {
        this.target = target;
        this.robotDriver = new RobotDriver(new Timeout("", 10));
        this.awtMap = awtMap;
    }
View Full Code Here

                if ("localhost".equalsIgnoreCase(connectionHost)
                        || "127.0.0.1".equals(connectionHost)) {
                    // TODO Improve check for localhost
                    startServer();
                    Environment.getEnvironment().getTimeout("");
                    Timeout waitTime = new Timeout("connection wait time", 5 * 60000);
                    socket = new Waiter(waitTime).ensureState(new State<Socket>() {
                        Exception ex;
                        public Socket reached() {
                            Socket socket = null;
                            try {
View Full Code Here

TOP

Related Classes of org.jemmy.env.Timeout

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.