Package org.sikuli.script
Class Finder
- java.lang.Object
-
- org.sikuli.script.Finder
-
- All Implemented Interfaces:
java.util.Iterator<Match>,org.sikuli.script.Matches
public class Finder extends java.lang.Object implements org.sikuli.script.Matches
-
-
Constructor Summary
Constructors Constructor Description Finder(ScreenImage simg, Region region)Finder for a Region on a ScreenImageFinder(RIBSM inWhat)Create a Finder for the given element
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Match>asList()MatchasMatch()static java.lang.StringasRegEx(java.lang.String text)voiddestroy()java.lang.Stringfind(java.awt.image.BufferedImage img)do a find op with the given image in the Finder's image (hasNext() and next() will reveal possible match results)java.lang.Stringfind(java.lang.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)java.lang.Stringfind(Image img)do a find op with the given image in the Finder's image (hasNext() and next() will reveal possible match results)java.lang.Stringfind(Pattern aPtn)do a find op with the given pattern in the Finder's image (hasNext() and next() will reveal possible match results)java.lang.StringfindAll(java.lang.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)java.lang.StringfindAll(Image img)do a findAll op with the given image in the Finder's image (hasNext() and next() will reveal possible match results)java.lang.StringfindAll(Pattern aPtn)do a find op with the given pattern in the Finder's image (hasNext() and next() will reveal possible match results)java.lang.StringfindAllText(java.lang.String text)do a findAll op with the given text in the Finder's image (hasNext() and next() will reveal possible match results)java.util.List<Region>findChanges(java.lang.Object changedImage)booleanfindLine(java.lang.String text)booleanfindLines()booleanfindLines(java.lang.String text)java.lang.StringfindText(java.lang.String text)do a text find with the given text in the Finder's image (hasNext() and next() will reveal possible match results)booleanfindWord(java.lang.String text)booleanfindWords()booleanfindWords(java.lang.String text)java.util.List<Match>getList()<RI> java.util.List<Match>getListFor(RI what)static java.util.regex.PatterngetRegEx(java.lang.String text)booleanhasNext()static booleanisRegEx(java.lang.String text)Matchnext()voidremove()voidresetFindChanges()voidsetFindChangesImageDiff(int value)voidsetFindChangesPixelDiff(int value)
-
-
-
Constructor Detail
-
Finder
public Finder(RIBSM inWhat)
Create a Finder for the given element- Type Parameters:
RIBSM- Region, Image, BufferedImage, ScreenImage, image filename, cvMat- Parameters:
inWhat- in what element (RIBS) to search
-
Finder
public Finder(ScreenImage simg, Region region)
Finder for a Region on a ScreenImage- Parameters:
simg- ScreenImageregion- the cropping region
-
-
Method Detail
-
find
public java.lang.String find(java.lang.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 java.lang.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 java.lang.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 java.lang.String find(java.awt.image.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 java.util.List<Region> findChanges(java.lang.Object changedImage)
-
findAll
public java.lang.String findAll(java.lang.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 java.lang.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 java.lang.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 java.lang.String findText(java.lang.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(java.lang.String text)
-
findWords
public boolean findWords(java.lang.String text)
-
findWords
public boolean findWords()
-
findLine
public boolean findLine(java.lang.String text)
-
findLines
public boolean findLines(java.lang.String text)
-
findLines
public boolean findLines()
-
findAllText
public java.lang.String findAllText(java.lang.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
-
asRegEx
public static java.lang.String asRegEx(java.lang.String text)
-
isRegEx
public static boolean isRegEx(java.lang.String text)
-
getRegEx
public static java.util.regex.Pattern getRegEx(java.lang.String text)
-
getList
public java.util.List<Match> getList()
-
getListFor
public <RI> java.util.List<Match> getListFor(RI what)
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<Match>- Specified by:
hasNextin interfaceorg.sikuli.script.Matches- Returns:
- true if Finder has a next match, false otherwise
-
next
public Match next()
- Specified by:
nextin interfacejava.util.Iterator<Match>- Specified by:
nextin interfaceorg.sikuli.script.Matches- Returns:
- the next match or null
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<Match>
-
destroy
public void destroy()
-
asMatch
public Match asMatch()
- Specified by:
asMatchin interfaceorg.sikuli.script.Matches
-
asList
public java.util.List<Match> asList()
- Specified by:
asListin interfaceorg.sikuli.script.Matches
-
resetFindChanges
public void resetFindChanges()
-
setFindChangesPixelDiff
public void setFindChangesPixelDiff(int value)
-
setFindChangesImageDiff
public void setFindChangesImageDiff(int value)
-
-