summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-08-18 14:52:32 +0200
committerSven Gothel <[email protected]>2012-08-18 14:52:32 +0200
commitc5835a2e19a84cb08957d6c742e4334d578c3c66 (patch)
tree2d7b50355cbbf3a4e19ab5922f8d478316e75110 /src/nativewindow/classes/jogamp
parenta694cadca4ab72481e777222f412f006f973f77e (diff)
NativeWindowFactory.getNativeWindowType(..): Return canonical string representation allowing proper use of ref. comparison '==', instead of 'String.equals()'
Also make NativeWindowFactory's instances of nativeWindowingTypePure and nativeWindowingTypeCustom static final.
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java11
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java2
2 files changed, 6 insertions, 7 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index 2c2a627a4..29564da3b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -39,7 +39,6 @@ import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.ToolkitLock;
-import com.jogamp.common.os.Platform;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.common.util.ReflectionUtil.AWTNames;
@@ -76,17 +75,17 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
if (nativeWindowConstructor == null) {
try {
- String windowingType = getNativeWindowType(true);
- String windowClassName = null;
+ final String windowingType = getNativeWindowType(true);
+ final String windowClassName;
// We break compile-time dependencies on the AWT here to
// make it easier to run this code on mobile devices
- if (windowingType.equals(TYPE_WINDOWS)) {
+ if (TYPE_WINDOWS == windowingType) {
windowClassName = "jogamp.nativewindow.jawt.windows.WindowsJAWTWindow";
- } else if (windowingType.equals(TYPE_MACOSX)) {
+ } else if (TYPE_MACOSX == windowingType) {
windowClassName = "jogamp.nativewindow.jawt.macosx.MacOSXJAWTWindow";
- } else if (windowingType.equals(TYPE_X11)) {
+ } else if (TYPE_X11 == windowingType) {
// Assume Linux, Solaris, etc. Should probably test for these explicitly.
windowClassName = "jogamp.nativewindow.jawt.x11.X11JAWTWindow";
} else {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index 2377c2be6..f579da217 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -60,7 +60,7 @@ public class JAWTJNILibLoader extends NWJNILibLoader {
// ensure references from jogl_awt shared object
// will succeed since JAWT shared object isn't in
// default library path
- if ( ! NativeWindowFactory.TYPE_MACOSX.equals( NativeWindowFactory.getNativeWindowType(false) ) ) {
+ if ( NativeWindowFactory.TYPE_MACOSX != NativeWindowFactory.getNativeWindowType(false) ) {
try {
loadLibrary("jawt", null, true, JAWTJNILibLoader.class.getClassLoader());
} catch (Throwable t) {