public class Pattern extends Object
Constructor and Description |
---|
Pattern()
creates empty Pattern object at least setFilename() or setBImage() must be used before the
Pattern object is ready for anything
|
Pattern(BufferedImage bimg)
A Pattern from a BufferedImage
|
Pattern(Image img)
create a Pattern with given image
|
Pattern(Pattern p)
create a new Pattern from another (attribs are copied)
|
Pattern(ScreenImage simg)
A Pattern from a ScreenImage
|
Pattern(String imgpath)
create a Pattern based on an image file name
|
Pattern(URL url)
Pattern from a Java resource (Object.class.getResource)
|
Modifier and Type | Method and Description |
---|---|
Pattern |
exact()
sets the minimum Similarity to 0.99 which means exact match
|
BufferedImage |
getBImage()
ONLY FOR INTERNAL USE! Might vanish without notice!
|
String |
getFilename()
the current image's absolute filepath
will return null, if image is in jar or in web use getFileURL in this case |
URL |
getFileURL()
the current image's URL
|
Image |
getImage()
get the Pattern's image
|
float |
getSimilar() |
Location |
getTargetOffset() |
int |
getTimeAfter()
TODO: Usage to be implemented! get the seconds to wait, after this pattern is acted on |
boolean |
isImagePattern()
true if Pattern was created from Image
|
boolean |
isValid()
check wether the image is valid
|
Pattern |
setBImage(BufferedImage bimg)
ONLY FOR INTERNAL USE! Might vanish without notice!
|
Pattern |
setFilename(Image img)
set a new image for this pattern
|
Pattern |
setFilename(String fileName)
set a new image for this pattern
|
Pattern |
setFilename(URL fileURL)
set a new image for this pattern
|
Pattern |
setImage(Image img)
sets the Pattern's image
|
void |
setTimeAfter(int secs)
set the seconds to wait, after this pattern is acted on
|
Pattern |
similar(float sim)
sets the minimum Similarity to use with findX
|
Pattern |
targetOffset(int dx,
int dy)
set the offset from the match's center to be used with mouse actions
|
Pattern |
targetOffset(Location loc)
set the offset from the match's center to be used with mouse actions
|
String |
toString() |
public Pattern()
public Pattern(Pattern p)
p
- other Patternpublic Pattern(Image img)
img
- Imagepublic Pattern(String imgpath)
imgpath
- image filenamepublic Pattern(URL url)
url
- image file URLpublic Pattern(BufferedImage bimg)
bimg
- BufferedImagepublic Pattern(ScreenImage simg)
simg
- ScreenImagepublic boolean isImagePattern()
public boolean isValid()
public Pattern setFilename(String fileName)
fileName
- image filenamepublic Pattern setFilename(URL fileURL)
fileURL
- image file URLpublic Pattern setFilename(Image img)
img
- Imagepublic String getFilename()
public URL getFileURL()
public Pattern similar(float sim)
sim
- value 0 to 1public Pattern exact()
public float getSimilar()
public Pattern targetOffset(int dx, int dy)
dx
- x offsetdy
- y offsetpublic Pattern targetOffset(Location loc)
loc
- Locationpublic Location getTargetOffset()
public BufferedImage getBImage()
public Pattern setBImage(BufferedImage bimg)
bimg
- BufferedImagepublic Pattern setImage(Image img)
img
- Imagepublic Image getImage()
public void setTimeAfter(int secs)
secs
- secondspublic int getTimeAfter()