Package org.sikuli.api

Examples of org.sikuli.api.ScreenLocation


            "from {" + event.getOldState() + "} " +
            " to {" + event.getNewState() + "}");     
       
       
        String txt = event.getOldState() + "->" + event.getNewState();
        ScreenLocation labelLocation = Relative.to(event.getScreenRegion()).topLeft().above(20).getScreenLocation();
        canvas.clear().addLabel(labelLocation,txt).display(1);
      }         
    };

    ScreenRegion personIcon = s.wait(new ImageTarget(Images.PersonIcon),1000);   
View Full Code Here


    List<ScreenRegion> checkboxes = s.findAll(target);
    for (ScreenRegion c : checkboxes){
      // get the state of each checkbox
      String state = (String) c.getState();
      // display the state next to each checkbox to visualize
      ScreenLocation labelLocation = Relative.to(c).topLeft().left(70).below(10).getScreenLocation();
      canvas.addLabel(labelLocation, state);
    }
    canvas.display(3);
  }
View Full Code Here

      // across two screens
      destMouse.move(dest);
    } else {
      // if the move is within the same screen
      // move the cursor smoothly to the destination
      ScreenLocation src = getLocation();
      srcMouse.smoothMove(src, dest, 500);
    }   
  }
View Full Code Here

    // TODO: only need to find in a small area around the last location
    ScreenRegion r = screenRegion.find(target);
    if (r == null)
      return false;   

    ScreenLocation newLocation = Relative.to(r).topLeft().getScreenLocation();
    ScreenLocation lastLocation = Relative.to(lastTargetRegion).topLeft().getScreenLocation();

    boolean isXClose = Math.abs(newLocation.getX() - lastLocation.getX()) < 3;
    boolean isYClose = Math.abs(newLocation.getY() - lastLocation.getY()) < 3;

    return isXClose && isYClose;
  }
View Full Code Here

  public static ScreenLocation getCurrentMouseScreenLocation(){   
    Point p = MouseInfo.getPointerInfo().getLocation();   
    Screen screen = getCurrentScreenDevice().screen;
    Rectangle bounds = getCurrentScreenDevice().getBounds();
    ScreenLocation screenLocation = new DefaultScreenLocation(screen, p.x - bounds.x, p.y - bounds.y);
    screenLocation.setScreen(screen);
    return screenLocation;
  }
View Full Code Here

    // Pause one second to allow search results to load
    pause(1000);       
   
    keyboard.type("sikuli");
   
    ScreenLocation outside = Relative.to(searchButton).right(50).center().getScreenLocation();
    mouse.click(outside);
       
    mouse.click(searchButton.getCenter());
   
    // Pause one second to allow search results to load
View Full Code Here

TOP

Related Classes of org.sikuli.api.ScreenLocation

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.