Package org.sikuli.api

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


    simulator.start();

    Rectangle b = simulator.getBounds();
    ScreenRegion s = new DesktopScreenRegion(b.x,b.y,b.width,b.height);
   
    ScreenRegion icon1 = s.find(new ImageTarget(Images.PersonIcon));;
    ScreenRegion icon2 = s.find(new ImageTarget(Images.ThumbIcon));;
    ScreenRegion icon3 = s.find(new ImageTarget(Images.TwitterBirdIcon));;

    canvas.addBox(icon1);
    canvas.addBox(icon2);
View Full Code Here


    Rectangle b = simulator.getBounds();
    ScreenRegion s = new DesktopScreenRegion(b.x,b.y,b.width,b.height);
   
    ScreenRegion icon1 = s.find(new ImageTarget(Images.PersonIcon));;
    ScreenRegion icon2 = s.find(new ImageTarget(Images.ThumbIcon));;
    ScreenRegion icon3 = s.find(new ImageTarget(Images.TwitterBirdIcon));;

    canvas.addBox(icon1);
    canvas.addBox(icon2);
    canvas.addBox(icon3);
View Full Code Here

    Rectangle b = simulator.getBounds();
    ScreenRegion s = new DesktopScreenRegion(b.x,b.y,b.width,b.height);
   
    ScreenRegion icon1 = s.find(new ImageTarget(Images.PersonIcon));;
    ScreenRegion icon2 = s.find(new ImageTarget(Images.ThumbIcon));;
    ScreenRegion icon3 = s.find(new ImageTarget(Images.TwitterBirdIcon));;

    canvas.addBox(icon1);
    canvas.addBox(icon2);
    canvas.addBox(icon3);
    canvas.display(1);
View Full Code Here

    canvas.addBox(s);
    canvas.addLabel(Relative.to(s).topLeft().getScreenLocation(), "Observed region");
    canvas.display(2);
   
    Target target = new ForegroundTarget();
    ScreenRegion r = s.find(target);   
   
    canvas.clear();
    canvas.addBox(r);
    canvas.addLabel(Relative.to(s).topLeft().getScreenLocation(), "find");
    canvas.addLabel(Relative.to(r).topLeft().getScreenLocation(), "foreground object");
View Full Code Here

   
    canvas.clear();
   
    // Finding color bullets
    ScreenRegion greenBullet = s.wait(new ColorImageTarget(Images.GreenBullet),10000);
    ScreenRegion redBullet = s.find(new ColorImageTarget(Images.RedBullet));
    ScreenRegion silverBullet = s.find(new ColorImageTarget(Images.SilverBullet));
   
    canvas.addBox(greenBullet);   
    canvas.addLabel(Relative.to(greenBullet).topLeft().above(20).getScreenLocation(), "green");
   
View Full Code Here

    canvas.clear();
   
    // Finding color bullets
    ScreenRegion greenBullet = s.wait(new ColorImageTarget(Images.GreenBullet),10000);
    ScreenRegion redBullet = s.find(new ColorImageTarget(Images.RedBullet));
    ScreenRegion silverBullet = s.find(new ColorImageTarget(Images.SilverBullet));
   
    canvas.addBox(greenBullet);   
    canvas.addLabel(Relative.to(greenBullet).topLeft().above(20).getScreenLocation(), "green");
   
    canvas.addBox(redBullet);
View Full Code Here

  public static void main(String[] args) {
    simulator.start();

    ScreenRegion s = new DesktopScreenRegion()

    ScreenRegion dog = s.find(new ImageTarget(Images.Dog));
    ScreenRegion cat = s.find(new ImageTarget(Images.Cat));
   
    mouse.click(dog.getCenter());
    mouse.click(cat.getCenter());
View Full Code Here

    simulator.start();

    ScreenRegion s = new DesktopScreenRegion()

    ScreenRegion dog = s.find(new ImageTarget(Images.Dog));
    ScreenRegion cat = s.find(new ImageTarget(Images.Cat));
   
    mouse.click(dog.getCenter());
    mouse.click(cat.getCenter());

    mouse.rightClick(dog.getCenter());
View Full Code Here

    ScreenRegion s = new DesktopScreenRegion();

    URL imageURL = Images.OSXDockIcon;               
    Target imageTarget = new ImageTarget(imageURL);

    ScreenRegion r = s.find(imageTarget);
    mouse.click(r.getCenter());   

    imageURL = Images.ThumbIcon;               
    imageTarget = new ImageTarget(imageURL);
View Full Code Here

    };

    // Find each string and display a box and a text label
    for (String stringToFind : stringsToFind){   
      Target textTarget = new TextTarget(stringToFind);
      ScreenRegion r = s.find(textTarget);
      canvas.addBox(r);
      canvas.addLabel(r, stringToFind);   
    }   
    canvas.display(5);
  }
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.