|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.nativewindow.NativeWindowFactory
public abstract class NativeWindowFactory
Provides a pluggable mechanism for arbitrary window toolkits to
adapt their components to the NativeWindow
interface,
which provides a platform-independent mechanism of accessing the
information required to perform operations like
hardware-accelerated rendering using the OpenGL API.
Field Summary | |
---|---|
static String |
AWTComponentClassName
|
protected static boolean |
DEBUG
|
static String |
JAWTUtilClassName
|
static String |
TYPE_AWT
Generic AWT type, as retrieved with getNativeWindowType(boolean) |
static String |
TYPE_DEFAULT
Generic DEFAULT type, where platform implementation don't care, as retrieved with getNativeWindowType(boolean) |
static String |
TYPE_EGL
OpenKODE/EGL type, as retrieved with getNativeWindowType(boolean) |
static String |
TYPE_MACOSX
Mac OS X type, as retrieved with getNativeWindowType(boolean) |
static String |
TYPE_WINDOWS
Microsoft Windows type, as retrieved with getNativeWindowType(boolean) |
static String |
TYPE_X11
X11 type, as retrieved with getNativeWindowType(boolean) |
static String |
X11JAWTToolkitLockClassName
|
static String |
X11ToolkitLockClassName
|
static String |
X11UtilClassName
|
Constructor Summary | |
---|---|
protected |
NativeWindowFactory()
Creates a new NativeWindowFactory instance. |
Method Summary | |
---|---|
static ToolkitLock |
createDefaultToolkitLock(String type,
long deviceHandle)
Creates the default ToolkitLock for type and deviceHandle . |
static ToolkitLock |
createDefaultToolkitLockNoAWT(String type,
long deviceHandle)
|
protected static ToolkitLock |
createX11AWTToolkitLock(long deviceHandle)
|
protected static ToolkitLock |
createX11ToolkitLock(long deviceHandle)
|
protected static ToolkitLock |
getAWTToolkitLock()
|
static NativeWindowFactory |
getDefaultFactory()
Gets the default NativeWindowFactory. |
static ToolkitLock |
getDefaultToolkitLock()
Provides the system default ToolkitLock , a singleton instance. |
static ToolkitLock |
getDefaultToolkitLock(String type)
Provides the default ToolkitLock for type , a singleton instance. |
static NativeWindowFactory |
getFactory(Class windowClass)
Returns the appropriate NativeWindowFactory to handle window objects of the given type. |
static String |
getNativeOSName(boolean useCustom)
|
static NativeWindow |
getNativeWindow(Object winObj,
AbstractGraphicsConfiguration config)
Converts the given window object and it's AbstractGraphicsConfiguration into a
NativeWindow which can be operated upon by a custom
toolkit, e.g. |
protected abstract NativeWindow |
getNativeWindowImpl(Object winObj,
AbstractGraphicsConfiguration config)
Performs the conversion from a toolkit's window object to a NativeWindow. |
static String |
getNativeWindowType(boolean useCustom)
|
static ToolkitLock |
getNullToolkitLock()
|
static void |
initSingleton(boolean firstUIActionOnProcess)
Static one time initialization of this factory. This initialization method must be called once by the program or utilizing modules! |
static boolean |
isAWTAvailable()
|
static boolean |
isFirstUIActionOnProcess()
|
protected static void |
registerFactory(Class windowClass,
NativeWindowFactory factory)
Registers a NativeWindowFactory handling window objects of the given class. |
static void |
setDefaultFactory(NativeWindowFactory factory)
Sets the default NativeWindowFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final boolean DEBUG
public static final String TYPE_EGL
getNativeWindowType(boolean)
public static final String TYPE_WINDOWS
getNativeWindowType(boolean)
public static final String TYPE_X11
getNativeWindowType(boolean)
public static final String TYPE_MACOSX
getNativeWindowType(boolean)
public static final String TYPE_AWT
getNativeWindowType(boolean)
public static final String TYPE_DEFAULT
getNativeWindowType(boolean)
public static final String AWTComponentClassName
public static final String JAWTUtilClassName
public static final String X11UtilClassName
public static final String X11JAWTToolkitLockClassName
public static final String X11ToolkitLockClassName
Constructor Detail |
---|
protected NativeWindowFactory()
Method Detail |
---|
public static void initSingleton(boolean firstUIActionOnProcess)
firstUIActionOnProcess
- Should be true
if called before the first UI action of the running program,
otherwise false
.public static boolean isFirstUIActionOnProcess()
initSingleton(firstUIActionOnProcess==true)
,
otherwise false.public static boolean isAWTAvailable()
public static String getNativeOSName(boolean useCustom)
useCustom
- if false return the native value, if true return a custom value if set, otherwise fallback to the native value.
public static String getNativeWindowType(boolean useCustom)
useCustom
- if false return the native value, if true return a custom value if set, otherwise fallback to the native value.
TYPE_X11
, ..public static void setDefaultFactory(NativeWindowFactory factory)
public static NativeWindowFactory getDefaultFactory()
public static ToolkitLock getDefaultToolkitLock()
ToolkitLock
, a singleton instance.
JAWTToolkitLock
in case of a X11 system and AWT availability and if
this factory has been initialized with initSingleton(firstUIActionOnProcess==true)
, NullToolkitLock
is returned.
public static ToolkitLock getDefaultToolkitLock(String type)
ToolkitLock
for type
, a singleton instance.
JAWTToolkitLock
in case of a X11 type or AWT type / X11 system and AWT availability and if
this factory has been initialized with initSingleton(firstUIActionOnProcess==true)
, NullToolkitLock
is returned.
protected static ToolkitLock getAWTToolkitLock()
public static ToolkitLock getNullToolkitLock()
public static ToolkitLock createDefaultToolkitLock(String type, long deviceHandle)
ToolkitLock
for type
and deviceHandle
.
X11JAWTToolkitLock
in case of a X11 type and AWT availability and if
this factory has been initialized with initSingleton(firstUIActionOnProcess==true)
, X11ToolkitLock
in case of a X11 type and no AWT availability and if
this factory has been initialized with initSingleton(firstUIActionOnProcess==true)
, NullToolkitLock
is returned.
public static ToolkitLock createDefaultToolkitLockNoAWT(String type, long deviceHandle)
protected static ToolkitLock createX11AWTToolkitLock(long deviceHandle)
protected static ToolkitLock createX11ToolkitLock(long deviceHandle)
public static NativeWindowFactory getFactory(Class windowClass) throws IllegalArgumentException
NativeWindow
, in which case the client has
already assumed the responsibility of creating a compatible
NativeWindow implementation, or it might be that of a toolkit
class like Component
.
IllegalArgumentException
protected static void registerFactory(Class windowClass, NativeWindowFactory factory)
public static NativeWindow getNativeWindow(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException
AbstractGraphicsConfiguration
into a
NativeWindow
which can be operated upon by a custom
toolkit, e.g. javax.media.opengl.GLDrawableFactory
.GraphicsConfigurationFactory
to construct a proper AbstractGraphicsConfiguration
.
IllegalArgumentException
- if the given window object
could not be handled by any of the registered
NativeWindowFactory instances
NativeWindowException
javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
protected abstract NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException
IllegalArgumentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |