|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ScreenRegion
The ScreenRegion interface provides definitions for the objects that represent regions of the screen.
| Method Summary | |
|---|---|
void |
addROI(int x,
int y,
int width,
int height)
Add a rectangular region of interest into this ScreenRegion. |
void |
addState(Target target,
Object state)
Defines a new state of this screen region as represented by the presence of the given target. |
void |
addStateChangeEventListener(StateChangeListener listener)
Adds a listener to handle the state changes within this screen region. |
void |
addTargetEventListener(Target target,
TargetEventListener listener)
Adds a listener for a given target. |
BufferedImage |
capture()
Captures and returns a screenshot of this screen region. |
ScreenRegion |
find(Target target)
Finds a target on the screen immediately. |
List<ScreenRegion> |
findAll(Target target)
Finds all the instances of the target on the screen immediately. |
ScreenLocation |
getCenter()
Returns the center of this screen region. |
BufferedImage |
getLastCapturedImage()
Returns the last captured image of this ScreenRegion. |
ScreenLocation |
getLowerLeftCorner()
Returns the lower-left corner of this screen region. |
ScreenLocation |
getLowerRightCorner()
Returns the lower-right corner of this screen region. |
ScreenLocation |
getRelativeScreenLocation(int xoffset,
int yoffset)
Returns a ScreenRegion relative to the specified region values. |
ScreenRegion |
getRelativeScreenRegion(int xoffset,
int yoffset,
int width,
int height)
Returns a ScreenRegion relative to the specified region values. |
List<Rectangle> |
getROIs()
Returns a list of Rectangle that represent the rectangular regions of interest for this ScreenRegion. |
double |
getScore()
Returns the minimum matching score of this ScreenRegion, which is set if this screen region was returned as the result of a find command. |
Screen |
getScreen()
Returns a Screen object of this ScreenRegion. |
Object |
getState()
Returns the state of this ScreenRegion. |
Map<Target,Object> |
getStates()
Returns a map of Target objects and states, which can be any object, for this screen region. |
ScreenLocation |
getUpperLeftCorner()
Returns the upper-left corner of this screen region. |
ScreenLocation |
getUpperRightCorner()
Returns the upper-right corner of this screen region. |
void |
removeState(Target target)
Removes a particular state represented by the given target from this screen region. |
void |
removeTargetEventListener(Target target,
TargetEventListener listener)
Removes a particular listener for a particular target. |
void |
setScore(double score)
Sets the minimum matching score value for a target to be considered a match. |
void |
setScreen(Screen screen)
Sets the Screen of this ScreenRegion to be the specified Screen. |
ScreenRegion |
snapshot()
Returns a ScreenRegion object that corresponds to the screen and region of this ScreenRegion. |
ScreenRegion |
wait(Target target,
int mills)
Blocks and waits until a target is found in this screen region within a given time period. |
| Methods inherited from interface org.sikuli.api.Region |
|---|
getBounds, getHeight, getWidth, getX, getY, setBounds |
| Method Detail |
|---|
Screen getScreen()
Screen of this ScreenRegion.void setScreen(Screen screen)
screen - the Screen for this ScreenRegion.
ScreenRegion getRelativeScreenRegion(int xoffset,
int yoffset,
int width,
int height)
xoffset - Horizontal offset.yoffset - Vertical offset.width - the width of this ScreenRegion.height - the height of this ScreenRegion.
ScreenLocation getRelativeScreenLocation(int xoffset,
int yoffset)
xoffset - Horizontal offset.yoffset - Vertical offset.
ScreenLocation getUpperLeftCorner()
ScreenLocation getLowerLeftCorner()
ScreenLocation getUpperRightCorner()
ScreenLocation getLowerRightCorner()
ScreenLocation getCenter()
double getScore()
void setScore(double score)
score - the minimum matching score value for a target to be considered a match.
The value should be between 0 and 1.
void addState(Target target,
Object state)
target - the target whose presence indicates this state.state - the state, which can be any object.void removeState(Target target)
target - the representative target of the state to remove.Object getState()
List<ScreenRegion> findAll(Target target)
target - the target to find.
ScreenRegion find(Target target)
target - the target to find on the current screen.
null if the
can not be found now.
ScreenRegion wait(Target target,
int mills)
target - the target to wait.mills - the maximum time to wait in milliseconds.
ScreenRegion object representing the region occupied by the found target,
or null if the specified target can not be found within the given time.BufferedImage capture()
void addTargetEventListener(Target target,
TargetEventListener listener)
target - the target to listener its events for.listener - the listener to handle the events associated with the target.
void removeTargetEventListener(Target target,
TargetEventListener listener)
target - the target from which the given listener should be removed.listener - the listener to remove from the given target.ScreenRegion snapshot()
ScreenRegion object that corresponds to the screen and region of this ScreenRegion.
void addStateChangeEventListener(StateChangeListener listener)
listener - the listener to handle state changes in this screen region.Map<Target,Object> getStates()
Target objects and states, which can be any object, for this screen region.
void addROI(int x,
int y,
int width,
int height)
x - The X coordinate of the upper-left corner of the rectangle to be added.y - The Y coordinate of the upper-left corner of the rectangle to be added.width - The width of the rectangle.height - width The width of the rectangle.List<Rectangle> getROIs()
BufferedImage getLastCapturedImage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||