From 9997ce1f19accc2ef6b8568b5e3ba877710bef01 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 9 Oct 2013 05:29:08 +0200 Subject: NewtCanvasAWT Focus Traversal: Remove AWT's requestFocus*() overrides in favor of FocusPropertyChangeListener requestFocusNEWTChild() The AWT's requestFocus*() overrides were intended to receive the AWT focus (default) and clear it afterwards to forward the focus to the NEWT component -> requestFocusNEWTChild(). This can be achieved simply by using our FocusPropertyChangeListener and invoking requestFocusNEWTChild() when receiving the focus on the NewtCanvasAWT component. --- .../test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/com') 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 693dd1448..ff540408a 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 @@ -249,7 +249,7 @@ public class TestParentingFocusTraversal01AWT extends UITestCase { Assert.assertEquals(true, glWindow1FA.focusLost()); Thread.sleep(durationPerTest/numFocus); - // direct AWT request focus + System.err.println("Test: Direct NewtCanvasAWT focus"); try { java.awt.EventQueue.invokeAndWait(new Runnable() { public void run() { @@ -262,7 +262,7 @@ public class TestParentingFocusTraversal01AWT extends UITestCase { Assert.assertEquals(true, bWestFA.focusLost()); Thread.sleep(durationPerTest/numFocus); - // direct AWT request focus + System.err.println("Test: Direct AWT Button-West focus"); try { java.awt.EventQueue.invokeAndWait(new Runnable() { public void run() { @@ -275,7 +275,7 @@ public class TestParentingFocusTraversal01AWT extends UITestCase { Assert.assertEquals(true, glWindow1FA.focusLost()); Thread.sleep(durationPerTest/numFocus); - // direct NEWT request focus + System.err.println("Test: Direct NEWT-Child request focus"); glWindow1.requestFocus(); Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA)); Assert.assertEquals(true, glWindow1FA.focusGained()); -- cgit v1.2.3