From efa70cd39e1a2ac18c3e8660f8d57e4569b19018 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 6 Mar 2012 07:44:29 +0100 Subject: NativeWindow public-spec to public-impl reorg (javax.media.nativewindow. -> com.jogamp.nativewindow.) 2/3 --- src/jogl/classes/jogamp/opengl/awt/AWTUtil.java | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/awt') 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(); } } } -- cgit v1.2.3