java.lang.Object
com.github.kwhat.jnativehook.NativeMonitorInfo
Object representation of a native monitor layout.
The primary display is guaranteed to be at number zero. No other grantee is made about monitor number for subsequent displays. All logical displays are guaranteed to have x and y coordinates relative to the primary display.
- Since:
- 2.1
- Version:
- 2.1
- Author:
- Alexander Barker (alex@1stleg.com)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNativeMonitorInfo(short number, int x, int y, short width, short height) Instantiates a new monitor info class. -
Method Summary
Modifier and TypeMethodDescriptionshortReturns the hight of this naitve monitor.shortGet the logical number of this display.shortgetWidth()Returns the width of this native display.intgetX()Returns the x offset of this display.intgetY()Returns the y offset of this display.voidsetHeight(short height) Set the height in pixel value for this display.voidsetNumber(short number) Set the logical number for this display.voidsetWidth(short width) Set the width in pixel value for this display.voidsetX(int x) Set the x offset of this display.voidsetY(int y) Set the y offset of this display.
-
Constructor Details
-
NativeMonitorInfo
public NativeMonitorInfo(short number, int x, int y, short width, short height) Instantiates a new monitor info class.Note that passing in an invalid ID results in unspecified behavior.
- Parameters:
number- an integer that identifies the display.x- the x coordate of this display.y- the y coordate of this display.width- the width coordate of this display.height- the height coordate of this display.
-
-
Method Details
-
getNumber
public short getNumber()Get the logical number of this display. The primary display will always be zero.- Returns:
- the logical number of this display.
-
setNumber
public void setNumber(short number) Set the logical number for this display.- Parameters:
number- the logical number of this display.
-
getX
public int getX()Returns the x offset of this display.- Returns:
- the x offset in pixels of this display.
-
setX
public void setX(int x) Set the x offset of this display.- Parameters:
x- the x location of this display.
-
getY
public int getY()Returns the y offset of this display.- Returns:
- the y offset in pixels of this display.
-
setY
public void setY(int y) Set the y offset of this display.- Parameters:
y- the y location of this display.
-
getWidth
public short getWidth()Returns the width of this native display.- Returns:
- the width in pixels of this display.
-
setWidth
public void setWidth(short width) Set the width in pixel value for this display.- Parameters:
width- the pixel width of this monitor.
-
getHeight
public short getHeight()Returns the hight of this naitve monitor.- Returns:
- the hight in pixels of this display.
-
setHeight
public void setHeight(short height) Set the height in pixel value for this display.- Parameters:
height- the pixel height of this display.
-