public class Location extends Object implements Comparable<Location>
| Constructor and Description |
|---|
Location(double x,
double y)
to allow calculated x and y that might not be integers
|
Location(int x,
int y)
a new point at the given coordinates
|
Location(Location loc)
duplicates the point
|
Location(Point point)
create from AWT point
|
| Modifier and Type | Method and Description |
|---|---|
Location |
above(int dy)
creates a point at the given offset above, might be negative
might create a point outside of any screen, not checked |
Location |
below(int dy)
creates a point at the given offset below, might be negative
might create a point outside of any screen, not checked |
Location |
click()
Move the mouse to this location point and click left
|
int |
compareTo(Location loc) |
Location |
copyTo(int scrID)
new point with same offset to current screen's top left on given screen
|
Location |
copyTo(IScreen screen)
New point with same offset to current screen's top left on given screen
|
Location |
doubleClick()
Move the mouse to this location point and double click left
|
boolean |
equals(Object oThat) |
Color |
getColor()
Get the color at the given Point for details: see java.awt.Robot and ...Color
|
Screen |
getMonitor()
Returns primary screen, if outside of any screen or not contained in a non-Desktop Screen instance (e.g. remote screen)
|
Location |
getOffset(Location loc)
the offset of given point to this Location
|
Point |
getPoint()
get as AWT point
|
protected IRobot |
getRobotForPoint(String action) |
IScreen |
getScreen()
Returns null, if outside of any screen and not contained in a non-Desktop Screen instance (e.g. remote screen)
subsequent actions WILL crash if not tested for null return |
int |
getX() |
int |
getY() |
Region |
grow(int wh)
create a region with this point as center and the given size
|
Region |
grow(int w,
int h)
create a region with this point as center and the given size
|
Region |
grow(int CREATE_X_DIRECTION,
int CREATE_Y_DIRECTION,
int w,
int h)
create a region with a corner at this point
as specified with x y 0 0 top left 0 1 bottom left 1 0 top right 1 1 bottom right |
Location |
hover()
Move the mouse to this location point
|
boolean |
isOtherScreen()
INTERNAL USE
reveals wether the containing screen is a DeskTopScreen or not
|
Location |
left(int dx)
creates a point at the given offset to the left, might be negative
might create a point outside of any screen, not checked |
Location |
move(int X,
int Y)
convenience: like awt point
|
Location |
moveFor(int dx,
int dy)
Deprecated.
|
Location |
moveTo(int X,
int Y)
Deprecated.
use
move(int, int) |
Location |
offset(int dx,
int dy)
creates a point at the given offset, might be negative
might create a point outside of any screen, not checked |
Location |
offset(Location loc)
creates a point at the given offset, might be negative
might create a point outside of any screen, not checked |
Location |
right(int dx)
creates a point at the given offset to the right, might be negative
might create a point outside of any screen, not checked |
Location |
rightClick()
Move the mouse to this location point and click right
|
Location |
setLocation(double x,
double y)
sets the coordinates to the given values (moves it)
|
Location |
setLocation(int x,
int y)
sets the coordinates to the given values (moves it)
|
Location |
setOtherScreen(IScreen scr)
INTERNAL USE
identifies the point as being on a non-desktop-screen
|
String |
toJSON() |
String |
toString() |
String |
toStringShort() |
Location |
translate(int dx,
int dy)
convenience: like awt point
|
public Location(double x,
double y)
x - columny - row
truncated to the integer partpublic Location(int x,
int y)
x - columny - rowpublic Location(Location loc)
loc - other Locationpublic Location(Point point)
point - a Pointpublic int getX()
public int getY()
public Point getPoint()
public Location setLocation(int x, int y)
x - new xy - new ypublic Location setLocation(double x, double y)
x - new x might be non-inty - new y might be non-intpublic IScreen getScreen()
public Screen getMonitor()
public boolean isOtherScreen()
public Location setOtherScreen(IScreen scr)
scr - Screenpublic Color getColor()
public Location getOffset(Location loc)
loc - the other Locationpublic Region grow(int w, int h)
w - the widthh - the heightpublic Region grow(int wh)
wh - the width and heightpublic Region grow(int CREATE_X_DIRECTION, int CREATE_Y_DIRECTION, int w, int h)
CREATE_X_DIRECTION - == 0 is left side !=0 is right side, see Region.CREATE_X_DIRECTION_LEFT, Region.CREATE_X_DIRECTION_RIGHTCREATE_Y_DIRECTION - == 0 is top side !=0 is bottom side, see Region.CREATE_Y_DIRECTION_TOP, Region.CREATE_Y_DIRECTION_BOTTOMw - the widthh - the height@Deprecated public Location moveFor(int dx, int dy)
translate(int, int)dx - x offsetdy - y offsetpublic Location translate(int dx, int dy)
dx - x offsetdy - y offset@Deprecated public Location moveTo(int X, int Y)
move(int, int)X - new xY - new ypublic Location move(int X, int Y)
X - new xY - new ypublic Location offset(int dx, int dy)
dx - x offsetdy - y offsetpublic Location offset(Location loc)
loc - offset given as Locationpublic Location left(int dx)
dx - x offsetpublic Location right(int dx)
dx - x offsetpublic Location above(int dy)
dy - y offsetpublic Location below(int dy)
dy - y offsetpublic Location copyTo(int scrID)
scrID - number of screenpublic Location copyTo(IScreen screen)
screen - new parent screenpublic Location hover()
public Location click()
public Location doubleClick()
public Location rightClick()
public int compareTo(Location loc)
compareTo in interface Comparable<Location>loc - other Locationpublic String toStringShort()
public String toJSON()
Copyright © 2017. All rights reserved.