public class DefaultGraphicsDevice extends Object implements Cloneable, AbstractGraphicsDevice
DEFAULT_CONNECTION, DEFAULT_UNIT, EXTERNAL_CONNECTION
Constructor and Description |
---|
DefaultGraphicsDevice(String type,
String connection,
int unitID)
Create an instance with the system default
ToolkitLock ,
gathered via NativeWindowFactory.getDefaultToolkitLock(String) . |
DefaultGraphicsDevice(String type,
String connection,
int unitID,
long handle)
Create an instance with the system default
ToolkitLock . |
DefaultGraphicsDevice(String type,
String connection,
int unitID,
long handle,
ToolkitLock locker)
Create an instance with the given
ToolkitLock instance. |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
close()
Optionally closing the device.
|
String |
getConnection()
Returns the semantic GraphicsDevice connection.
On platforms supporting remote devices, eg via tcp/ip network, the implementation shall return a unique name for each remote address. On X11 for example, the connection string should be as the following example. :0.0 for a local connection
remote.host.net:0.0 for a remote connection
To support multiple local device, see AbstractGraphicsDevice.getUnitID() . |
long |
getHandle()
Returns the native handle of the underlying native device,
if such thing exist.
|
ToolkitLock |
getToolkitLock() |
String |
getType()
Returns the type of the underlying subsystem, ie
NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, ..
|
String |
getUniqueID()
Returns a unique ID String of this device using
type ,
connection and unitID .The unique ID does not reflect the instance of the device, hence the handle is not included. The unique ID may be used as a key for semantic device mapping. |
int |
getUnitID()
Returns the graphics device
unit ID .The unit ID support multiple graphics device configurations
on a local machine.To support remote device, see AbstractGraphicsDevice.getConnection() . |
void |
lock()
No lock is performed on the graphics device per default,
instead the aggregated recursive
ToolkitLock.lock() is invoked. |
String |
toString() |
void |
unlock()
No lock is performed on the graphics device per default,
instead the aggregated recursive
ToolkitLock.unlock() is invoked. |
public DefaultGraphicsDevice(String type, String connection, int unitID)
ToolkitLock
,
gathered via NativeWindowFactory.getDefaultToolkitLock(String)
.type
- public DefaultGraphicsDevice(String type, String connection, int unitID, long handle)
ToolkitLock
.
gathered via NativeWindowFactory.createDefaultToolkitLock(String, long)
.type
- handle
- public DefaultGraphicsDevice(String type, String connection, int unitID, long handle, ToolkitLock locker)
ToolkitLock
instance.type
- handle
- locker
- public final String getType()
AbstractGraphicsDevice
getType
in interface AbstractGraphicsDevice
public final String getConnection()
AbstractGraphicsDevice
:0.0
for a local connectionremote.host.net:0.0
for a remote connectionAbstractGraphicsDevice.getUnitID()
.getConnection
in interface AbstractGraphicsDevice
public final int getUnitID()
AbstractGraphicsDevice
unit ID
.unit ID
support multiple graphics device configurations
on a local machine.AbstractGraphicsDevice.getConnection()
.getUnitID
in interface AbstractGraphicsDevice
public final String getUniqueID()
AbstractGraphicsDevice
type
,
connection
and unitID
.getUniqueID
in interface AbstractGraphicsDevice
public final long getHandle()
AbstractGraphicsDevice
getHandle
in interface AbstractGraphicsDevice
public final void lock()
ToolkitLock.lock()
is invoked.lock
in interface AbstractGraphicsDevice
DefaultGraphicsDevice#DefaultGraphicsDevice(java.lang.String, long)
,
DefaultGraphicsDevice#DefaultGraphicsDevice(java.lang.String, long, javax.media.nativewindow.ToolkitLock)
public final void unlock()
ToolkitLock.unlock()
is invoked.unlock
in interface AbstractGraphicsDevice
DefaultGraphicsDevice#DefaultGraphicsDevice(java.lang.String, long)
,
DefaultGraphicsDevice#DefaultGraphicsDevice(java.lang.String, long, javax.media.nativewindow.ToolkitLock)
public boolean close()
AbstractGraphicsDevice
The default implementation is a NOP
, just setting the handle to null
.
X11GraphicsDevice
,
shall have a enable/disable like javax.media.nativewindow.x11.X11GraphicsDevice#setCloseDisplay(boolean, boolean)
,close
in interface AbstractGraphicsDevice
null
, otherwise false.public final ToolkitLock getToolkitLock()
DefaultGraphicsDevice#DefaultGraphicsDevice(java.lang.String, long)
,
DefaultGraphicsDevice#DefaultGraphicsDevice(java.lang.String, long, javax.media.nativewindow.ToolkitLock)
Copyright 2010 JogAmp Community.