Class NativeMonitorInfo

java.lang.Object
com.github.kwhat.jnativehook.NativeMonitorInfo

public class NativeMonitorInfo extends Object
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

    Constructors
    Constructor
    Description
    NativeMonitorInfo(short number, int x, int y, short width, short height)
    Instantiates a new monitor info class.
  • Method Summary

    Modifier and Type
    Method
    Description
    short
    Returns the hight of this naitve monitor.
    short
    Get the logical number of this display.
    short
    Returns the width of this native display.
    int
    Returns the x offset of this display.
    int
    Returns the y offset of this display.
    void
    setHeight(short height)
    Set the height in pixel value for this display.
    void
    setNumber(short number)
    Set the logical number for this display.
    void
    setWidth(short width)
    Set the width in pixel value for this display.
    void
    setX(int x)
    Set the x offset of this display.
    void
    setY(int y)
    Set the y offset of this display.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.