javax.media.nativewindow
Interface AbstractGraphicsDevice

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AWTGraphicsDevice, DefaultGraphicsDevice, EGLGraphicsDevice, MacOSXGraphicsDevice, WindowsGraphicsDevice, X11GraphicsDevice

public interface AbstractGraphicsDevice
extends Cloneable

A interface describing a graphics device in a toolkit-independent manner.


Field Summary
static String DEFAULT_CONNECTION
          Dummy connection value for a default connection where no native support for multiple devices is available
static int DEFAULT_UNIT
          Default unit id for the 1st device: 0
static String EXTERNAL_CONNECTION
          Dummy connection value for an external connection where no native support for multiple devices is available
 
Method Summary
 boolean close()
          Optionally closing the device.
The default implementation is a NOP operation, returning false.
The specific implementing, ie X11GraphicsDevice, shall have a enable/disable like javax.media.nativewindow.x11.X11GraphicsDevice#setCloseDisplay(boolean, boolean),
which shall be invoked at creation time to determine ownership/role of freeing the resource.
 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 getUnitID().
 long getHandle()
          Returns the native handle of the underlying native device, if such thing exist.
 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 getConnection().
 void lock()
          Optionally locking the device, utilizing eg ToolkitLock.
 void unlock()
          Optionally unlocking the device, utilizing eg ToolkitLock.
 

Field Detail

DEFAULT_CONNECTION

static final String DEFAULT_CONNECTION
Dummy connection value for a default connection where no native support for multiple devices is available

See Also:
Constant Field Values

EXTERNAL_CONNECTION

static final String EXTERNAL_CONNECTION
Dummy connection value for an external connection where no native support for multiple devices is available

See Also:
Constant Field Values

DEFAULT_UNIT

static final int DEFAULT_UNIT
Default unit id for the 1st device: 0

See Also:
Constant Field Values
Method Detail

getType

String getType()
Returns the type of the underlying subsystem, ie NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, ..


getConnection

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.
To support multiple local device, see getUnitID().


getUnitID

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 getConnection().

Returns:

getUniqueID

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.


getHandle

long getHandle()
Returns the native handle of the underlying native device, if such thing exist.


lock

void lock()
Optionally locking the device, utilizing eg ToolkitLock. The lock implementation must be recursive.


unlock

void unlock()
Optionally unlocking the device, utilizing eg ToolkitLock. The lock implementation must be recursive.


close

boolean close()
Optionally closing the device.
The default implementation is a NOP operation, returning false.
The specific implementing, ie X11GraphicsDevice, shall have a enable/disable like javax.media.nativewindow.x11.X11GraphicsDevice#setCloseDisplay(boolean, boolean),
which shall be invoked at creation time to determine ownership/role of freeing the resource.

Returns:
true if a specialized closing operation was successfully issued, otherwise false, ie no native closing operation was issued, which doesn't imply an error at all.


Copyright 2010 JogAmp Community.