Package org.sikuli.api

Examples of org.sikuli.api.DesktopScreenRegion.find()


   
    URL clickhere = SpeakerExample.class.getResource("clickhere.wav");
   
    URL imageURL = Images.GoogleSearchButton;               
    Target imageTarget = new ImageTarget(imageURL);
    ScreenRegion r = s.find(imageTarget);   
    mouse.click(r.getCenter());   
   
    canvas.clear().addBox(r);
    canvas.displayWhile(new SpeakerPlayable(clickhere));
View Full Code Here


    canvas.clear().addBox(r);
    canvas.displayWhile(new SpeakerPlayable(clickhere));

    imageURL = Images.GoogleMicrophoneIcon;               
    imageTarget = new ImageTarget(imageURL);         
    r = s.find(imageTarget);            
    mouse.rightClick(r.getCenter());

    canvas.clear().addBox(r);
    canvas.displayWhile(new SpeakerPlayable(clickhere));
View Full Code Here

    canvas.clear().addBox(r);
    canvas.displayWhile(new SpeakerPlayable(clickhere));

    imageURL = Images.GoogleSearchFeelingLuckyButton;               
    imageTarget = new ImageTarget(imageURL);         
    r = s.find(imageTarget);
    mouse.doubleClick(r.getCenter());

    canvas.clear().addBox(r);
    canvas.displayWhile(new SpeakerPlayable(clickhere));
  }
View Full Code Here

  public static void main(String[] args) {
    simulator.start();   
    ScreenRegion s = new DesktopScreenRegion();     
    URL imageURL = Images.GoogleSearchButton;               
    Target imageTarget = new ImageTarget(imageURL);
    ScreenRegion r = s.find(imageTarget);   
   
    canvas.addBox(Relative.to(r).right(100).getScreenRegion());
    canvas.addLabel(Relative.to(r).right(100).center().getScreenLocation(), "right");

    canvas.addBox(Relative.to(r).left(100).getScreenRegion());
View Full Code Here

    ScreenRegion s = new DesktopScreenRegion();
   
    Target imageTarget = new ImageTarget(Images.ThumbIcon);

    ScreenRegion thumb = s.find(imageTarget);

    ScreenRegionCanvas canvas = new ScreenRegionCanvas(s);
    canvas.addBox(thumb);
    canvas.addLabel(Relative.to(thumb).topLeft().above(20).getScreenLocation(), "ImageTarget:");
    canvas.addImage(Relative.to(thumb).topLeft().above(25).right(85).getScreenLocation(), ImageIO.read(Images.ThumbIcon));
View Full Code Here

    URL imageURL = Images.GoogleSearchButton;               
    Target imageTarget = new ImageTarget(imageURL);
    // Issue the find command and get a new screen region
    // 'r' corresponding to the screen region occupied
    // by the found target
    ScreenRegion r = s.find(imageTarget);   
    // Click the center of 'r'   
    mouse.click(r.getCenter());   
    // Display a box around 'r' for 1 second
    canvas.addBox(r).display(1);
View Full Code Here

    canvas.addBox(r).display(1);

    // Find another image target and perform similar operations
    imageURL = Images.GoogleMicrophoneIcon;               
    imageTarget = new ImageTarget(imageURL);         
    r = s.find(imageTarget);            
    mouse.rightClick(r.getCenter());
    canvas.clear().addBox(r).display(1);

    // Find another image target and perform similar operations
    imageURL = Images.GoogleSearchFeelingLuckyButton;               
View Full Code Here

    canvas.clear().addBox(r).display(1);

    // Find another image target and perform similar operations
    imageURL = Images.GoogleSearchFeelingLuckyButton;               
    imageTarget = new ImageTarget(imageURL);         
    r = s.find(imageTarget);
    mouse.doubleClick(r.getCenter());
    canvas.clear().addBox(r).display(1);

  }
}
View Full Code Here

    for (int i=0; i < 10; i++){

      f.moveButtonsRandomly();

      ScreenRegion dogRegion = s.find(new ImageTarget(Images.Dog));
      ScreenRegion catRegion = s.find(new ImageTarget(Images.Cat));

      myMouse.click(dogRegion.getCenter());
      myMouse.click(catRegion.getCenter());
View Full Code Here

    for (int i=0; i < 10; i++){

      f.moveButtonsRandomly();

      ScreenRegion dogRegion = s.find(new ImageTarget(Images.Dog));
      ScreenRegion catRegion = s.find(new ImageTarget(Images.Cat));

      myMouse.click(dogRegion.getCenter());
      myMouse.click(catRegion.getCenter());

      myPainter.rectangle(dogRegion);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.