public abstract class MonitorDevice extends Object
DimensionImmutable size in [mm]MonitorMode original modeList<MonitorMode> supportedModesMonitorMode current modeRectangleImmutable viewport (rotated)All values of this interface are represented in pixel units, if not stated otherwise.
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int x,
int y)
Returns
true if given screen coordinates in pixel units
are contained by this viewport, otherwise false. |
boolean |
equals(Object obj)
Tests equality of two
MonitorDevice objects
by evaluating equality of it's components:nativeID
|
MonitorMode |
getCurrentMode()
Returns the cached current
MonitorMode w/o native query. |
int |
getId() |
MonitorMode |
getOriginalMode()
Returns the immutable original
MonitorMode, as used at NEWT initialization. |
void |
getPixelsPerMM(float[] ppmmStore)
Stores the pixels per millimeter value according to current
MonitorMode
SurfaceSize's resolution in the given storage ppmmStore. |
void |
getPixelsPerMM(MonitorMode mode,
float[] ppmmStore)
Stores the pixels per millimeter value according to the given
MonitorMode
SurfaceSize's resolution in the given storage ppmmStore. |
Screen |
getScreen()
Returns the
Screen owning this monitor. |
DimensionImmutable |
getSizeMM() |
List<MonitorMode> |
getSupportedModes()
Returns a list of immutable
MonitorModes supported by this monitor. |
RectangleImmutable |
getViewport()
Returns the
rectangular portion
of the rotated virtual Screen size in pixel units
represented by this monitor, i.e. |
RectangleImmutable |
getViewportInWindowUnits()
Returns the
rectangular portion
of the rotated virtual Screen size in window units
represented by this monitor, i.e. |
int |
hashCode()
Returns a combined hash code of it's elements:
nativeID
|
boolean |
isModeChangedByUs()
Returns
true if the |
boolean |
isOriginalMode() |
abstract MonitorMode |
queryCurrentMode()
Returns the current
MonitorMode resulting from a native query. |
abstract boolean |
setCurrentMode(MonitorMode mode)
Set the current
MonitorMode. |
String |
toString() |
static void |
unionOfViewports(Rectangle viewport,
Rectangle viewportInWindowUnits,
List<MonitorDevice> monitors)
Calculates the union of the given monitor's
viewport in pixel- and window units. |
public final boolean equals(Object obj)
MonitorDevice objects
by evaluating equality of it's components:nativeIDpublic final int hashCode()
nativeIDpublic final int getId()
public final DimensionImmutable getSizeMM()
public final void getPixelsPerMM(float[] ppmmStore)
MonitorMode
SurfaceSize's resolution in the given storage ppmmStore.
To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f.
public final void getPixelsPerMM(MonitorMode mode, float[] ppmmStore)
MonitorMode
SurfaceSize's resolution in the given storage ppmmStore.
To convert the result to dpi, i.e. dots-per-inch, multiply both components with 25.4f.
public final MonitorMode getOriginalMode()
MonitorMode, as used at NEWT initialization.
The returned MonitorMode is element of the lists getSupportedModes() and Screen.getMonitorModes().
public final List<MonitorMode> getSupportedModes()
MonitorModes supported by this monitor.
The list is ordered in descending order,
see MonitorMode.compareTo(MonitorMode).
Use w/ care, it's not a copy!
public final RectangleImmutable getViewport()
rectangular portion
of the rotated virtual Screen size in pixel units
represented by this monitor, i.e. top-left origin and size.Screenpublic final RectangleImmutable getViewportInWindowUnits()
rectangular portion
of the rotated virtual Screen size in window units
represented by this monitor, i.e. top-left origin and size.Screenpublic final boolean contains(int x,
int y)
true if given screen coordinates in pixel units
are contained by this viewport, otherwise false.x - x-coord in pixel unitsy - y-coord in pixel unitspublic static void unionOfViewports(Rectangle viewport, Rectangle viewportInWindowUnits, List<MonitorDevice> monitors)
viewport in pixel- and window units.viewport - storage for result in pixel units, maybe nullviewportInWindowUnits - storage for result in window units, maybe nullmonitors - given list of monitorspublic final boolean isOriginalMode()
public final boolean isModeChangedByUs()
true if the MonitorMode
has been changed programmatic via this API only, otherwise false.
Note: We cannot guarantee that we won't interfere w/ another running
application's screen mode change or vice versa.
public final MonitorMode getCurrentMode()
MonitorMode w/o native query.
The returned MonitorMode is element of the lists getSupportedModes() and Screen.getMonitorModes().
queryCurrentMode()public abstract MonitorMode queryCurrentMode()
MonitorMode resulting from a native query.
The returned MonitorMode is element of the lists getSupportedModes() and Screen.getMonitorModes().
getCurrentMode()public abstract boolean setCurrentMode(MonitorMode mode)
MonitorMode.mode - to be made current, must be element of the list getSupportedModes() and Screen.getMonitorModes().Copyright 2010 JogAmp Community.