Modifier and Type | Field and Description |
---|---|
static int |
CREATE_X_DIRECTION_LEFT
Flag for the
create(Location, int, int, int, int) method. |
static int |
CREATE_X_DIRECTION_RIGHT
Flag for the
create(Location, int, int, int, int) method. |
static int |
CREATE_Y_DIRECTION_BOTTOM
Flag for the
create(Location, int, int, int, int) method. |
static int |
CREATE_Y_DIRECTION_TOP
Flag for the
create(Location, int, int, int, int) method. |
int |
h
Height of the Region
|
int |
w
Width of the Region
|
int |
x
X-coordinate of the Region
|
int |
y
Y-coordinate of the Region
|
Modifier | Constructor and Description |
---|---|
protected |
Region()
internal use only, used for new Screen objects to get the Region behavior
|
|
Region(int X,
int Y,
int W,
int H)
Create a region with the provided coordinate / size
|
|
Region(int X,
int Y,
int W,
int H,
int screenNumber)
Create a region with the provided coordinate / size and screen
|
|
Region(int X,
int Y,
int W,
int H,
Screen parentScreen)
Create a region with the provided coordinate / size and screen
|
|
Region(Rectangle r)
Create a region from a Rectangle
|
|
Region(Region r)
Create a new region from another region
including the region's settings |
Modifier and Type | Method and Description |
---|---|
Region |
above()
create a region above the top side with same width
the new region extends to the top screen border use grow() to include the current region |
Region |
above(int height)
create a region above the top side with same width and given height
use grow() to include the current region |
Location |
aboveAt() |
Location |
aboveAt(int offset)
negative offset goes towards top of screen
might be off current screen |
Region |
add(int l,
int r,
int t,
int b)
resize the region using the given padding values
might be negative |
Region |
add(Location loc)
extend the region, so it contains the given point
but only the part inside the current screen |
Region |
add(Region r)
extend the region, so it contains the given region
but only the part inside the current screen |
static Location |
atMouse() |
Region |
below()
create a region below the bottom side with same width
the new region extends to the bottom screen border use grow() to include the current region |
Region |
below(int height)
create a region below the bottom side with same width and given height
use grow() to include the current region |
Location |
belowAt() |
Location |
belowAt(int offset)
positive offset goes towards bottom of screen
might be off current screen |
int |
click()
left click at the region's last successful match
use center if no lastMatch if region is a match: click targetOffset |
<PatternFilenameRegionMatchLocation> |
click(PatternFilenameRegionMatchLocation target)
left click at the given target location
Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
<PatternFilenameRegionMatchLocation> |
click(PatternFilenameRegionMatchLocation target,
int modifiers)
left click at the given target location
holding down the given modifier keys Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
boolean |
contains(Location point)
check if current region contains given point
|
boolean |
contains(Region region)
check if current region contains given region
|
boolean |
containsMouse()
check if mouse pointer is inside current region
|
Region |
copyTo(int scrID)
new region with same offset to current screen's top left on given screen
|
Region |
copyTo(Screen screen)
new region with same offset to current screen's top left on given screen
|
static Region |
create(int X,
int Y,
int W,
int H)
Create a region with the provided top left corner and size
|
static Region |
create(Location loc,
int w,
int h)
Create a region with the provided top left corner and size
|
static Region |
create(Location loc,
int create_x_direction,
int create_y_direction,
int w,
int h)
create a region with a corner at the given point
as specified with x y 0 0 top left 0 1 bottom left 1 0 top right 1 1 bottom right |
static Region |
create(Rectangle r)
Create a region from a Rectangle
|
protected static Region |
create(Rectangle r,
Screen parentScreen)
Create a region from a Rectangle on a given Screen
|
static Region |
create(Region r)
Create a region from another region
including the region's settings |
int |
doubleClick()
double click at the region's last successful match
use center if no lastMatch if region is a match: click targetOffset |
<PatternFilenameRegionMatchLocation> |
doubleClick(PatternFilenameRegionMatchLocation target)
double click at the given target location
Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
<PatternFilenameRegionMatchLocation> |
doubleClick(PatternFilenameRegionMatchLocation target,
int modifiers)
double click at the given target location
holding down the given modifier keys Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
<PatternFilenameRegionMatchLocation> |
drag(PatternFilenameRegionMatchLocation target)
Prepare a drag action: move mouse to given target
press and hold left mouse button wait Settings.DelayAfterDrag |
<PatternFilenameRegionMatchLocation> |
dragDrop(PatternFilenameRegionMatchLocation target)
Drag from region's last match and drop at given target
applying Settings.DelayAfterDrag and DelayBeforeDrop using left mouse button |
<PatternFilenameRegionMatchLocation> |
dragDrop(PatternFilenameRegionMatchLocation t1,
PatternFilenameRegionMatchLocation t2)
Drag from a position and drop to another using left mouse button
applying Settings.DelayAfterDrag and DelayBeforeDrop |
<PatternFilenameRegionMatchLocation> |
dropAt(PatternFilenameRegionMatchLocation target)
finalize a drag action with a drop: move mouse to given target
wait Settings.DelayBeforeDrop release the left mouse button |
<PatternOrString> |
exists(PatternOrString target)
Check if target exists (with the default autoWaitTimeout)
|
<PatternOrString> |
exists(PatternOrString target,
double timeout)
Check if target exists with a specified timeout
|
<PatternOrString> |
find(PatternOrString target)
Match find( Pattern/String ) finds the given pattern on the screen and
returns the best match.
|
<PatternOrString> |
findAll(PatternOrString target)
Iterator
|
Match |
findAllText(String text) |
Match |
findAllText(String text,
double timeout) |
Match |
findText(String text) |
Match |
findText(String text,
double timeout) |
double |
getAutoWaitTimeout()
current setting for this region (see setAutoWaitTimeout)
|
Location |
getBottomLeft() |
Location |
getBottomRight() |
Location |
getCenter() |
SikuliEventManager |
getEvtMgr() |
FindFailedResponse |
getFindFailedResponse() |
int |
getH() |
Match |
getLastMatch()
a find operation saves its match on success in the used region object
unchanged if not successful |
Iterator<Match> |
getLastMatches()
a findAll operation saves its matches on success in the used region
object
unchanged if not successful |
ScreenImage |
getLastScreenImage()
get the last image taken on this regions screen
|
String |
getLastScreenImageFile()
stores the lastScreenImage in the current bundle path with a created unique
name
|
String |
getLastScreenImageFile(String name)
stores the lastScreenImage in the current bundle path with the given name
|
String |
getLastScreenImageFile(String path,
String name)
stores the lastScreenImage in the given path with the given name
|
float |
getObserveScanRate() |
Rectangle |
getRect() |
Screen |
getScreen() |
Screen |
getScreenContaining()
Deprecated.
Only for compatibility, to get the screen containing this
region, use
getScreen() |
Location |
getTarget()
convenience method
|
boolean |
getThrowException()
current setting for this region (see setThrowException)
|
Location |
getTopLeft() |
Location |
getTopRight() |
int |
getW() |
int |
getWaitForVanish() |
float |
getWaitScanRate() |
int |
getX() |
int |
getY() |
Region |
grow(int range)
create a region enlarged range pixels on each side
|
Region |
grow(int w,
int h)
create a region enlarged w pixels on left and right side
and h pixels at top and bottom |
Region |
grow(int l,
int r,
int t,
int b)
create a region enlarged l pixels on left and r pixels right side
and t pixels at top side and b pixels at bottom side |
static Region |
grow(Location loc)
create a minimal symetric region at given point as center with size 3x3
|
static Region |
grow(Location loc,
int w,
int h)
create a region with the given point as center and the given size
|
static Region |
grow(Location loc,
int x,
int y,
int w,
int h)
create a region with a corner at the given point
as specified with x y 0 0 top left 0 1 bottom left 1 0 top right 1 1 bottom right same as the corresponding create method, here to be naming compatible with class Location |
Region |
highlight()
Toggle the regions Highlight visibility (currently red frame)
|
Region |
highlight(float secs)
show the regions Highlight for the given time in seconds (currently red
frame) if 0 - use the global Settings.SlowMotionDelay
|
Region |
highlight(int secs)
hack to implement the getLastMatch() convenience 0 means same as
highlight() <.0 same as highlight(secs) if available the last match is
highlighted
|
int |
hover()
move the mouse pointer to region's last successful match
use center if no lastMatch if region is a match: move to targetOffset same as mouseMove |
<PatternFilenameRegionMatchLocation> |
hover(PatternFilenameRegionMatchLocation target)
move the mouse pointer to the given target location
same as mouseMove Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
protected void |
initScreen(Screen scr)
Detects on which Screen the Region is present.
|
Region |
inside()
Deprecated.
only for backward compatibility
|
Region |
intersection(Region ir)
create a region that is the intersection of the given regions
|
boolean |
isObserving() |
void |
keyDown(int keycode)
press and hold the given key use a constant from java.awt.event.KeyEvent
which might be special in the current machine/system environment
|
void |
keyDown(String keys)
press and hold the given keys including modifier keys
use the key constants defined in class Key, which only provides a subset of a US-QWERTY PC keyboard layout might be mixed with simple characters use + to concatenate Key constants |
void |
keyUp()
release all currently pressed keys
|
void |
keyUp(int keycode)
release the given keys (see keyDown(keycode) )
|
void |
keyUp(String keys)
release the given keys (see keyDown(keys) )
|
Region |
left()
create a region left of the left side with same height
the new region extends to the left screen border use grow() to include the current region |
Region |
left(int width)
create a region left of the left side with same height and given width
use grow() to include the current region |
Location |
leftAt() |
Location |
leftAt(int offset)
negative offset goes to the left
might be off current screen |
List<Match> |
listText()
VERY EXPERIMENTAL: returns a list of matches, that represent single words,
that have been found in this region
the match's x,y,w,h the region of the word Match.getText() returns the word (utf8) at this match Match.getScore() returns a value between 0 ... |
Region |
morphTo(Region r)
Deprecated.
to be like AWT Rectangle API use setRect() instead
|
void |
mouseDown(int buttons)
press and hold the specified buttons - use + to combine Button.LEFT left
mouse button Button.MIDDLE middle mouse button Button.RIGHT right mouse
button
|
int |
mouseMove()
move the mouse pointer to the region's last successful match
same as hover |
<PatternFilenameRegionMatchLocation> |
mouseMove(PatternFilenameRegionMatchLocation target)
move the mouse pointer to the given target location
same as hover Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
void |
mouseUp()
release all currently held buttons
|
void |
mouseUp(int buttons)
release the specified mouse buttons (see mouseDown) if buttons==0, all
currently held buttons are released
|
Region |
moveTo(Location loc)
Deprecated.
to be like AWT Rectangle API use setLocation()
|
Region |
nearby()
Deprecated.
to be like AWT Rectangle API use grow() instead
|
Region |
nearby(int range)
Deprecated.
to be like AWT Rectangle API use grow() instaed
|
void |
observe() |
void |
observe(double secs) |
void |
observeInBackground(double secs) |
Region |
offset(int _x,
int _y)
create region with same size at top left corner offset
|
Region |
offset(Location loc)
create region with same size at top left corner offset
|
<PatternOrString> |
onAppear(PatternOrString target,
Object observer) |
void |
onChange(int threshold,
Object observer) |
void |
onChange(SikuliEventObserver observer) |
<PatternOrString> |
onVanish(PatternOrString target,
Object observer) |
<PatternFilenameRegionMatchLocation> |
paste(PatternFilenameRegionMatchLocation target,
String text)
first does a click(target) at the given target position to gain
focus/carret
and then pastes the text using the clipboard and strg/ctrl/cmd-v (paste keyboard shortcut) |
int |
paste(String text)
pastes the text at the current position of the focus/carret
using the clipboard and strg/ctrl/cmd-v (paste keyboard shortcut) |
protected Rectangle |
regionOnScreen(Screen screen)
Checks if the Screen contains the Region.
|
void |
resetScreens()
synonym for resetMonitors
|
Region |
right()
create a region right of the right side with same height
the new region extends to the right screen border use grow() to include the current region |
Region |
right(int width)
create a region right of the right side with same height and given width
use grow() to include the current region |
Location |
rightAt() |
Location |
rightAt(int offset)
positive offset goes to the right
might be off current screen |
int |
rightClick()
right click at the region's last successful match
use center if no lastMatch if region is a match: click targetOffset |
<PatternFilenameRegionMatchLocation> |
rightClick(PatternFilenameRegionMatchLocation target)
right click at the given target location
Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
<PatternFilenameRegionMatchLocation> |
rightClick(PatternFilenameRegionMatchLocation target,
int modifiers)
right click at the given target location
holding down the given modifier keys Pattern or Filename - do a find before and use the match Region - position at center Match - position at match's targetOffset Location - position at that point |
void |
setAutoWaitTimeout(double sec)
the time in seconds a find operation should wait for the appearence of the
target in this region
initial value 3 secs |
Region |
setBottomLeft(Location loc)
Moves the region to the area, whose bottom left corner is the given
location
|
Region |
setBottomRight(Location loc)
Moves the region to the area, whose bottom right corner is the given
location
|
Region |
setCenter(Location loc)
Moves the region to the area, whose center is the given location
|
void |
setEvtMgr(SikuliEventManager em) |
void |
setFindFailedResponse(FindFailedResponse response)
FindFailedResponse.
ABORT - (initial value) abort script on FindFailed (= setThrowException(true) ) SKIP - ignore FindFailed (same as setThrowException(false) ) PROMPT - display prompt on FindFailed to let user decide how to proceed RETRY - continue to wait for appearence on FindFailed (caution: endless loop) |
void |
setH(int H) |
Region |
setLocation(Location loc)
set the regions position
this might move the region even to another screen |
void |
setObserveScanRate(float observeScanRate)
set the regions individual ObserveScanRate
|
Region |
setRect(int X,
int Y,
int W,
int H)
set the regions position/size
this might move the region even to another screen |
Region |
setRect(Rectangle r)
set the regions position/size
this might move the region even to another screen |
Region |
setRect(Region r)
set the regions position/size
this might move the region even to another screen |
void |
setROI(int X,
int Y,
int W,
int H)
resets this region to the given location, and size
this might move the region even to another screen Because of the wanted side effect for the containing screen, this should only be used with screen objects. |
void |
setROI(Rectangle roi)
resets this region to the given rectangle
this might move the region even to another screen Because of the wanted side effect for the containing screen, this should only be used with screen objects. |
void |
setROI(Region reg)
resets this region to the given region
this might move the region even to another screen Because of the wanted side effect for the containing screen, this should only be used with screen objects. |
protected void |
setScreen(int id)
Sets a new Screen for this region.
|
protected void |
setScreen(Screen is)
Sets a new Screen for this region.
|
Region |
setSize(int W,
int H) |
void |
setThrowException(boolean flag)
true - (initial setting) should throw exception FindFailed if find
unsuccessful in this region
false - do not abort script on FindFailed (might leed to null pointer exceptions later) |
Region |
setTopLeft(Location loc)
Moves the region to the area, whose top left corner is the given location
|
Region |
setTopRight(Location loc)
Moves the region to the area, whose top right corner is the given location
|
void |
setW(int W) |
void |
setWaitForVanish(int waitForVanish)
set the regions individual WaitForVanish
|
void |
setWaitScanRate(float waitScanRate)
set the regions individual WaitScanRate
|
void |
setX(int X) |
void |
setY(int Y) |
void |
showScreens()
synonym for showMonitors
|
void |
stopObserver() |
String |
text()
STILL EXPERIMENTAL: tries to read the text in this region
might contain misread characters, NL characters and other stuff, when interpreting contained grafics as text Best results: one line of text with no grafics in the line |
protected Match |
toGlobalCoord(Match m)
used in SikuliEventManager.callChangeObserver, Finder.next to adjust region
relative coordinates of matches to screen coordinates
|
String |
toString() |
String |
toStringShort() |
<PatternFilenameRegionMatchLocation> |
type(PatternFilenameRegionMatchLocation target,
String text)
first does a click(target) at the given target position to gain
focus/carret
enters the given text one character/key after another using keyDown/keyUp about the usable Key constants see keyDown(keys) Class Key only provides a subset of a US-QWERTY PC keyboard layout |
<PatternFilenameRegionMatchLocation> |
type(PatternFilenameRegionMatchLocation target,
String text,
int modifiers)
first does a click(target) at the given target position to gain
focus/carret
enters the given text one character/key after another using keyDown/keyUp while holding down the given modifier keys about the usable Key constants see keyDown(keys) Class Key only provides a subset of a US-QWERTY PC keyboard layout |
<PatternFilenameRegionMatchLocation> |
type(PatternFilenameRegionMatchLocation target,
String text,
String modifiers)
first does a click(target) at the given target position to gain
focus/carret
enters the given text one character/key after another using keyDown/keyUp while holding down the given modifier keys about the usable Key constants see keyDown(keys) Class Key only provides a subset of a US-QWERTY PC keyboard layout |
int |
type(String text)
enters the given text one character/key after another using keyDown/keyUp
about the usable Key constants see keyDown(keys) Class Key only provides a subset of a US-QWERTY PC keyboard layout the text is entered at the current position of the focus/carret |
int |
type(String text,
int modifiers)
enters the given text one character/key after another using
keyDown/keyUp
while holding down the given modifier keys about the usable Key constants see keyDown(keys) Class Key only provides a subset of a US-QWERTY PC keyboard layout the text is entered at the current position of the focus/carret |
int |
type(String text,
String modifiers)
enters the given text one character/key after another using
keyDown/keyUp
while holding down the given modifier keys about the usable Key constants see keyDown(keys) Class Key only provides a subset of a US-QWERTY PC keyboard layout the text is entered at the current position of the focus/carret |
Region |
union(Region ur)
create a new region containing both regions
|
protected void |
updateSelf() |
void |
wait(double timeout)
WARNING: wait(long timeout) is taken by Java Object as final.
|
<PatternOrString> |
wait(PatternOrString target)
Waits for the PatternOrString to appear
|
<PatternOrString> |
wait(PatternOrString target,
double timeout)
Match wait(Pattern/String/PatternClass target, timeout-sec) waits until
target appears or timeout (in second) is passed
|
<PatternOrString> |
waitVanish(PatternOrString target)
boolean waitVanish(Pattern/String/PatternClass target, timeout-sec) waits
until target vanishes or timeout (in second) is passed
|
<PatternOrString> |
waitVanish(PatternOrString target,
double timeout)
boolean waitVanish(Pattern/String/PatternClass target, timeout-sec) waits
until target vanishes or timeout (in second) is passed
|
int |
wheel(int direction,
int steps)
Move the wheel at the current mouse position
the given steps in the given direction: Button.WHEEL_DOWN, Button.WHEEL_UP |
<PatternFilenameRegionMatchLocation> |
wheel(PatternFilenameRegionMatchLocation target,
int direction,
int steps)
move the mouse pointer to the given target location
and move the wheel the given steps in the given direction: Button.WHEEL_DOWN, Button.WHEEL_UP |
public int x
public int y
public int w
public int h
public static final int CREATE_X_DIRECTION_LEFT
create(Location, int, int, int, int)
method. Sets the
Location to be on the left corner of the new Region.public static final int CREATE_X_DIRECTION_RIGHT
create(Location, int, int, int, int)
method. Sets the
Location to be on the right corner of the new Region.public static final int CREATE_Y_DIRECTION_TOP
create(Location, int, int, int, int)
method. Sets the
Location to be on the top corner of the new Region.public static final int CREATE_Y_DIRECTION_BOTTOM
create(Location, int, int, int, int)
method. Sets the
Location to be on the bottom corner of the new Region.public Region(int X, int Y, int W, int H, int screenNumber)
X
- X positionY
- Y positionW
- widthH
- heigthscreenNumber
- The number of the screen containing the Regionpublic Region(int X, int Y, int W, int H, Screen parentScreen)
X
- X positionY
- Y positionW
- widthH
- heigthparentScreen
- the screen containing the Regionpublic Region(int X, int Y, int W, int H)
X
- X positionY
- Y positionW
- widthH
- heigthpublic Region(Rectangle r)
r
- the Rectanglepublic Region(Region r)
r
- the regionprotected Region()
public SikuliEventManager getEvtMgr()
public void setEvtMgr(SikuliEventManager em)
public String toStringShort()
protected void initScreen(Screen scr)
scr
- The Screen containing the Regionprotected Rectangle regionOnScreen(Screen screen)
screen
- The Screen in which the Region might bepublic static Region create(int X, int Y, int W, int H)
X
- top left X positionY
- top left Y positionW
- widthH
- heigthpublic static Region create(Location loc, int w, int h)
loc
- top left cornerw
- widthh
- heightpublic static Region create(Location loc, int create_x_direction, int create_y_direction, int w, int h)
loc
- the refence pointcreate_x_direction
- == 0 is left side !=0 is right sidecreate_y_direction
- == 0 is top side !=0 is bottom sidew
- the widthh
- the heightpublic static Region grow(Location loc, int x, int y, int w, int h)
loc
- the refence pointx
- ==0 is left side !=0 is right sidey
- ==0 is top side !=0 is bottom sidew
- the widthh
- the heightpublic static Region create(Rectangle r)
r
- the Rectangleprotected static Region create(Rectangle r, Screen parentScreen)
r
- the RectangleparentScreen
- the new parent screenpublic static Region create(Region r)
r
- the regionpublic static Region grow(Location loc, int w, int h)
loc
- the center pointw
- the widthh
- the heightpublic static Region grow(Location loc)
loc
- the center pointpublic boolean contains(Location point)
point
- public boolean containsMouse()
public Region copyTo(int scrID)
scrID
- number of screenpublic Region copyTo(Screen screen)
screen
- new parent screenprotected Match toGlobalCoord(Match m)
m
- public void setThrowException(boolean flag)
flag
- true/falsepublic boolean getThrowException()
public void setAutoWaitTimeout(double sec)
sec
- public double getAutoWaitTimeout()
public void setFindFailedResponse(FindFailedResponse response)
response
- the FindFailedResponsepublic FindFailedResponse getFindFailedResponse()
public float getWaitScanRate()
public void setWaitScanRate(float waitScanRate)
waitScanRate
- public float getObserveScanRate()
public void setObserveScanRate(float observeScanRate)
observeScanRate
- public int getWaitForVanish()
public void setWaitForVanish(int waitForVanish)
waitForVanish
- time in secondspublic Screen getScreen()
@Deprecated public Screen getScreenContaining()
getScreen()
protected void setScreen(Screen is)
is
- the containing screen objectprotected void setScreen(int id)
id
- the containing screen object's idpublic void showScreens()
public void resetScreens()
public Location getCenter()
public Location getTarget()
public Region setCenter(Location loc)
loc
- the location which is the new center of the regionpublic Location getTopLeft()
public Region setTopLeft(Location loc)
loc
- the location which is the new top left point of the regionpublic Location getTopRight()
public Region setTopRight(Location loc)
loc
- the location which is the new top right point of the regionpublic Location getBottomLeft()
public Region setBottomLeft(Location loc)
loc
- the location which is the new bottom left point of the regionpublic Location getBottomRight()
public Region setBottomRight(Location loc)
loc
- the location which is the new bottom right point of the regionpublic int getX()
public int getY()
public int getW()
public int getH()
public void setX(int X)
X
- new x position of top left cornerpublic void setY(int Y)
Y
- new y position of top left cornerpublic void setW(int W)
W
- new widthpublic void setH(int H)
H
- new heightpublic Region setSize(int W, int H)
W
- new widthH
- new heightpublic Rectangle getRect()
public Region setRect(Rectangle r)
r
- the AWT Rectagle to use for position/sizepublic Region setRect(int X, int Y, int W, int H)
X
- new x of top left cornerY
- new y of top left cornerW
- new widthH
- new heightpublic Region setRect(Region r)
r
- the region to use for position/sizepublic void setROI(int X, int Y, int W, int H)
X
- Y
- W
- H
- public void setROI(Rectangle roi)
roi
- public void setROI(Region reg)
reg
- @Deprecated public Region inside()
@Deprecated public Region moveTo(Location loc)
loc
- new top left cornerpublic Region setLocation(Location loc)
loc
- new top left corner@Deprecated public Region morphTo(Region r)
r
- public Region add(int l, int r, int t, int b)
l
- padding on left sider
- padding on right sidet
- padding at top sideb
- padding at bottom sidepublic Region add(Region r)
r
- the region to includepublic Region add(Location loc)
loc
- the point to includepublic Match getLastMatch()
public Iterator<Match> getLastMatches()
public ScreenImage getLastScreenImage()
public String getLastScreenImageFile() throws IOException
IOException
public String getLastScreenImageFile(String name) throws IOException
name
- file name (.png is added if not there)IOException
public String getLastScreenImageFile(String path, String name) throws IOException
name
- file name (.png is added if not there)IOException
public boolean contains(Region region)
region
- public Region offset(Location loc)
loc
- use its x and y to set the offsetpublic Region offset(int _x, int _y)
x
- horizontal offsety
- vertical offset@Deprecated public Region nearby()
@Deprecated public Region nearby(int range)
range
- public Region grow(int range)
range
- public Region grow(int w, int h)
w
- h
- public Region grow(int l, int r, int t, int b)
l
- b
- r
- t
- public Location rightAt()
public Location rightAt(int offset)
public Region right()
public Region right(int width)
width
- public Location leftAt()
public Location leftAt(int offset)
public Region left()
public Region left(int width)
width
- public Location aboveAt()
public Location aboveAt(int offset)
public Region above()
public Region above(int height)
height
- public Location belowAt()
public Location belowAt(int offset)
public Region below()
public Region below(int height)
height
- public Region union(Region ur)
ur
- region to unite withpublic Region intersection(Region ir)
ir
- the region to intersect with like AWT Rectangle APIprotected void updateSelf()
public Region highlight()
public Region highlight(float secs)
secs
- time in secondspublic Region highlight(int secs)
secs
- public void wait(double timeout)
timeout
- The time to waitpublic <PatternOrString> Match find(PatternOrString target) throws FindFailed
target
- A search criteriaFindFailed
- if the Find operation failedpublic <PatternOrString> Iterator<Match> findAll(PatternOrString target) throws FindFailed
target
- A search criteriaFindFailed
- if the Find operation failedpublic <PatternOrString> Match wait(PatternOrString target) throws FindFailed
target
- The target to search forFindFailed
public <PatternOrString> Match wait(PatternOrString target, double timeout) throws FindFailed
target
- A search criteriatimeout
- Timeout in secondsFindFailed
- if the Find operation failedpublic <PatternOrString> Match exists(PatternOrString target)
target
- Pattern or Stringpublic <PatternOrString> Match exists(PatternOrString target, double timeout)
target
- Pattern or Stringtimeout
- Timeout in secondspublic Match findText(String text, double timeout) throws FindFailed
text
- timeout
- FindFailed
public Match findText(String text) throws FindFailed
text
- FindFailed
public Match findAllText(String text, double timeout) throws FindFailed
text
- timeout
- FindFailed
public Match findAllText(String text) throws FindFailed
text
- FindFailed
public <PatternOrString> boolean waitVanish(PatternOrString target)
public <PatternOrString> boolean waitVanish(PatternOrString target, double timeout)
public boolean isObserving()
public <PatternOrString> void onAppear(PatternOrString target, Object observer)
public <PatternOrString> void onVanish(PatternOrString target, Object observer)
public void onChange(int threshold, Object observer)
public void onChange(SikuliEventObserver observer)
public void observe()
public void observe(double secs)
public void observeInBackground(double secs)
public void stopObserver()
public int hover()
public <PatternFilenameRegionMatchLocation> int hover(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
- for Pattern or Filenamepublic int click()
public <PatternFilenameRegionMatchLocation> int click(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
- for Pattern or Filenamepublic <PatternFilenameRegionMatchLocation> int click(PatternFilenameRegionMatchLocation target, int modifiers) throws FindFailed
PatternFilenameRegionMatchLocation
- targetmodifiers
- the value of the resulting bitmask (see KeyModifier)FindFailed
- for Pattern or Filenamepublic int doubleClick()
public <PatternFilenameRegionMatchLocation> int doubleClick(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
- for Pattern or Filenamepublic <PatternFilenameRegionMatchLocation> int doubleClick(PatternFilenameRegionMatchLocation target, int modifiers) throws FindFailed
PatternFilenameRegionMatchLocation
- targetmodifiers
- the value of the resulting bitmask (see KeyModifier)FindFailed
- for Pattern or Filenamepublic int rightClick()
public <PatternFilenameRegionMatchLocation> int rightClick(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
- for Pattern or Filenamepublic <PatternFilenameRegionMatchLocation> int rightClick(PatternFilenameRegionMatchLocation target, int modifiers) throws FindFailed
PatternFilenameRegionMatchLocation
- targetmodifiers
- the value of the resulting bitmask (see KeyModifier)FindFailed
- for Pattern or Filenamepublic <PatternFilenameRegionMatchLocation> int dragDrop(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- target destination positionFindFailed
- if the Find operation failedpublic <PatternFilenameRegionMatchLocation> int dragDrop(PatternFilenameRegionMatchLocation t1, PatternFilenameRegionMatchLocation t2) throws FindFailed
t1
- source positiont2
- destination positionFindFailed
- if the Find operation failedpublic <PatternFilenameRegionMatchLocation> int drag(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
public <PatternFilenameRegionMatchLocation> int dropAt(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
public void mouseDown(int buttons)
buttons
- public void mouseUp()
public void mouseUp(int buttons)
buttons
- public int mouseMove()
public <PatternFilenameRegionMatchLocation> int mouseMove(PatternFilenameRegionMatchLocation target) throws FindFailed
PatternFilenameRegionMatchLocation
- targetFindFailed
- for Pattern or Filenamepublic int wheel(int direction, int steps)
direction
- to move the wheelsteps
- the number of stepspublic <PatternFilenameRegionMatchLocation> int wheel(PatternFilenameRegionMatchLocation target, int direction, int steps) throws FindFailed
PatternFilenameRegionMatchLocation
- targetdirection
- to move the wheelsteps
- the number of stepsFindFailed
- if the Find operation failedpublic static Location atMouse()
public void keyDown(int keycode)
keycode
- public void keyDown(String keys)
keys
- public void keyUp()
public void keyUp(int keycode)
keycode
- public void keyUp(String keys)
keys
- public int type(String text)
text
- containing characters and/or Key constantspublic int type(String text, int modifiers)
text
- containing characters and/or Key constantsmodifiers
- constants according to class KeyModifierspublic int type(String text, String modifiers)
text
- containing characters and/or Key constantsmodifiers
- constants according to class Key - combine using +public <PatternFilenameRegionMatchLocation> int type(PatternFilenameRegionMatchLocation target, String text) throws FindFailed
PatternFilenameRegionMatchLocation
- targettext
- containing characters and/or Key constantsFindFailed
public <PatternFilenameRegionMatchLocation> int type(PatternFilenameRegionMatchLocation target, String text, int modifiers) throws FindFailed
PatternFilenameRegionMatchLocation
- targettext
- containing characters and/or Key constantsmodifiers
- constants according to class KeyModifiersFindFailed
public <PatternFilenameRegionMatchLocation> int type(PatternFilenameRegionMatchLocation target, String text, String modifiers) throws FindFailed
PatternFilenameRegionMatchLocation
- targettext
- containing characters and/or Key constantsmodifiers
- constants according to class Key - combine using +FindFailed
public int paste(String text)
text
- a string, which might contain unicode characterspublic <PatternFilenameRegionMatchLocation> int paste(PatternFilenameRegionMatchLocation target, String text) throws FindFailed
PatternFilenameRegionMatchLocation
- targettext
- a string, which might contain unicode charactersFindFailed
public String text()
public List<Match> listText()