public abstract class Screen extends Object
MonitorDevice
s representing their combined virtual size.Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
static int |
SCREEN_MODE_CHANGE_TIMEOUT
A 10s timeout for screen mode change.
|
Constructor and Description |
---|
Screen() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addMonitorModeListener(MonitorModeListener sml) |
abstract int |
addReference()
|
abstract void |
createNative()
Manual trigger the native creation, if not done yet..
This is useful to be able to request the AbstractGraphicsScreen , via
getGraphicsScreen() .Otherwise the abstract device won't be available before the dependent component (Window) is realized. |
abstract void |
destroy()
Manually trigger the destruction, incl.
|
boolean |
equals(Object obj)
return true if obj is of type Display and both FQN
getFQName() equals |
static int |
getActiveScreenNumber() |
static Collection<Screen> |
getAllScreens()
Returns the global screen collection
|
abstract Display |
getDisplay() |
static Screen |
getFirstScreenOf(Display display,
int idx,
int fromIndex) |
abstract String |
getFQName() |
abstract AbstractGraphicsScreen |
getGraphicsScreen() |
abstract int |
getHeight() |
abstract int |
getIndex() |
static Screen |
getLastScreenOf(Display display,
int idx,
int fromIndex) |
MonitorDevice |
getMainMonitor(RectangleImmutable r)
|
abstract List<MonitorDevice> |
getMonitorDevices()
Return a list of available
MonitorDevice s. |
abstract List<MonitorMode> |
getMonitorModes()
Return a list of all
MonitorMode s for all MonitorDevice s. |
abstract int |
getReferenceCount() |
abstract RectangleImmutable |
getViewport() |
abstract int |
getWidth() |
abstract int |
getX() |
abstract int |
getY() |
abstract int |
hashCode()
return precomputed hashCode from FQN
getFQName() |
abstract boolean |
isNativeValid() |
abstract void |
removeMonitorModeListener(MonitorModeListener sml) |
abstract int |
removeReference()
|
Rectangle |
unionOfMonitorViewportSize(Rectangle result)
Returns the union of all monitor's
viewport . |
public static final int SCREEN_MODE_CHANGE_TIMEOUT
public static final boolean DEBUG
public abstract int hashCode()
getFQName()
public boolean equals(Object obj)
getFQName()
equalspublic abstract void createNative() throws NativeWindowException
AbstractGraphicsScreen
, via
getGraphicsScreen()
.
This method is usually invoke by addReference()
This method invokes Display.addReference()
after creating the native peer,
which will issue Display.createNative()
if the reference count was 0.
NativeWindowException
- if the native creation failed.public abstract void destroy()
This method is usually invoke by removeReference()
This method invokes Display.removeReference()
after it's own destruction,
which will issue Display.destroy()
if the reference count becomes 0.
public abstract boolean isNativeValid()
public abstract int getReferenceCount()
public abstract int addReference() throws NativeWindowException
NativeWindowException
- if the native creation failed.removeReference()
,
#setDestroyWhenUnused(boolean)
,
#getDestroyWhenUnused()
public abstract int removeReference()
addReference()
,
#setDestroyWhenUnused(boolean)
,
#getDestroyWhenUnused()
public abstract AbstractGraphicsScreen getGraphicsScreen()
public abstract int getIndex()
getDisplay()
.public abstract int getX()
public abstract int getY()
public abstract int getWidth()
public abstract int getHeight()
public abstract RectangleImmutable getViewport()
public abstract Display getDisplay()
public abstract String getFQName()
Display.getFQName()
+ getIndex()
.public abstract List<MonitorMode> getMonitorModes()
MonitorMode
s for all MonitorDevice
s.
The list is ordered in descending order,
see MonitorMode.compareTo(MonitorMode)
.
public abstract List<MonitorDevice> getMonitorDevices()
MonitorDevice
s.public final MonitorDevice getMainMonitor(RectangleImmutable r)
MonitorDevice
which viewport
covers
the given rectangle the most.
If no coverage is detected the first MonitorDevice
is returned.
public final Rectangle unionOfMonitorViewportSize(Rectangle result)
viewport
.
Should be equal to getX()
, getY()
, getWidth()
and getHeight()
,
however, some native toolkits may choose a different virtual screen area.
result
- storage for result, will be returnedpublic abstract void addMonitorModeListener(MonitorModeListener sml)
sml
- MonitorModeListener
to be added for MonitorEvent
public abstract void removeMonitorModeListener(MonitorModeListener sml)
sml
- MonitorModeListener
to be removed from MonitorEvent
public static Screen getFirstScreenOf(Display display, int idx, int fromIndex)
type
- name
- fromIndex
- start index, then increasing until found or end of list *public static Screen getLastScreenOf(Display display, int idx, int fromIndex)
type
- name
- fromIndex
- start index, then decreasing until found or end of list. -1 is interpreted as size - 1.public static Collection<Screen> getAllScreens()
public static int getActiveScreenNumber()
Copyright 2010 JogAmp Community.