Modifier and Type | Field and Description |
---|---|
static int |
BB |
static int |
BH |
static int |
BL |
static int |
BM |
static int |
BR |
static int |
C2 |
static int |
CH |
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. |
static int |
CV |
static int |
EAST |
static int |
EAST_MID |
static int |
EAST_NORTH |
static int |
EAST_SOUTH |
static int |
EH |
static int |
EM |
static int |
EN |
static int |
ES |
int |
h
Height of the Region
|
static int |
LB |
static int |
LH |
static int |
LL |
static int |
LM |
static int |
LT |
static int |
M2 |
static int |
M3 |
static int |
MH |
static int |
MID_HORIZONTAL |
static int |
MID_VERTICAL |
static int |
MIDDLE |
static int |
MIDDLE_BIG |
static int |
MM |
static int |
MV |
static int |
NE |
static int |
NH |
static int |
NM |
static int |
NORTH |
static int |
NORTH_EAST |
static int |
NORTH_MID |
static int |
NORTH_WEST
the area constants for use with get()
|
static int |
NW
the area constants for use with get()
|
static int |
RB |
static int |
RH |
static int |
RM |
static int |
RR |
static int |
RT |
static int |
SE |
static int |
SH |
static int |
SM |
static int |
SOUTH |
static int |
SOUTH_EAST |
static int |
SOUTH_MID |
static int |
SOUTH_WEST |
static int |
SW |
static int |
TH |
static int |
TL
the area constants for use with get()
|
static int |
TM |
static int |
TR |
static int |
TT |
int |
w
Width of the Region
|
static int |
WEST |
static int |
WEST_MID |
static int |
WEST_NORTH |
static int |
WEST_SOUTH |
static int |
WH |
static int |
WM |
static int |
WN |
static int |
WS |
int |
x
X-coordinate of the Region
|
int |
y
Y-coordinate of the Region
|
Constructor and Description |
---|
Region(int X,
int Y)
Convenience: a minimal Region to be used as a Point (backport from Version 2)
is always on primary screen |
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,
IScreen 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
negative height creates the top part with height inside the region 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 |
void |
aInput(String text)
EXPERIMENTAL: for Android over ADB
|
void |
aKey(int key)
EXPERIMENTAL: for Android over ADB
|
Location |
asOffset()
create a Location object, that can be used as an offset taking the width and hight of this Region
|
<PFRML> void |
aSwipe(PFRML from,
PFRML to)
EXPERIMENTAL: for Android over ADB
|
void |
aSwipeDown()
EXPERIMENTAL: for Android over ADB
|
void |
aSwipeLeft()
EXPERIMENTAL: for Android over ADB
|
void |
aSwipeRight()
EXPERIMENTAL: for Android over ADB
|
void |
aSwipeUp()
EXPERIMENTAL: for Android over ADB
|
<PFRML> void |
aTap(PFRML target)
EXPERIMENTAL: for Android over ADB
|
static Location |
atMouse()
Deprecated.
use
Mouse.at() instead |
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
negative height creates the bottom part with height inside the region 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 |
<PFRML> int |
click(PFRML 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 |
<PFRML> int |
click(PFRML target,
Integer 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 |
Match |
compare(Image img)
time optimized Region.exists, when image-size == region-size
1.1.x: just using exists(img, 0), sizes not checked |
Match |
compare(String img)
time optimized Region.exists, when image-size == region-size
1.1.x: just using exists(img, 0), sizes not checked |
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(IScreen 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
|
static Region |
create(Region r)
Create a region from another region
including the region's settings |
void |
delayClick(int millisecs)
time in milliseconds to delay between button down/up at next click only (max 1000)
|
void |
delayType(int millisecs)
time in milliseconds to delay between each character at next type only (max 1000)
|
int |
doubleClick()
double click at the region's last successful match
use center if no lastMatch if region is a match: click targetOffset |
<PFRML> int |
doubleClick(PFRML 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 |
<PFRML> int |
doubleClick(PFRML target,
Integer 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 |
<PFRML> int |
drag(PFRML target)
Prepare a drag action: move mouse to given target
press and hold left mouse button wait Settings.DelayAfterDrag |
<PFRML> int |
dragDrop(PFRML target)
Drag from region's last match and drop at given target
applying Settings.DelayAfterDrag and DelayBeforeDrop using left mouse button |
<PFRML> int |
dragDrop(PFRML t1,
PFRML t2)
Drag from a position and drop to another using left mouse button
applying Settings.DelayAfterDrag and DelayBeforeDrop |
<PFRML> int |
dropAt(PFRML target)
finalize a drag action with a drop: move mouse to given target
wait Settings.DelayBeforeDrop before releasing the left mouse button |
<PSI> Match |
exists(PSI target)
Check if target exists (with the default autoWaitTimeout)
|
<PSI> Match |
exists(PSI target,
double timeout)
Check if target exists with a specified timeout
timout = 0: returns immediately after first search |
<PSI> Match |
find(PSI target)
finds the given Pattern, String or Image in the region and returns the best match.
|
<PSI> Iterator<Match> |
findAll(PSI target)
finds all occurences of the given Pattern, String or Image in the region and returns an Iterator of Matches.
|
<PSI> Match[] |
findAllByColumn(PSI target) |
<PSI> Match[] |
findAllByRow(PSI target) |
Iterator<Match> |
findAllText(String text)
Use findAllText() instead of findAll() in cases where the given string could be misinterpreted as an image filename
|
Match |
findBest(Object... args) |
Match |
findText(String text)
Use findText() instead of find() in cases where the given string could be misinterpreted as an image filename
|
Match |
findText(String text,
double timeout)
Use findText() instead of find() in cases where the given string could be misinterpreted as an image filename
|
Region |
get(int part)
select the specified part of the region.
|
double |
getAutoWaitTimeout()
current setting for this region (see setAutoWaitTimeout)
|
Location |
getBottomLeft() |
Location |
getBottomRight() |
Region |
getCell(int r,
int c)
get the specified cell counting from (0, 0), if a raster is setup
negative counts reverse from the end (last = -1) values outside range are 0 or last respectively |
Location |
getCenter() |
Region |
getCol(int c)
get the specified column counting from 0, if columns or raster are setup negative counts reverse from the end (last
= -1) values outside range are 0 or last respectively
|
Region |
getCol(int c,
int n)
divide the region in n columns and select column c as new Region
|
int |
getCols() |
int |
getColW() |
ObserveEvent |
getEvent(String name)
the event is removed from the list
|
ObserveEvent[] |
getEvents()
the region's events are removed from the list
|
FindFailedResponse |
getFindFailedResponse() |
int |
getH() |
String |
getIDString()
INTERNAL USE ONLY
|
Match |
getLastMatch()
a find operation saves its match on success in the used region object
unchanged if not successful |
Iterator<Match> |
getLastMatches()
a searchAll 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() |
int |
getRepeatWaitTime()
INTERNAL USE: Observe
|
Region |
getROI()
A function only for backward compatibility - Only makes sense with Screen objects
|
Region |
getRow(int r)
get the specified row counting from 0, if rows or raster are setup negative counts reverse from the end (last = -1)
values outside range are 0 or last respectively
|
Region |
getRow(int r,
int n) |
int |
getRowH() |
int |
getRows() |
IScreen |
getScreen() |
IScreen |
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() |
float |
getWaitScanRate() |
int |
getX() |
int |
getY() |
Region |
grow()
create a region enlarged n pixels on each side (n = Settings.DefaultPadding = 50 default)
|
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 a bottom
side.
|
static Region |
grow(Location loc)
create a minimal region at given point with size 1 x 1
|
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 |
boolean |
hasEvents() |
boolean |
hasObserver()
evaluate if at least one event observer is defined for this region (the observer need not be running)
|
Region |
highlight()
Toggle the regions Highlight visibility (red frame)
|
Region |
highlight(float secs)
show the regions Highlight for the given time in seconds (red frame) if 0 - use the global Settings.SlowMotionDelay
|
Region |
highlight(float secs,
String color)
show the regions Highlight for the given time in seconds (frame of specified color) 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
|
Region |
highlight(int secs,
String color)
Show highlight in selected color
|
Region |
highlight(String color)
Toggle the regions Highlight visibility (frame of specified color)
allowed color specifications for frame color: - a color name out of: black, blue, cyan, gray, green, magenta, orange, pink, red, white, yellow (lowercase and uppercase can be mixed, internally transformed to all uppercase) - these colornames exactly written: lightGray, LIGHT_GRAY, darkGray and DARK_GRAY - a hex value like in HTML: #XXXXXX (max 6 hex digits) - an RGB specification as: #rrrgggbbb where rrr, ggg, bbb are integer values in range 0 - 255 padded with leading zeros if needed (hence exactly 9 digits) |
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 |
<PFRML> int |
hover(PFRML 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 |
void |
initScreen(IScreen iscr)
INTERNAL USE
|
Region |
inside()
Deprecated.
only for backward compatibility
|
Region |
intersection(Region ir)
create a region that is the intersection of the given regions
|
boolean |
isObserving() |
boolean |
isOtherScreen()
INTERNAL USE: checks wether this region belongs to a non-Desktop screen
|
boolean |
isRasterValid()
Can be used to check, wether the Region currently has a valid raster
|
boolean |
isValid()
Check wether thie Region is contained by any of the available screens
|
boolean |
isVirtual()
INTERNAL USE - EXPERIMENTAL if true: this region is not bound to any screen
|
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
negative width creates the left part with width inside the region 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 |
int |
mouseMove(int xoff,
int yoff)
move the mouse from the current position to the offset position given by the parameters
|
<PFRML> int |
mouseMove(PFRML 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
|
boolean |
observe()
start an observer in this region that runs forever (use stopObserving() in handler) for details about the observe
event handler:
ObserverCallBack for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
boolean |
observe(double secs)
start an observer in this region for the given time for details about the observe event handler:
ObserverCallBack for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
boolean |
observeInBackground(double secs)
start an observer in this region for the given time that runs in background for details about the observe event
handler:
ObserverCallBack for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
boolean |
observeInLine(double secs)
INTERNAL USE ONLY: for use with scripting API bridges
|
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
|
<PSI> String |
onAppear(PSI target)
a subsequently started observer in this region should wait for target success and details about the event can be
obtained using @{link Observing}
for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
<PSI> String |
onAppear(PSI target,
Object observer)
a subsequently started observer in this region should wait for target and notify the given observer about this
event
for details about the observe event handler: ObserverCallBack for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
String |
onChange()
a subsequently started observer in this region should wait for changes in the region success and details about the
event can be obtained using @{link Observing}
minimum size of changes used: Settings.ObserveMinChangedPixels for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
String |
onChange(Integer threshold)
a subsequently started observer in this region should wait for changes in the region success and details about the
event can be obtained using @{link Observing}
for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
String |
onChange(Integer threshold,
Object observer)
a subsequently started observer in this region should wait for changes in the region and notify the given observer
about this event for details about the observe event handler:
ObserverCallBack for details about
APPEAR/VANISH/CHANGE events: ObserveEvent |
String |
onChange(Object observer)
a subsequently started observer in this region should wait for changes in the region and notify the given observer
about this event
minimum size of changes used: Settings.ObserveMinChangedPixels for details about the observe event handler: ObserverCallBack for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
String |
onChangeDo(Integer threshold,
Object observer) |
<PSI> String |
onVanish(PSI target)
a subsequently started observer in this region should wait for the target to vanish success and details about the
event can be obtained using @{link Observing}
for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
<PSI> String |
onVanish(PSI target,
Object observer)
a subsequently started observer in this region should wait for the target to vanish and notify the given observer
about this event
for details about the observe event handler: ObserverCallBack for details about APPEAR/VANISH/CHANGE events: ObserveEvent |
<PFRML> int |
paste(PFRML 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) |
void |
resetScreens()
synonym for resetMonitors
|
Region |
right()
create a region right of the right side with same height.
|
Region |
right(int width)
create a region right of the right side with same height and given width.
|
Location |
rightAt()
point middle on right edge
|
Location |
rightAt(int offset)
positive offset goes to the right.
|
int |
rightClick()
right click at the region's last successful match
use center if no lastMatch if region is a match: click targetOffset |
<PFRML> int |
rightClick(PFRML 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 |
<PFRML> int |
rightClick(PFRML target,
Integer 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 |
saveLastScreenImage() |
String |
saveScreenCapture() |
String |
saveScreenCapture(String path) |
String |
saveScreenCapture(String path,
String name) |
void |
setActive(String name)
set the observer with the given name active (checked while observing)
|
void |
setAutoWaitTimeout(double sec)
the time in seconds a find operation should wait for the appearence of the target in this region
initial value is the global AutoWaitTimeout setting at time of Region creation |
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
|
Region |
setCols(int n)
store info: this region is divided horizontally into n even columns
a preparation for using getCol() |
void |
setFindFailedHandler(Object handler) |
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 after FindFailed (caution: endless loop) |
void |
setH(int H) |
void |
setImageMissingHandler(Object handler) |
void |
setInactive(String name)
set the observer with the given name inactive (not checked while observing)
|
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
|
void |
setOtherScreen()
INTERNAL USE: flags this region as belonging to a non-Desktop screen
|
void |
setOtherScreen(IScreen aScreen)
INTERNAL USE: flags this region as belonging to a non-Desktop screen
|
Region |
setRaster(int r,
int c)
store info: this region is divided into a raster of even cells
a preparation for using getCell() |
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 |
setRepeatWaitTime(int time)
INTERNAL USE: Observe set the regions individual WaitForVanish
|
void |
setROI()
resets this region (usually a Screen object) to the coordinates of the containing screen
Because of the wanted side effect for the containing screen, this should only be used with screen objects.
|
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 r)
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. |
Region |
setRows(int n)
store info: this region is divided vertically into n even rows
a preparation for using getRow() |
Region |
setSize(int W,
int H) |
void |
setThrowException(boolean flag)
true - (initial setting) should throw exception FindFailed if findX 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 |
setVirtual(boolean state)
INTERNAL USE - EXPERIMENTAL
|
void |
setW(int W) |
void |
setWaitScanRate(float waitScanRate)
set the regions individual WaitScanRate
|
void |
setX(int X) |
void |
setY(int Y) |
void |
showScreens()
synonym for showMonitors
|
void |
stopObserver()
stops a running observer
|
void |
stopObserver(String message)
stops a running observer printing an info message
|
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 |
String |
toString() |
String |
toStringShort() |
<PFRML> int |
type(PFRML 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 |
<PFRML> int |
type(PFRML 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 |
<PFRML> int |
type(PFRML 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
|
static Region |
virtual(Rectangle rect)
INTERNAL USE - EXPERIMENTAL if true: this region is not bound to any screen
|
void |
wait(double timeout)
WARNING: wait(long timeout) is taken by Java Object as final.
|
<PSI> Match |
wait(PSI target)
Waits for the Pattern, String or Image to appear until the AutoWaitTimeout value is exceeded.
|
<PSI> Match |
wait(PSI target,
double timeout)
Waits for the Pattern, String or Image to appear or timeout (in second) is passed
|
<PSI> boolean |
waitVanish(PSI target)
waits until target vanishes or timeout (in seconds) is passed (AutoWaitTimeout)
|
<PSI> boolean |
waitVanish(PSI target,
double timeout)
waits until target vanishes or timeout (in seconds) 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 |
<PFRML> int |
wheel(PFRML 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 |
<PFRML> int |
wheel(PFRML target,
int direction,
int steps,
int stepDelay)
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 |
int |
write(String text)
Compact alternative for type() with more options
- special keys and options are coded as #XN. |
public int x
public int y
public int w
public int h
public static final int NW
public static final int NORTH_WEST
public static final int TL
public static final int NM
public static final int NORTH_MID
public static final int TM
public static final int NE
public static final int NORTH_EAST
public static final int TR
public static final int EM
public static final int EAST_MID
public static final int RM
public static final int SE
public static final int SOUTH_EAST
public static final int BR
public static final int SM
public static final int SOUTH_MID
public static final int BM
public static final int SW
public static final int SOUTH_WEST
public static final int BL
public static final int WM
public static final int WEST_MID
public static final int LM
public static final int MM
public static final int MIDDLE
public static final int M3
public static final int TT
public static final int RR
public static final int BB
public static final int LL
public static final int NH
public static final int NORTH
public static final int TH
public static final int EH
public static final int EAST
public static final int RH
public static final int SH
public static final int SOUTH
public static final int BH
public static final int WH
public static final int WEST
public static final int LH
public static final int MV
public static final int MID_VERTICAL
public static final int CV
public static final int MH
public static final int MID_HORIZONTAL
public static final int CH
public static final int M2
public static final int MIDDLE_BIG
public static final int C2
public static final int EN
public static final int EAST_NORTH
public static final int RT
public static final int ES
public static final int EAST_SOUTH
public static final int RB
public static final int WN
public static final int WEST_NORTH
public static final int LT
public static final int WS
public static final int WEST_SOUTH
public static final int LB
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, IScreen parentScreen)
X
- X positionY
- Y positionW
- widthH
- heigthparentScreen
- the screen containing the Regionpublic Region(int X, int Y)
X
- Y
- public 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 regionpublic String getIDString()
public String toStringShort()
public void initScreen(IScreen iscr)
iscr
- screenpublic static Region virtual(Rectangle rect)
rect
- rectanglepublic boolean isVirtual()
public void setVirtual(boolean state)
state
- if true: this region is not bound to any screenpublic boolean isOtherScreen()
public void setOtherScreen()
public void setOtherScreen(IScreen aScreen)
aScreen
- screenpublic boolean isValid()
public 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 Rectanglepublic 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 pointpublic boolean contains(Location point)
point
- Pointpublic boolean containsMouse()
public Region copyTo(int scrID)
scrID
- number of screenpublic Region copyTo(IScreen screen)
screen
- new parent screenpublic void setThrowException(boolean flag)
flag
- true/falsepublic boolean getThrowException()
public void setAutoWaitTimeout(double sec)
sec
- secondspublic double getAutoWaitTimeout()
public void setFindFailedResponse(FindFailedResponse response)
response
- the FindFailedResponsepublic void setFindFailedHandler(Object handler)
public void setImageMissingHandler(Object handler)
public FindFailedResponse getFindFailedResponse()
public float getWaitScanRate()
public void setWaitScanRate(float waitScanRate)
waitScanRate
- decimal numberpublic float getObserveScanRate()
public void setObserveScanRate(float observeScanRate)
observeScanRate
- decimal numberpublic int getRepeatWaitTime()
public void setRepeatWaitTime(int time)
time
- in secondspublic IScreen getScreen()
@Deprecated public IScreen getScreenContaining()
getScreen()
public 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 Rectangle 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()
public void setROI(int X, int Y, int W, int H)
X
- new xY
- new yW
- new widthH
- new heightpublic void setROI(Rectangle r)
r
- AWT Rectanglepublic void setROI(Region reg)
reg
- Regionpublic Region getROI()
@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
- Regionpublic 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 String saveScreenCapture()
public ScreenImage getLastScreenImage()
public String getLastScreenImageFile() throws IOException
IOException
- if not possiblepublic String getLastScreenImageFile(String name) throws IOException
name
- file name (.png is added if not there)IOException
- if not possiblepublic String getLastScreenImageFile(String path, String name) throws IOException
path
- path to usename
- file name (.png is added if not there)IOException
- if not possiblepublic void saveLastScreenImage()
public boolean contains(Region region)
region
- the other Regionpublic Location asOffset()
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
- the margin to be added aroundpublic Region grow()
public Region grow(int range)
range
- the margin to be added aroundpublic Region grow(int w, int h)
w
- pixels horizontallyh
- pixels verticallypublic Region grow(int l, int r, int t, int b)
l
- add to the leftr
- add to rightt
- add aboveb
- add beneathpublic Location rightAt()
public Location rightAt(int offset)
offset
- pixelspublic Region right()
public Region right(int width)
width
- pixelspublic Location leftAt()
public Location leftAt(int offset)
offset
- pixelspublic Region left()
public Region left(int width)
width
- pixelspublic Location aboveAt()
public Location aboveAt(int offset)
offset
- pixelspublic Region above()
public Region above(int height)
height
- pixelspublic Location belowAt()
public Location belowAt(int offset)
offset
- pixelspublic Region below()
public Region below(int height)
height
- pixelspublic Region union(Region ur)
ur
- region to unite withpublic Region intersection(Region ir)
ir
- the region to intersect with like AWT Rectangle APIpublic Region get(int part)
setRaster
and getCell
getRow
or getCol
part
- the part to get (Region.PART long or short)public Region setRows(int n)
n
- number of rowspublic Region setCols(int n)
n
- number of columnspublic int getRows()
public int getRowH()
public int getCols()
public int getColW()
public boolean isRasterValid()
public Region setRaster(int r, int c)
r
- number of rowsc
- number of columnspublic Region getRow(int r)
r
- row numberpublic Region getRow(int r, int n)
public Region getCol(int c)
c
- column numberpublic Region getCol(int c, int n)
c
- the column to select counting from 0 or negative to count from the endn
- how many columns to devide inpublic Region getCell(int r, int c)
r
- row numberc
- column numberpublic Region highlight()
public Region highlight(String color)
color
- Color of framepublic Region highlight(float secs)
secs
- time in secondspublic Region highlight(float secs, String color)
secs
- time in secondscolor
- Color of frame (see method highlight(color))public Region highlight(int secs)
secs
- secondspublic Region highlight(int secs, String color)
secs
- time in secondscolor
- Color of frame (see method highlight(color))public void wait(double timeout)
timeout
- The time to waitpublic <PSI> Match find(PSI target) throws FindFailed
PSI
- Pattern, String or Imagetarget
- A search criteriaFindFailed
- if the Find operation failedpublic <PSI> Match exists(PSI target)
PSI
- Pattern, String or Imagetarget
- Pattern, String or Imagepublic <PSI> Match exists(PSI target, double timeout)
PSI
- Pattern, String or Imagetarget
- The target to search fortimeout
- Timeout in secondspublic <PSI> Iterator<Match> findAll(PSI target) throws FindFailed
PSI
- Pattern, String or Imagetarget
- A search criteriaFindFailed
- if the Find operation failedpublic <PSI> Match[] findAllByRow(PSI target)
public <PSI> Match[] findAllByColumn(PSI target)
public <PSI> Match wait(PSI target) throws FindFailed
PSI
- Pattern, String or Imagetarget
- The target to search forFindFailed
- if the Find operation finally failedpublic <PSI> Match wait(PSI target, double timeout) throws FindFailed
PSI
- Pattern, String or Imagetarget
- The target to search fortimeout
- Timeout in secondsFindFailed
- if the Find operation finally failedpublic <PSI> boolean waitVanish(PSI target)
PSI
- Pattern, String or Imagetarget
- The target to wait for it to vanishpublic <PSI> boolean waitVanish(PSI target, double timeout)
PSI
- Pattern, String or Imagetarget
- Pattern, String or Imagetimeout
- time in secondspublic Match compare(String img)
img
- image file namepublic Match compare(Image img)
img
- Image objectpublic Match findText(String text, double timeout) throws FindFailed
text
- texttimeout
- timeFindFailed
- if not foundpublic Match findText(String text) throws FindFailed
text
- textFindFailed
- if not foundpublic Iterator<Match> findAllText(String text) throws FindFailed
text
- textFindFailed
- if not foundpublic boolean hasObserver()
public boolean isObserving()
public boolean hasEvents()
public ObserveEvent[] getEvents()
public ObserveEvent getEvent(String name)
name
- event's namepublic void setInactive(String name)
name
- observers namepublic void setActive(String name)
name
- observers namepublic <PSI> String onAppear(PSI target, Object observer)
ObserverCallBack
ObserveEvent
PSI
- Pattern, String or Imagetarget
- Pattern, String or Imageobserver
- ObserverCallBackpublic <PSI> String onAppear(PSI target)
ObserveEvent
PSI
- Pattern, String or Imagetarget
- Pattern, String or Imagepublic <PSI> String onVanish(PSI target, Object observer)
ObserverCallBack
ObserveEvent
PSI
- Pattern, String or Imagetarget
- Pattern, String or Imageobserver
- ObserverCallBackpublic <PSI> String onVanish(PSI target)
ObserveEvent
PSI
- Pattern, String or Imagetarget
- Pattern, String or Imagepublic String onChange(Integer threshold, Object observer)
ObserverCallBack
for details about
APPEAR/VANISH/CHANGE events: ObserveEvent
threshold
- minimum size of changes (rectangle threshhold x threshold)observer
- ObserverCallBackpublic String onChange(Integer threshold)
ObserveEvent
threshold
- minimum size of changes (rectangle threshhold x threshold)public String onChange(Object observer)
ObserverCallBack
for details about APPEAR/VANISH/CHANGE events: ObserveEvent
observer
- ObserverCallBackpublic String onChange()
ObserveEvent
public boolean observe()
ObserverCallBack
for details about APPEAR/VANISH/CHANGE events: ObserveEvent
public boolean observe(double secs)
ObserverCallBack
for details about APPEAR/VANISH/CHANGE events: ObserveEvent
secs
- time in seconds the observer should runpublic boolean observeInLine(double secs)
secs
- time in seconds the observer should runpublic boolean observeInBackground(double secs)
ObserverCallBack
for details about APPEAR/VANISH/CHANGE events: ObserveEvent
secs
- time in seconds the observer should runpublic void stopObserver()
public void stopObserver(String message)
message
- textpublic int hover()
public <PFRML> int hover(PFRML target) throws FindFailed
PFRML
- to search: Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- for Pattern or Filenamepublic int click()
public <PFRML> int click(PFRML target) throws FindFailed
PFRML
- to search: Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- for Pattern or Filenamepublic <PFRML> int click(PFRML target, Integer modifiers) throws FindFailed
PFRML
- to search: Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or Locationmodifiers
- the value of the resulting bitmask (see KeyModifier)FindFailed
- for Pattern or Filenamepublic int doubleClick()
public <PFRML> int doubleClick(PFRML target) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- for Pattern or Filenamepublic <PFRML> int doubleClick(PFRML target, Integer modifiers) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or Locationmodifiers
- the value of the resulting bitmask (see KeyModifier)FindFailed
- for Pattern or Filenamepublic int rightClick()
public <PFRML> int rightClick(PFRML target) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- for Pattern or Filenamepublic <PFRML> int rightClick(PFRML target, Integer modifiers) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or Locationmodifiers
- the value of the resulting bitmask (see KeyModifier)FindFailed
- for Pattern or Filenamepublic void delayClick(int millisecs)
millisecs
- valuepublic <PFRML> int dragDrop(PFRML target) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- if the Find operation failedpublic <PFRML> int dragDrop(PFRML t1, PFRML t2) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationt1
- source positiont2
- destination positionFindFailed
- if the Find operation failedpublic <PFRML> int drag(PFRML target) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- if not foundpublic <PFRML> int dropAt(PFRML target) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- if not foundpublic void mouseDown(int buttons)
buttons
- specpublic void mouseUp()
public void mouseUp(int buttons)
buttons
- specpublic int mouseMove()
public <PFRML> int mouseMove(PFRML target) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or LocationFindFailed
- for Pattern or Filenamepublic int mouseMove(int xoff, int yoff)
xoff
- horizontal offset (< 0 left, > 0 right)yoff
- vertical offset (< 0 up, > 0 down)public int wheel(int direction, int steps)
direction
- to move the wheelsteps
- the number of stepspublic <PFRML> int wheel(PFRML target, int direction, int steps) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Location targettarget
- Pattern, Filename, Text, Region, Match or Locationdirection
- to move the wheelsteps
- the number of stepsFindFailed
- if the Find operation failedpublic <PFRML> int wheel(PFRML target, int direction, int steps, int stepDelay) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Location targettarget
- Pattern, Filename, Text, Region, Match or Locationdirection
- to move the wheelsteps
- the number of stepsstepDelay
- number of miliseconds to wait when incrementing the step valueFindFailed
- if the Find operation failed@Deprecated public static Location atMouse()
Mouse.at()
insteadpublic void keyDown(int keycode)
keycode
- Java KeyCodepublic void keyDown(String keys)
keys
- valid keyspublic void keyUp()
public void keyUp(int keycode)
keycode
- Java KeyCodepublic void keyUp(String keys)
keys
- valid keyspublic int write(String text)
text
- a coded text interpreted as a series of key actions (press/hold/release)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 <PFRML> int type(PFRML target, String text) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or Locationtext
- containing characters and/or Key constantsFindFailed
- if not foundpublic <PFRML> int type(PFRML target, String text, int modifiers) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or Locationtext
- containing characters and/or Key constantsmodifiers
- constants according to class KeyModifiersFindFailed
- if not foundpublic <PFRML> int type(PFRML target, String text, String modifiers) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Locationtarget
- Pattern, Filename, Text, Region, Match or Locationtext
- containing characters and/or Key constantsmodifiers
- constants according to class Key - combine using +FindFailed
- if not foundpublic void delayType(int millisecs)
millisecs
- valuepublic int paste(String text)
text
- a string, which might contain unicode characterspublic <PFRML> int paste(PFRML target, String text) throws FindFailed
PFRML
- Pattern, Filename, Text, Region, Match or Location targettarget
- Pattern, Filename, Text, Region, Match or Locationtext
- a string, which might contain unicode charactersFindFailed
- if not foundpublic <PFRML> void aTap(PFRML target) throws FindFailed
PFRML
- Pattern, String, Image, Match, Region or Locationtarget
- PFRMLFindFailed
- image not foundpublic void aInput(String text)
text
- textpublic void aKey(int key)
key
- keypublic <PFRML> void aSwipe(PFRML from, PFRML to) throws FindFailed
PFRML
- Pattern, String, Image, Match, Region or Locationfrom
- PFRMLto
- PFRMLFindFailed
- image not foundpublic void aSwipeUp()
public void aSwipeDown()
public void aSwipeLeft()
public void aSwipeRight()
public String text()
public List<Match> listText()
Copyright © 2017. All rights reserved.