public class Screen extends Region implements EventObserver, IScreen
Modifier and Type | Field and Description |
---|---|
protected int |
curID |
protected int |
monitor |
protected int |
oldID |
protected static int |
primaryScreen |
protected OverlayCapturePrompt |
prompt |
protected IRobot |
robot |
protected static Screen[] |
screens |
protected boolean |
waitPrompt |
BB, BH, BL, BM, BR, C2, CH, CREATE_X_DIRECTION_LEFT, CREATE_X_DIRECTION_RIGHT, CREATE_Y_DIRECTION_BOTTOM, CREATE_Y_DIRECTION_TOP, CV, EAST, EAST_MID, EAST_NORTH, EAST_SOUTH, EH, EM, EN, ES, h, LB, LH, LL, LM, LT, M2, M3, MH, MID_HORIZONTAL, MID_VERTICAL, MIDDLE, MIDDLE_BIG, MM, MV, NE, NH, NM, NORTH, NORTH_EAST, NORTH_MID, NORTH_WEST, NW, otherScreen, RB, RH, RM, RR, RT, SE, SH, SM, SOUTH, SOUTH_EAST, SOUTH_MID, SOUTH_WEST, SW, TH, TL, TM, TR, TT, w, WEST, WEST_MID, WEST_NORTH, WEST_SOUTH, WH, WM, WN, WS, x, y
Constructor and Description |
---|
Screen()
Is the screen object having the top left corner as (0,0).
|
Screen(boolean isScreenUnion)
INTERNAL USE
collect all physical screens to one big region
TODO: under evaluation, wether it really makes sense |
Screen(int id)
The screen object with the given id
|
Modifier and Type | Method and Description |
---|---|
static ScreenUnion |
all()
create a Screen (ScreenUnion) object as a united region of all available monitors
|
static Screen |
as(int id) |
ScreenImage |
capture()
create a ScreenImage with the physical bounds of this screen
|
ScreenImage |
capture(int x,
int y,
int w,
int h)
create a ScreenImage with given coordinates on this screen.
|
ScreenImage |
capture(Rectangle rect)
create a ScreenImage with given rectangle on this screen.
|
ScreenImage |
capture(Region reg)
create a ScreenImage with given region on this screen
|
ScreenImage |
captureforHighlight(int x,
int y,
int w,
int h) |
static void |
closePrompt() |
Rectangle |
getBounds() |
static Rectangle |
getBounds(int id) |
int |
getcurrentID() |
protected static Region |
getFakeRegion() |
int |
getID() |
int |
getIdFromPoint(int x,
int y)
INTERNAL USE: to be compatible with ScreenUnion
|
ScreenImage |
getLastScreenImageFromScreen() |
protected static IRobot |
getMouseRobot() |
static int |
getNumberScreens() |
static int |
getPrimaryId() |
static Screen |
getPrimaryScreen() |
IRobot |
getRobot()
Gets the Robot of this Screen.
|
static IRobot |
getRobot(int id)
each screen has exactly one robot (internally used for screen capturing)
available as a convenience for those who know what they are doing. |
Screen |
getScreen() |
static Screen |
getScreen(int id) |
void |
initScreen(Screen scr)
TODO: remove this method if it is not needed |
Location |
newLocation(Location loc)
creates a location on the current screen with the given point.
|
Region |
newRegion(Location loc,
int width,
int height)
creates a region on the current screen with the given coordinate/size.
|
static void |
resetMonitors()
re-initialize the monitor setup (e.g.
|
String |
saveCapture(String name) |
String |
saveCapture(String name,
Region reg) |
Region |
selectRegion()
interactive region create with predefined message: lets the user draw the rectangle using the
mouse
|
Region |
selectRegion(String message)
interactive region create with given message: lets the user draw the rectangle using the mouse
|
void |
setAsScreen()
INTERNAL USE
reset from being a screen union to the screen used before
|
void |
setAsScreenUnion()
INTERNAL USE
collect all physical screens to one big region
This is under evaluation, wether it really makes sense |
protected Region |
setScreen(IScreen s)
Should not be used - throws UnsupportedOperationException
|
static void |
showMonitors()
show the current monitor setup
|
void |
showTarget(Location loc) |
protected void |
showTarget(Location loc,
double secs) |
static void |
startPrompt(String message,
EventObserver obs) |
String |
toJSON() |
String |
toString() |
String |
toStringShort()
only a short version of toString()
|
void |
update(EventSubject s)
Internal use only
|
protected boolean |
useFullscreen() |
ScreenImage |
userCapture()
interactive capture with predefined message: lets the user capture a screen image using the
mouse to draw the rectangle
|
ScreenImage |
userCapture(String message)
interactive capture with given message: lets the user capture a screen image using the mouse to
draw the rectangle
|
above, above, aboveAt, aboveAt, add, add, add, asOffset, atMouse, below, below, belowAt, belowAt, checkMatch, click, click, click, compare, compare, contains, contains, containsMouse, copyTo, copyTo, create, create, create, create, create, create, delayClick, delayType, doubleClick, doubleClick, doubleClick, drag, dragDrop, dragDrop, dropAt, exists, exists, find, findAll, findAllByColumn, findAllByRow, findAllText, findBest, findText, findText, get, getAutoWaitTimeout, getBottomLeft, getBottomRight, getCell, getCenter, getCol, getCol, getCols, getColW, getEvent, getEvents, getFindFailedResponse, getH, getLastMatch, getLastMatches, getLastScreenImage, getLastScreenImageFile, getLastScreenImageFile, getLastScreenImageFile, getLastTime, getObserver, getObserveScanRate, getRect, getRectangle, getRepeatWaitTime, getROI, getRow, getRow, getRowH, getRows, getScreenContaining, getTarget, getThrowException, getTopLeft, getTopRight, getW, getWaitScanRate, getX, getY, grow, grow, grow, grow, grow, grow, grow, hasEvents, hasObserver, highlight, highlight, highlight, highlight, highlight, highlight, hover, hover, init, initScreen, inside, intersection, isObserving, isOtherScreen, isRasterValid, isValid, isVirtual, keyDown, keyDown, keyUp, keyUp, keyUp, left, left, leftAt, leftAt, listText, morphTo, mouseDown, mouseMove, mouseMove, mouseMove, mouseUp, mouseUp, moveTo, nearby, nearby, observe, observe, observeInBackground, observeJ, offset, offset, onAppear, onAppear, onChange, onChange, onChange, onChange, onChangeDo, onVanish, onVanish, paste, paste, regionOnScreen, resetScreens, right, right, rightAt, rightAt, rightClick, rightClick, rightClick, saveLastScreenImage, saveScreenCapture, saveScreenCapture, saveScreenCapture, setActive, setAutoWaitTimeout, setBottomLeft, setBottomRight, setCenter, setCols, setFindFailedResponse, setH, setInactive, setLocation, setObserveScanRate, setOtherScreen, setRaster, setRect, setRect, setRect, setRepeatWaitTime, setROI, setROI, setROI, setROI, setRows, setScreen, setSize, setThrowException, setTopLeft, setTopRight, setVirtual, setW, setWaitScanRate, setX, setY, showScreens, silentHighlight, stopObserver, stopObserver, text, toGlobalCoord, type, type, type, type, type, type, union, updateSelf, virtual, wait, wait, wait, waitVanish, waitVanish, wheel, wheel, wheel, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getH, getLastScreenImageFile, getRect, getW, getX, getY, isOtherScreen
protected static Screen[] screens
protected static int primaryScreen
protected IRobot robot
protected int curID
protected int oldID
protected int monitor
protected boolean waitPrompt
protected OverlayCapturePrompt prompt
public Screen(int id)
id
- valid screen numberpublic Screen(boolean isScreenUnion)
isScreenUnion
- true/falsepublic Screen()
public int getcurrentID()
protected static IRobot getMouseRobot()
protected static Region getFakeRegion()
public static ScreenUnion all()
public static Screen as(int id)
public void setAsScreenUnion()
public void setAsScreen()
public void initScreen(Screen scr)
scr
- protected Region setScreen(IScreen s)
public static void showMonitors()
public static void resetMonitors()
protected boolean useFullscreen()
public static int getNumberScreens()
public static int getPrimaryId()
public static Screen getPrimaryScreen()
public static Screen getScreen(int id)
id
- of the screenpublic Rectangle getBounds()
public static Rectangle getBounds(int id)
id
- of the screenpublic static IRobot getRobot(int id)
id
- of the screenpublic int getIdFromPoint(int x, int y)
getIdFromPoint
in interface IScreen
x
- valuey
- valuepublic IRobot getRobot()
public Region newRegion(Location loc, int width, int height)
loc
- Locationwidth
- valueheight
- valuepublic ScreenImage getLastScreenImageFromScreen()
getLastScreenImageFromScreen
in interface IScreen
public Location newLocation(Location loc)
loc
- Locationpublic ScreenImage capture()
public ScreenImage capture(int x, int y, int w, int h)
public ScreenImage captureforHighlight(int x, int y, int w, int h)
public ScreenImage capture(Rectangle rect)
public ScreenImage capture(Region reg)
public ScreenImage userCapture()
public static void startPrompt(String message, EventObserver obs)
public static void closePrompt()
public ScreenImage userCapture(String message)
userCapture
in interface IScreen
message
- textpublic Region selectRegion()
public Region selectRegion(String message)
message
- textpublic void update(EventSubject s)
update
in interface EventObserver
s
- EventSubjectpublic void showTarget(Location loc)
showTarget
in interface IScreen
protected void showTarget(Location loc, double secs)
public String toStringShort()
toStringShort
in interface IScreen
toStringShort
in class Region