diff options
author | Sven Gothel <[email protected]> | 2012-03-06 07:44:29 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-06 07:44:29 +0100 |
commit | efa70cd39e1a2ac18c3e8660f8d57e4569b19018 (patch) | |
tree | 9737c778ef95017611b0cd4c9435406d84cf90dc /src/jogl/classes/jogamp/opengl/awt/AWTUtil.java | |
parent | 28ca3652c7c3c73cc3c41ad84b3f1efdad98add5 (diff) |
NativeWindow public-spec to public-impl reorg (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 2/3
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/awt/AWTUtil.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/awt/AWTUtil.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java index 51143ab51..e15e538c2 100644 --- a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java +++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java @@ -37,17 +37,15 @@ package jogamp.opengl.awt; -import jogamp.nativewindow.jawt.*; - -import javax.media.opengl.*; - -import java.lang.reflect.*; import java.awt.GraphicsEnvironment; +import java.lang.reflect.Method; + +import javax.media.nativewindow.NativeWindowFactory; +import javax.media.opengl.GLException; public class AWTUtil { // See whether we're running in headless mode private static boolean headlessMode; - private static Class j2dClazz = null; private static Method isOGLPipelineActive = null; private static Method isQueueFlusherThread = null; private static boolean j2dOk = false; @@ -57,7 +55,7 @@ public class AWTUtil { headlessMode = GraphicsEnvironment.isHeadless(); if(!headlessMode) { try { - j2dClazz = Class.forName("jogamp.opengl.awt.Java2D"); + final Class<?> j2dClazz = Class.forName("jogamp.opengl.awt.Java2D"); isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", (Class[])null); isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", (Class[])null); j2dOk = true; @@ -84,12 +82,12 @@ public class AWTUtil { try { if( !((Boolean)isOGLPipelineActive.invoke(null, (Object[])null)).booleanValue() || !((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) { - JAWTUtil.lockToolkit(); + NativeWindowFactory.getAWTToolkitLock().lock(); } } catch (Exception e) { j2dOk=false; } } if(!j2dOk) { - JAWTUtil.lockToolkit(); + NativeWindowFactory.getAWTToolkitLock().lock(); } } @@ -107,12 +105,12 @@ public class AWTUtil { try { if( !((Boolean)isOGLPipelineActive.invoke(null, (Object[])null)).booleanValue() || !((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) { - JAWTUtil.unlockToolkit(); + NativeWindowFactory.getAWTToolkitLock().unlock(); } } catch (Exception e) { j2dOk=false; } } if(!j2dOk) { - JAWTUtil.unlockToolkit(); + NativeWindowFactory.getAWTToolkitLock().unlock(); } } } |