diff options
author | Sven Gothel <[email protected]> | 2013-02-22 04:09:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-22 04:09:03 +0100 |
commit | af384debfdf354d98e3d0d0c6e0c5cf5a967904e (patch) | |
tree | 8c8d9cdb4ba104888434a65c6a0b628d3a51a1b5 /src/test | |
parent | cbd8e33f1e19cf0c061c371af6930aba7c36b84f (diff) |
NEWT/OSX Fix: Child positioning ; NewtCanvasAWT: Change reparent time and use actual component size while setting min/pref. size at setup
- NEWT/OSX Fix: Child positioning
- If !Offscreen and has-parent: Gather screen location by traversing through parent
and set native position (was removed w/ commit 7d5c51b635e0795d9b170342bdebe8e7e0bbd01d since still buggy).
- NewtCanvasAWT: Change reparent time and use actual component size while setting min/pref. size at setup
- Analog to AWT GLCanvas
- validates and reparents at reshape(..), paint(..) and update(..)
- reshape(..) also trigers jawtWindow.layoutSurfaceLayer()
-
Diffstat (limited to 'src/test')
5 files changed, 19 insertions, 5 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java index 52fa83b65..d59bc2230 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java @@ -183,6 +183,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase { frameCount = 0; setFrameVisible(top[0], true); Assert.assertTrue("Component didn't become visible", AWTRobotUtil.waitForVisible(glc, true)); + Assert.assertTrue("Component didn't become realized", AWTRobotUtil.waitForRealized(glc, true)); anim.setUpdateFPSFrames(60, null); anim.start(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java index 447c6b94c..aca2b675c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java @@ -40,6 +40,7 @@ import com.jogamp.newt.event.TraceKeyAdapter; import com.jogamp.newt.event.TraceWindowAdapter; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; +import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.QuitAdapter; @@ -179,7 +180,10 @@ public class TestGearsES2AWT extends UITestCase { public void run() { frame.pack(); frame.setVisible(true); - }}); + }}); + Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true)); + Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glCanvas, true)); + animator.start(); Assert.assertTrue(animator.isStarted()); Assert.assertTrue(animator.isAnimating()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java index f98cb240b..ad2165301 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java @@ -73,7 +73,7 @@ import org.junit.AfterClass; import org.junit.Test; public class TestGearsES2NewtCanvasAWT extends UITestCase { - public enum FrameLayout { None, TextOnBottom, BorderBottom, BorderCenter, BorderCenterSurrounded, DoubleBorderCenterSurrounded }; + public enum FrameLayout { None, TextOnBottom, BorderBottom, BorderBottom2, BorderCenter, BorderCenterSurrounded, DoubleBorderCenterSurrounded }; public enum ResizeBy { GLWindow, Component, Frame }; static int screenIdx = 0; @@ -202,6 +202,11 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase { frame.setLayout(new BorderLayout()); frame.add(newtCanvasAWT, BorderLayout.SOUTH); break; + case BorderBottom2: + frame.setLayout(new BorderLayout()); + frame.add(newtCanvasAWT, BorderLayout.SOUTH); + frame.add(new Button("North"), BorderLayout.NORTH); + break; case BorderCenter: frame.setLayout(new BorderLayout()); frame.add(newtCanvasAWT, BorderLayout.CENTER); @@ -287,7 +292,9 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase { } frame.setVisible(true); } - }); + }); + Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true)); + Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true)); animator.setUpdateFPSFrames(60, showFPS ? System.err : null); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java index 5d6218df4..a87cbe0ac 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java @@ -115,7 +115,8 @@ public class TestFocus01SwingAWTRobot extends UITestCase { // Wrap the window in a canvas. final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1); - + // newtCanvasAWT.setShallUseOffscreenLayer(true); + // Monitor AWT focus and keyboard events. AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT"); newtCanvasAWT.addKeyListener(newtCanvasAWTKA); @@ -146,7 +147,7 @@ public class TestFocus01SwingAWTRobot extends UITestCase { frame1.setVisible(true); } } ); Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame1, true)); - Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow1, true)); + Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow1, true)); AWTRobotUtil.clearAWTFocus(robot); Assert.assertTrue(AWTRobotUtil.toFrontAndRequestFocus(robot, frame1)); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java index d6f1f817a..122138f6d 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java @@ -191,6 +191,7 @@ public class TestParentingFocusTraversal01AWT extends UITestCase { frame1.setVisible(true); }}); Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glWindow1, true)); + Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow1, true)); Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent()); AWTRobotUtil.clearAWTFocus(robot); Assert.assertTrue(AWTRobotUtil.toFrontAndRequestFocus(robot, frame1)); |