Class Finder

java.lang.Object
org.sikuli.script.Finder
All Implemented Interfaces:
Iterator<Match>

public class Finder
extends Object
implements Iterator<Match>
  • Constructor Details

    • Finder

      protected Finder()
    • Finder

      public Finder​(RIBS inWhat)
      Create a Finder for the given element
      Type Parameters:
      RIBS - Region, Image, BufferedImage or ScreenImage
      Parameters:
      inWhat - in what element (RIBS) to search
    • Finder

      public Finder​(ScreenImage simg, Region region)
      Finder for a Region on a ScreenImage
      Parameters:
      simg - ScreenImage
      region - the cropping region
  • Method Details

    • setScreenImage

      protected void setScreenImage​(ScreenImage simg)
    • setRepeating

      protected void setRepeating()
      internal use: to be able to reuse the same Finder
    • findRepeat

      protected void findRepeat()
      internal use: repeat with same Finder
    • findAllRepeat

      protected void findAllRepeat()
      internal use: repeat with same Finder
    • find

      public String find​(String imageOrText)
      do a find op with the given image or the given text in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      imageOrText - image file name or text
      Returns:
      null. if find setup not possible
    • find

      public String find​(Pattern aPtn)
      do a find op with the given pattern in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      aPtn - Pattern
      Returns:
      null. if find setup not possible
    • find

      public String find​(Image img)
      do a find op with the given image in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      img - Image
      Returns:
      null. if find setup not possible
    • find

      public String find​(BufferedImage img)
      do a find op with the given image in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      img - BufferedImage
      Returns:
      null. if find setup not possible
    • findChanges

      public List<Region> findChanges​(Object changedImage)
    • findAll

      public String findAll​(String imageOrText)
      do a findAll op with the given image or the given text in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      imageOrText - iamge file name or text
      Returns:
      null. if find setup not possible
    • findAll

      public String findAll​(Pattern aPtn)
      do a find op with the given pattern in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      aPtn - Pattern
      Returns:
      null. if find setup not possible
    • findAll

      public String findAll​(Image img)
      do a findAll op with the given image in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      img - Image
      Returns:
      null. if find setup not possible
    • findText

      public String findText​(String text)
      do a text find with the given text in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      text - text
      Returns:
      null. if find setup not possible
    • findWord

      public boolean findWord​(String text)
    • findWords

      public boolean findWords​(String text)
    • findWords

      public boolean findWords()
    • findLine

      public boolean findLine​(String text)
    • findLines

      public boolean findLines​(String text)
    • findLines

      public boolean findLines()
    • findAllText

      public String findAllText​(String text)
      do a findAll op with the given text in the Finder's image (hasNext() and next() will reveal possible match results)
      Parameters:
      text - text
      Returns:
      null. if find setup not possible
    • getList

      public List<Match> getList()
    • getListFor

      public <RI> List<Match> getListFor​(RI what)
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Match>
      Returns:
      true if Finder has a next match, false otherwise
    • next

      public Match next()
      Specified by:
      next in interface Iterator<Match>
      Returns:
      the next match or null
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<Match>
    • destroy

      public void destroy()
    • resetFindChanges

      public void resetFindChanges()
    • setFindChangesPixelDiff

      public void setFindChangesPixelDiff​(int value)
    • setFindChangesImageDiff

      public void setFindChangesImageDiff​(int value)