diff options
author | Sven Gothel <[email protected]> | 2020-01-13 14:05:11 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-01-13 14:05:11 +0100 |
commit | 2cdf7730b6d3e813a8693087582f3cf3ac44f015 (patch) | |
tree | 897943f55c2112ed011d680124647f66c2675716 | |
parent | a1d9e3d0deaa06a417efac9fcd223db35ec6d255 (diff) |
NewtCanvasSWT Tests: Add NEWTDemoListener giving weight to toolkit independent UI interaction coding
3 files changed, 23 insertions, 2 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 224992c6c..62edee2d4 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -492,7 +492,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo $* #testawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtCanvasAWTDemo $* #testawt com.jogamp.opengl.test.junit.jogl.awt.ManualHiDPIBufferedImage01AWT $* -#testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $* +testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $* #testswt com.jogamp.opengl.test.junit.jogl.demos.es2.swt.TestGearsES2SWT $* # @@ -790,7 +790,7 @@ function testawtswt() { # SWT (testswt) # #testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor01 $* -testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor02NewtGLWindow $* +#testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor02NewtGLWindow $* # testswt com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn $* #testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTJOGLGLCanvas01GLn $* #testswt com.jogamp.opengl.test.junit.jogl.demos.es2.swt.TestGearsES2SWT $* diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java index 00091e486..0cc06160a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java @@ -38,6 +38,7 @@ import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.WindowEvent; import com.jogamp.newt.event.WindowAdapter; import com.jogamp.newt.opengl.GLWindow; +import com.jogamp.newt.opengl.util.NEWTDemoListener; import com.jogamp.newt.swt.NewtCanvasSWT; import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; @@ -194,6 +195,11 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { } } }); + final NEWTDemoListener newtDemoListener = new NEWTDemoListener(glWindow); + newtDemoListener.quitAdapterEnable(false); + glWindow.addKeyListener(newtDemoListener); + glWindow.addMouseListener(newtDemoListener); + glWindow.addWindowListener(newtDemoListener); animator.add(glWindow); animator.start(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java index c373660cf..809a67bfd 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java @@ -73,6 +73,7 @@ import com.jogamp.newt.event.WindowAdapter; import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.event.WindowListener;
import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.newt.opengl.util.NEWTDemoListener;
import com.jogamp.newt.swt.NewtCanvasSWT;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.AnimatorBase;
@@ -336,6 +337,20 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase { };
glWindow1.addKeyListener(kl);
glWindow2.addKeyListener(kl);
+ {
+ final NEWTDemoListener newtDemoListener1 = new NEWTDemoListener(glWindow1);
+ newtDemoListener1.quitAdapterEnable(false);
+ glWindow1.addKeyListener(newtDemoListener1);
+ glWindow1.addMouseListener(newtDemoListener1);
+ glWindow1.addWindowListener(newtDemoListener1);
+ }
+ {
+ final NEWTDemoListener newtDemoListener2 = new NEWTDemoListener(glWindow2);
+ newtDemoListener2.quitAdapterEnable(false);
+ glWindow2.addKeyListener(newtDemoListener2);
+ glWindow2.addMouseListener(newtDemoListener2);
+ glWindow2.addWindowListener(newtDemoListener2);
+ }
}
animator1.start();
|