public abstract class MonitorDevice extends Object
DimensionImmutable
size in [mm]MonitorMode
original modeList<MonitorMode>
supportedModesMonitorMode
current modeRectangleImmutable
viewport (rotated)Modifier and Type | Method and Description |
---|---|
boolean |
contains(int x,
int y)
|
float |
coverage(RectangleImmutable r)
Returns the coverage of given rectangle w/ this this
viewport , i.e. |
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. |
Screen |
getScreen()
Returns the
Screen owning this monitor. |
DimensionImmutable |
getSizeMM() |
List<MonitorMode> |
getSupportedModes()
Returns a list of immutable
MonitorMode s supported by this monitor. |
RectangleImmutable |
getViewport()
Returns the
rectangular portion of the rotated virtual Screen size represented by this monitor. |
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 Rectangle |
unionOfViewports(Rectangle result,
List<MonitorDevice> monitors)
Returns the union of the given monitor's
viewport . |
public final boolean equals(Object obj)
MonitorDevice
objects
by evaluating equality of it's components:nativeID
public final int hashCode()
nativeID
public final int getId()
public final DimensionImmutable getSizeMM()
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()
MonitorMode
s 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 represented by this monitor.public final boolean contains(int x, int y)
public final float coverage(RectangleImmutable r)
viewport
, i.e. between 0.0
and 1.0
.
Coverage is computed by:
isect = viewport.intersection(r); coverage = area( isect ) / area( viewport ) ;
public static Rectangle unionOfViewports(Rectangle result, List<MonitorDevice> monitors)
viewport
.result
- storage for result, will be returnedmonitors
- 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()
.
public abstract MonitorMode queryCurrentMode()
MonitorMode
resulting from a native query.
The returned MonitorMode
is element of the lists getSupportedModes()
and Screen.getMonitorModes()
.
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.