Package icyllis.modernui.core

# Class Monitor

java.lang.Object
icyllis.modernui.core.Monitor

@MainThread public final class Monitor extends Object
Represents a currently connected Monitor (sometimes known as Display). All methods must be called on the main thread and after GLFW initialization. This class can only be used when the application runs independently.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `Monitor.MonitorEventListener`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `addMonitorEventListener(Monitor.MonitorEventListener listener)`
  `VideoMode`
  `findBestMode(int width, int height)`
  `static Monitor`
  `get(long handle)`
  `static @UnmodifiableView Collection<Monitor>`
  `getAll()`
  `VideoMode`
  `getCurrentMode()`
  `long`
  `getHandle()`
  `VideoMode`
  `getModeAt(int index)`
  `int`
  `getModeCount()`
  Return the number of supported video modes for this Monitor.
  `String`
  `getName()`
  `static Monitor`
  `getPrimary()`
  `int`
  `getXPos()`
  Get the x position of this monitor in virtual screen coordinates.
  `int`
  `getYPos()`
  Get the y position of this monitor in virtual screen coordinates.
  `static void`
  `removeMonitorEventListener(Monitor.MonitorEventListener listener)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### get

    @Nullable public static Monitor get(long handle)

  - ### getPrimary

    @Nullable public static Monitor getPrimary()

  - ### getAll

    public static @UnmodifiableView Collection<Monitor> getAll()

  - ### addMonitorEventListener

    public static void addMonitorEventListener(@NonNull Monitor.MonitorEventListener listener)

  - ### removeMonitorEventListener

    public static void removeMonitorEventListener(@NonNull Monitor.MonitorEventListener listener)

  - ### getHandle

    public long getHandle()

  - ### getXPos

    public int getXPos()
    Get the x position of this monitor in virtual screen coordinates.
    Returns:
      the x position

  - ### getYPos

    public int getYPos()
    Get the y position of this monitor in virtual screen coordinates.
    Returns:
      the y position

  - ### getCurrentMode

    @NonNull public VideoMode getCurrentMode()

  - ### getName

    @NonNull public String getName()

  - ### getModeCount

    public int getModeCount()
    Return the number of supported video modes for this Monitor.
    Returns:
      the number of supported video modes

  - ### getModeAt

    @NonNull public VideoMode getModeAt(int index)

  - ### findBestMode

    @NonNull public VideoMode findBestMode(int width, int height)