public abstract class Display extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Display.PointerIcon
Native PointerIcon handle.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
Constructor and Description |
---|
Display() |
Modifier and Type | Method and Description |
---|---|
abstract int |
addReference()
The 1st call will initiate native creation,
since we follow the lazy creation pattern.
|
abstract void |
createNative()
Manual trigger the native creation, if it is not done yet.
This is useful to be able to request the AbstractGraphicsDevice , via
getGraphicsDevice() .Otherwise the abstract device won't be available before the dependent components (Screen and Window) are realized. |
abstract Display.PointerIcon |
createPointerIcon(IOUtil.ClassResources pngResource,
int hotX,
int hotY)
Returns the newly created
Display.PointerIcon or null if not implemented on platform. |
abstract Display.PointerIcon |
createPointerIcon(PixelRectangle pixelrect,
int hotX,
int hotY)
Returns the newly created
Display.PointerIcon or null if not implemented on platform. |
abstract void |
destroy()
Manually trigger the destruction, incl.
|
abstract void |
dispatchMessages() |
static void |
dumpDisplayList(String prefix) |
boolean |
equals(Object obj)
return true if obj is of type Display and both FQN
getFQName() equals |
static int |
getActiveDisplayNumber() |
static Collection<Display> |
getAllDisplays()
Returns the global display collection
|
abstract EDTUtil |
getEDTUtil() |
static Display |
getFirstDisplayOf(String type,
String name,
int fromIndex,
boolean shared) |
abstract String |
getFQName() |
abstract AbstractGraphicsDevice |
getGraphicsDevice()
Return the
AbstractGraphicsDevice used for depending resources lifecycle,
i.e. |
abstract long |
getHandle()
Return the handle of the
AbstractGraphicsDevice as returned by getGraphicsDevice() . |
abstract int |
getId() |
static Display |
getLastDisplayOf(String type,
String name,
int fromIndex,
boolean shared) |
abstract String |
getName() |
abstract boolean |
getNativePointerIconForceDirectNIO()
Returns the native platform's direct NIO buffer requirement pointer-icon pixel data.
|
abstract PixelFormat |
getNativePointerIconPixelFormat()
Returns the native platform's
PointerIcon.PixelFormat for pointer-icon pixel data. |
abstract int |
getReferenceCount() |
static String |
getThreadName() |
abstract String |
getType() |
abstract int |
hashCode()
return precomputed hashCode from FQN
getFQName() |
static int |
hashCodeNullSafe(Object o) |
abstract boolean |
isEDTRunning() |
abstract boolean |
isExclusive()
Return true if this instance is exclusive, i.e.
|
abstract boolean |
isNativeValid() |
abstract int |
removeReference()
The last call may destroy this instance,
if
#getDestroyWhenUnused() returns true . |
abstract EDTUtil |
setEDTUtil(EDTUtil usrEDTUtil)
Sets a new
EDTUtil and returns the previous one. |
static String |
toHexString(int hex) |
static String |
toHexString(long hex) |
abstract boolean |
validateEDTStopped()
Validate EDT running state.
Stop the running EDT in case this display is destroyed already. |
public abstract int hashCode()
getFQName()
public boolean equals(Object obj)
getFQName()
equalspublic abstract PixelFormat getNativePointerIconPixelFormat()
PointerIcon.PixelFormat
for pointer-icon pixel data.
Using this value will avoid conversion within createPointerIcon(PixelRectangle, int, int)
.
public abstract boolean getNativePointerIconForceDirectNIO()
Using this value will avoid conversion within createPointerIcon(PixelRectangle, int, int)
.
public abstract Display.PointerIcon createPointerIcon(IOUtil.ClassResources pngResource, int hotX, int hotY) throws IllegalArgumentException, IllegalStateException, IOException
Display.PointerIcon
or null
if not implemented on platform.
See Display.PointerIcon
for lifecycle semantics.
pngResource
- single PNG resource for the Display.PointerIcon
. Only the first entry of IOUtil.ClassResources#resourcePaths
is used.hotX
- pointer hotspot x-coord, origin is upper-left cornerhotY
- pointer hotspot y-coord, origin is upper-left cornerIllegalArgumentException
- if pngResource is null or invalidIllegalStateException
- if this Display instance is not valid yet
.IOException
- if the pngResource
could not be resolved
or via the PNG parser processing the input stream.Display.PointerIcon
,
Window#setPointerIcon(PointerIcon)
public abstract Display.PointerIcon createPointerIcon(PixelRectangle pixelrect, int hotX, int hotY) throws IllegalArgumentException, IllegalStateException
Display.PointerIcon
or null
if not implemented on platform.
See Display.PointerIcon
for lifecycle semantics.
In case getNativePointerIconPixelFormat()
or getNativePointerIconForceDirectNIO()
is not matched by the given pixelrect
, the pixelrect
is converted
into the required PixelFormat
and NIO type.
pixelrect
- PixelRectangle
source for the Display.PointerIcon
hotX
- pointer hotspot x-coord, origin is upper-left cornerhotY
- pointer hotspot y-coord, origin is upper-left cornerIllegalArgumentException
- if pixelrect is null.IllegalStateException
- if this Display instance is not valid yet
.Display.PointerIcon
,
Window#setPointerIcon(PointerIcon)
,
getNativePointerIconPixelFormat()
,
getNativePointerIconForceDirectNIO()
public abstract void createNative() throws NativeWindowException
AbstractGraphicsDevice
, via
getGraphicsDevice()
.
This method is usually invoke by addReference()
NativeWindowException
- if the native creation failed.public abstract void destroy()
This method is usually invoke by removeReference()
public abstract boolean validateEDTStopped()
public abstract boolean isNativeValid()
destroy()
public abstract int getReferenceCount()
public abstract int addReference() throws NativeWindowException
NativeWindowException
- if the native creation failed.removeReference()
public abstract int removeReference()
#getDestroyWhenUnused()
returns true
.addReference()
,
#getDestroyWhenUnused()
,
#setDestroyWhenUnused(boolean)
public abstract AbstractGraphicsDevice getGraphicsDevice()
AbstractGraphicsDevice
used for depending resources lifecycle,
i.e. Screen
and Window
, as well as the event dispatching (EDT).public abstract long getHandle()
AbstractGraphicsDevice
as returned by getGraphicsDevice()
.public abstract String getFQName()
public abstract int getId()
public abstract String getName()
AbstractGraphicsDevice.getConnection()
.AbstractGraphicsDevice.getConnection()
public abstract String getType()
NativeWindowFactory.getNativeWindowType(boolean)
public abstract boolean isExclusive()
public abstract EDTUtil setEDTUtil(EDTUtil usrEDTUtil)
EDTUtil
and returns the previous one.
If usrEDTUtil
is null
,
the device's default EDTUtil is created and used.
If a previous one exists and it differs from usrEDTUtil
,
it's being stopped, wait-until-idle.
If usrEDTUtil
is not null and equals the previous one,
no change is being made.
public abstract EDTUtil getEDTUtil()
public abstract boolean isEDTRunning()
public abstract void dispatchMessages()
public static void dumpDisplayList(String prefix)
public static Display getFirstDisplayOf(String type, String name, int fromIndex, boolean shared)
type
- name
- fromIndex
- start index, then increasing until found or end of listpublic static Display getLastDisplayOf(String type, String name, int fromIndex, boolean shared)
type
- name
- fromIndex
- start index, then decreasing until found or end of list. -1 is interpreted as size - 1.public static Collection<Display> getAllDisplays()
public static int getActiveDisplayNumber()
public static String getThreadName()
public static String toHexString(int hex)
public static String toHexString(long hex)
public static int hashCodeNullSafe(Object o)
Copyright 2010 JogAmp Community.