Package org.sikuli.api

Examples of org.sikuli.api.ImageTarget


    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);
    canvas.addBox(icon3);
    canvas.display(1);
View Full Code Here


    Target target;
    List<ScreenRegion> rs;

    // find all unchecked checkboxes ordered from bottom to top 
   
    target = new ImageTarget(Images.UncheckedCheckbox);
    target.setLimit(15);
    target.setOrdering(Target.Ordering.BOTTOM_UP);
   
    rs = s.findAll(target);
   
View Full Code Here

        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);   
    canvas.clear().addBox(personIcon).display(1);
   
    ScreenRegion statusIcon = Relative.to(personIcon).right(30).getScreenRegion();
    canvas.clear().addBox(personIcon).display(1);   
View Full Code Here

    simulator.start();            
    Rectangle b = simulator.getBounds();
    ScreenRegion s = new DesktopScreenRegion(b.x, b.y, b.width, b.height);

    List<ScreenRegion> rs;
    Target target = new ImageTarget(Images.HollowRedStar);
    target.setOrdering(Ordering.LEFT_RIGHT);
    rs = s.findAll(target);         

    ScreenRegion left = rs.get(0);
    ScreenRegion right = rs.get(1);
View Full Code Here

      mouse.hover(Relative.to(innerRegion).topRight().getScreenLocation());
      mouse.hover(Relative.to(innerRegion).bottomRight().getScreenLocation());
      mouse.hover(Relative.to(innerRegion).bottomLeft().getScreenLocation());
     
      // find the dog and click on it
      ScreenRegion dog = innerRegion.find(new ImageTarget(Images.Dog));
      mouse.click(dog.getCenter());
     
      c.hide();
    }
   
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());

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

    simulator.start();

    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);

    r = s.wait(imageTarget, 5000);
    mouse.click(r.getCenter());

    imageURL = Images.CheckedCheckbox;               
    imageTarget = new ImageTarget(imageURL);         

    r = s.wait(imageTarget, 5000);
    mouse.click(r.getCenter());
   
    imageURL = Images.OSXDockIcon;
    imageTarget = new ImageTarget(imageURL);
    r = s.wait(imageTarget, 5000);
   

  }
View Full Code Here

    simulator.start();
    Rectangle b = simulator.getBounds();
    ScreenRegion s = new DesktopScreenRegion(b.x,b.y,b.width,b.height);
       
    // create an image target based on an image of a checked checkbox
    ImageTarget checked = new ImageTarget(Images.CheckedCheckbox);
    // create an image target based on an image of an unchecked checkbox
    ImageTarget unchecked = new ImageTarget(Images.UncheckedCheckbox);
   
    // create a multi-state target to look for checkboxes
    MultiStateTarget target = new MultiStateTarget();
    // add the "checked" state specified by the image target of a checked checkbox
    target.addState(checked, "checked");
View Full Code Here

    ScreenRegion s = new DesktopScreenRegion()
   
    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));

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

    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");
View Full Code Here

TOP

Related Classes of org.sikuli.api.ImageTarget

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.