From 2cdf7730b6d3e813a8693087582f3cf3ac44f015 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 13 Jan 2020 14:05:11 +0100 Subject: NewtCanvasSWT Tests: Add NEWTDemoListener giving weight to toolkit independent UI interaction coding --- .../jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java | 6 ++++++ .../jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java | 15 +++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'src/test/com/jogamp') 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(); -- cgit v1.2.3