From 60e906330feaac485dfea60734573703a3973e36 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 15 Sep 2015 12:23:27 +0200 Subject: Bug 1211: Refine NEWTDemoListener, JOGLNewtAppletBase - NEWTDemoListener.createPointerIcons(..) - Use Display instance - Simplify PointerIcon creation using a list, skipping all non-found resources. - JOGLNewtAppletBase - Bring back reparent action via key 'r' - Drop redundant PointerIcon, using NEWTDemoListener --- .../opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java | 9 +-------- .../test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java | 5 ++--- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src/test/com') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java index 39e94effc..f08e9a282 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java @@ -33,7 +33,6 @@ import java.lang.reflect.InvocationTargetException; import com.jogamp.junit.util.JunitTracer; import com.jogamp.newt.Display; -import com.jogamp.newt.Display.PointerIcon; import com.jogamp.newt.NewtFactory; import com.jogamp.newt.Screen; import com.jogamp.newt.Window; @@ -182,13 +181,7 @@ public class TestGearsES2NEWT extends UITestCase { } }); - final PointerIcon[] pointerIcons = NEWTDemoListener.createPointerIcons(glWindow); - if( setPointerIcon ) { - glWindow.setPointerIcon(pointerIcons[0]); - System.err.println("Set PointerIcon: "+glWindow.getPointerIcon()); - } - - final NEWTDemoListener newtDemoListener = new NEWTDemoListener(glWindow, pointerIcons); + final NEWTDemoListener newtDemoListener = new NEWTDemoListener(glWindow); newtDemoListener.quitAdapterEnable(true); glWindow.addKeyListener(newtDemoListener); glWindow.addMouseListener(newtDemoListener); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java index 3bf13f063..4fdee82c3 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java @@ -29,7 +29,6 @@ package com.jogamp.opengl.test.junit.newt.parenting; import java.awt.Frame; -import com.jogamp.common.util.InterruptSource; import com.jogamp.nativewindow.CapabilitiesImmutable; import com.jogamp.nativewindow.util.InsetsImmutable; import com.jogamp.newt.Window; @@ -64,7 +63,7 @@ public class NewtAWTReparentingKeyAdapter extends NEWTDemoListener { case KeyEvent.VK_R: e.setConsumed(true); quitAdapterOff(); - new InterruptSource.Thread() { + glWindow.invokeOnNewThread(null, false, new Runnable() { public void run() { final java.lang.Thread t = glWindow.setExclusiveContextThread(null); if(glWindow.getParent()==null) { @@ -95,7 +94,7 @@ public class NewtAWTReparentingKeyAdapter extends NEWTDemoListener { glWindow.requestFocus(); glWindow.setExclusiveContextThread(t); quitAdapterOn(); - } }.start(); + } } ); break; } } -- cgit v1.2.3