org.sikuli.api
Class DefaultScreenLocation

java.lang.Object
  extended by org.sikuli.api.DefaultScreenLocation
All Implemented Interfaces:
Location, ScreenLocation
Direct Known Subclasses:
DesktopScreenLocation

public class DefaultScreenLocation
extends Object
implements ScreenLocation

This class provides manipulation methods that can be used for the default screen location.


Constructor Summary
DefaultScreenLocation(Screen screenRef, int x, int y)
          Constructs a new screen location whose screen is the specified screen (screenRef), and whose (x,y) coordinates are specified by the arguments of the same name.
DefaultScreenLocation(ScreenLocation loc)
          Constructs a new screen location whose screen and (x,y) coordinates are specified by the ScreenLocation argument.
 
Method Summary
 ScreenLocation getRelativeScreenLocation(int xoffset, int yoffset)
          Returns a new ScreenLocation relative to the specified offsets.
 Screen getScreen()
          Returns the screen associated with this screen location.
 int getX()
          Returns the X location of the screen coordinate.
 int getY()
          the Y location of the screen coordinate.
 void setScreen(Screen screen)
          Sets the screen associated with this screen location.
 void setX(int x)
          Sets the X location of the screen coordinate.
 void setY(int y)
          Sets the Y location of the screen coordinate.
 String toString()
          Returns a String representation of this DefaultScreenLocation and its values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultScreenLocation

public DefaultScreenLocation(Screen screenRef,
                             int x,
                             int y)
Constructs a new screen location whose screen is the specified screen (screenRef), and whose (x,y) coordinates are specified by the arguments of the same name.

Parameters:
screenRef - the specified screen or monitor.
x - the X location of the screen coordinate.
y - the Y location of the screen coordinate.

DefaultScreenLocation

public DefaultScreenLocation(ScreenLocation loc)
Constructs a new screen location whose screen and (x,y) coordinates are specified by the ScreenLocation argument.

Parameters:
loc - a ScreenLocation, specifying screen and (x,y) coordinates.
Method Detail

getRelativeScreenLocation

public ScreenLocation getRelativeScreenLocation(int xoffset,
                                                int yoffset)
Description copied from interface: ScreenLocation
Returns a new ScreenLocation relative to the specified offsets.

Specified by:
getRelativeScreenLocation in interface ScreenLocation
Parameters:
xoffset - the horizontal offset.
yoffset - the vertical offset.
Returns:
a new ScreenLocation.

toString

public String toString()
Returns a String representation of this DefaultScreenLocation and its values.

Overrides:
toString in class Object
Returns:
a String representing this DefaultScreenLocation object's coordinate and screen values.

getScreen

public Screen getScreen()
Description copied from interface: ScreenLocation
Returns the screen associated with this screen location.

Specified by:
getScreen in interface ScreenLocation
Returns:
the screen of this screen location.

setScreen

public void setScreen(Screen screen)
Description copied from interface: ScreenLocation
Sets the screen associated with this screen location.

Specified by:
setScreen in interface ScreenLocation
Parameters:
screen - the specified screen of this screen location.

getX

public int getX()
Description copied from interface: Location
Returns the X location of the screen coordinate.

Specified by:
getX in interface Location
Returns:
the X location of the screen coordinate.

setX

public void setX(int x)
Description copied from interface: Location
Sets the X location of the screen coordinate.

Specified by:
setX in interface Location
Parameters:
x - the X location of the screen coordinate.

getY

public int getY()
Description copied from interface: Location
the Y location of the screen coordinate.

Specified by:
getY in interface Location
Returns:
the Y location of the screen coordinate.

setY

public void setY(int y)
Description copied from interface: Location
Sets the Y location of the screen coordinate.

Specified by:
setY in interface Location
Parameters:
y - the Y location of the screen coordinate.


Copyright © 2014. All rights reserved.