summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-01-12 07:27:55 +0100
committerSven Gothel <[email protected]>2014-01-12 07:27:55 +0100
commit071bdd6ce9f8c41ccecdbf8bc74f276ccd7ff651 (patch)
tree796192b477f64056079d05d4ddd0019af7dbdfd8 /src/test/com/jogamp/opengl
parentcf75fbde9f7081bb253eff2bb8f36a39992352e1 (diff)
Bug 937 - JAWTWindow: Unsatisfying Visibility Computation
Simplify JAWTComponentListener's HierarchyListener: - Don't interfere w/ Component's visibility anymore! This shall reduce sideeffects. Utilize 'isShowing' in each Component specialization, i.e. GLCanvas. - On SHOWING_CHANGED if a parent caused a change of the tracked components showing state, propagate it to the offscreen-layer! - Remove all other complicated states! GLCanvas, GLJPanel: - Instead of 'isVisible()' use 'showing state', since only the 'showing state' reflects 'true' visibility throughout the hierarchy. - Add HierarchyListener and track volatile showing state to be used instead of 'isVisible'. Using a cached showing state is more efficient than quering 'isShowing()' all the time! NewtCanvasAWT: - Use 'isShowing()' instead of 'isVisible(), see above
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java92
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java96
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java47
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java6
6 files changed, 149 insertions, 104 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
index 7f861d89b..3790a87f7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
@@ -2,6 +2,7 @@ package com.jogamp.opengl.test.junit.jogl.acore.anim;
import java.awt.BorderLayout;
import java.awt.CardLayout;
+import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@@ -30,55 +31,60 @@ import com.jogamp.opengl.util.FPSAnimator;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
- static final String LABEL = "Label";
+ static final String LABEL = "Label";
static final String CANVAS = "GLCanvas";
-
+
public enum AnimatorControlBehavior {
StartStop, PauseResume, Continue;
}
-
- static long durationPerTest = 200*4; // ms
+
+ static long durationPerTest = 200*4; // ms
static boolean manual = false;
static volatile boolean shouldStop = false;
-
+
private String selected = LABEL;
-
+
@Test
public void testFPSAnimatorStartStop() throws InterruptedException, InvocationTargetException {
testImpl(AnimatorControlBehavior.StartStop, true);
}
-
+
@Test
public void testFPSAnimatorResumePause() throws InterruptedException, InvocationTargetException {
testImpl(AnimatorControlBehavior.PauseResume, true);
}
-
+
@Test
public void testFPSAnimatorContinue() throws InterruptedException, InvocationTargetException {
testImpl(AnimatorControlBehavior.Continue, true);
}
-
+
@Test
public void testAnimatorStartStop() throws InterruptedException, InvocationTargetException {
testImpl(AnimatorControlBehavior.StartStop, false);
}
-
+
@Test
public void testAnimatorResumePause() throws InterruptedException, InvocationTargetException {
testImpl(AnimatorControlBehavior.PauseResume, false);
}
-
+
@Test
public void testAnimatorContinue() throws InterruptedException, InvocationTargetException {
testImpl(AnimatorControlBehavior.Continue, false);
}
-
+
+ private static String id(Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
+ private static String str(Component c) {
+ return id(c)+": "+c.getClass().getSimpleName()+"[visible "+c.isVisible()+", showing "+c.isShowing()+", valid "+c.isValid()+
+ ", displayable "+c.isDisplayable()+", "+c.getX()+"/"+c.getY()+" "+c.getWidth()+"x"+c.getHeight()+"]";
+ }
void testImpl(final AnimatorControlBehavior animCtrl, boolean useFPSAnimator) throws InterruptedException, InvocationTargetException {
- final GLProfile glp = GLProfile.get(GLProfile.GL2);
- final GLCapabilities caps = new GLCapabilities(glp);
- final GLCanvas canvas = new GLCanvas(caps);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2);
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLCanvas canvas = new GLCanvas(caps);
canvas.setPreferredSize(new Dimension(640, 480));
-
+
final GLAnimatorControl animatorCtrl = useFPSAnimator ? new FPSAnimator(canvas, 60) : new Animator(canvas);
animatorCtrl.setUpdateFPSFrames(60, null);// System.err);
switch (animCtrl) {
@@ -95,7 +101,7 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
canvas.addGLEventListener(new GearsES2(1));
/* if(Platform.OS_TYPE == Platform.OSType.WINDOWS) {
canvas.addGLEventListener(new GLEventListener() {
- public void init(GLAutoDrawable drawable) { }
+ public void init(GLAutoDrawable drawable) { }
public void dispose(GLAutoDrawable drawable) { }
public void display(GLAutoDrawable drawable) {
final NativeWindow win = (NativeWindow) drawable.getNativeSurface();
@@ -112,15 +118,17 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
final JFrame frame = new JFrame();
frame.setTitle(getSimpleTestName(" - "));
- frame.addWindowListener(new WindowAdapter() {
+ frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
animatorCtrl.stop();
shouldStop = true;
- }
+ }
});
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-
- final JPanel cards = new JPanel(new CardLayout());
+
+ final JLabel label = new JLabel("A label to cover the canvas");
+
+ final JPanel cards = new JPanel(new CardLayout());
final JPanel comboBoxPanel = new JPanel(); // nicer look ..
final JComboBox comboBox = new JComboBox(new String[] { LABEL, CANVAS });
comboBox.setEditable(false);
@@ -131,7 +139,13 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
if(!newSelection.equals(selected)) {
final String oldSelected = selected;
if(newSelection.equals(CANVAS)) {
- cl.show(cards, CANVAS);
+ System.err.println("XXX Card.SHOW Canvas PRE: ");
+ System.err.println(" CANVAS "+str(canvas));
+ System.err.println(" LABEL "+str(label));
+ cl.show(cards, CANVAS);
+ System.err.println("XXX Card.SHOW Canvas POST: ");
+ System.err.println(" CANVAS "+str(canvas));
+ System.err.println(" LABEL "+str(label));
switch (animCtrl) {
case StartStop:
animatorCtrl.start();
@@ -152,31 +166,37 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
break;
default:
}
- cl.show(cards, LABEL);
+ System.err.println("XXX Card.SHOW Label PRE: ");
+ System.err.println(" CANVAS "+str(canvas));
+ System.err.println(" LABEL "+str(label));
+ cl.show(cards, LABEL);
+ System.err.println("XXX Card.SHOW Label POST: ");
+ System.err.println(" CANVAS "+str(canvas));
+ System.err.println(" LABEL "+str(label));
selected = LABEL;
} else {
throw new RuntimeException("oops .. unexpected item: "+evt);
}
- System.err.println("Item Change: "+oldSelected+" -> "+selected+", "+animatorCtrl);
+ System.err.println("Item Change: "+oldSelected+" -> "+selected+", "+animatorCtrl);
} else {
System.err.println("Item Stays: "+selected+", "+animatorCtrl);
}
}
});
- comboBoxPanel.add(comboBox);
+ comboBoxPanel.add(comboBox);
- cards.add(new JLabel("A label to cover the canvas"), LABEL);
+ cards.add(label, LABEL);
cards.add(canvas, CANVAS);
-
+
frame.add(comboBoxPanel, BorderLayout.PAGE_START);
frame.add(cards, BorderLayout.CENTER);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- frame.pack();
+ frame.pack();
frame.setVisible(true);
}});
-
+
if(manual) {
for(long w=durationPerTest; !shouldStop && w>0; w-=100) {
Thread.sleep(100);
@@ -187,34 +207,34 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
comboBox.setSelectedItem(LABEL);
}});
Thread.sleep(durationPerTest/4);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
comboBox.setSelectedItem(CANVAS);
}});
Thread.sleep(durationPerTest/4);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
comboBox.setSelectedItem(LABEL);
}});
Thread.sleep(durationPerTest/4);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
comboBox.setSelectedItem(CANVAS);
}});
Thread.sleep(durationPerTest/4);
}
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setVisible(false);
frame.dispose();
}});
-
+
}
-
+
public static void main(String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
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 91da73e67..2a0bbfeb8 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
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import java.awt.AWTException;
@@ -83,9 +83,9 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
@AfterClass
public static void releaseClass() {
}
-
- protected JPanel create(final JFrame[] top, final int width, final int height, final int num)
- throws InterruptedException, InvocationTargetException
+
+ protected JPanel create(final JFrame[] top, final int width, final int height, final int num)
+ throws InterruptedException, InvocationTargetException
{
final JPanel[] jPanel = new JPanel[] { null };
SwingUtilities.invokeAndWait(new Runnable() {
@@ -98,55 +98,55 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.getContentPane().add(jPanel[0]);
jFrame1.setSize(width, height);
-
+
top[0] = jFrame1;
} } );
- return jPanel[0];
+ return jPanel[0];
}
- protected void add(final Container cont, final Component comp, final JFrame jFrame)
- throws InterruptedException, InvocationTargetException
+ protected void add(final Container cont, final Component comp, final JFrame jFrame)
+ throws InterruptedException, InvocationTargetException
{
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- cont.add(comp, BorderLayout.CENTER);
+ cont.add(comp, BorderLayout.CENTER);
jFrame.pack();
jFrame.validate();
} } );
}
-
- protected void dispose(final GLCanvas glc)
- throws InterruptedException, InvocationTargetException
+
+ protected void dispose(final GLCanvas glc)
+ throws InterruptedException, InvocationTargetException
{
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- glc.destroy();
+ glc.destroy();
} } );
}
-
+
protected void setFrameVisible(final JFrame jFrame, final boolean visible) throws InterruptedException, InvocationTargetException {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
jFrame.setVisible(visible);
- } } ) ;
+ } } ) ;
}
-
+
protected void setComponentVisible(final Component comp, final boolean visible) throws InterruptedException, InvocationTargetException {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
comp.setVisible(visible);
- } } ) ;
+ } } ) ;
}
-
+
protected void dispose(final JFrame jFrame) throws InterruptedException, InvocationTargetException {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
jFrame.dispose();
- } } ) ;
+ } } ) ;
}
-
+
private volatile int frameCount = 0;
-
+
protected void runTestGL(boolean onscreen, GLCapabilities caps)
throws AWTException, InterruptedException, InvocationTargetException
{
@@ -178,52 +178,52 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
final GearsES2 gears = new GearsES2(1);
gears.setVerbose(false);
glc.addGLEventListener(gears);
-
+
final JFrame[] top = new JFrame[] { null };
final Container glcCont = create(top, width, height, i);
add(glcCont, glc, top[0]);
-
+
+ System.err.println("XXXX Visible Part 1/3");
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.setUpdateFPSFrames(60, System.err);
anim.start();
anim.resetFPSCounter();
- System.err.println("Visible Part 1/3");
-
+
while( anim.getTotalFPSDuration() < durationPerTest ) {
Thread.sleep(60);
- }
-
+ }
+
+ System.err.println("XXXXX Invisible Part 2/3");
setComponentVisible(glc, false);
- Assert.assertTrue("Component didn't become invisible", AWTRobotUtil.waitForVisible(glc, false));
+ Assert.assertTrue("Component didn't become invisible", AWTRobotUtil.waitForVisible(glc, false));
final int frameCountT0 = frameCount;
anim.resetFPSCounter();
- System.err.println("Invisible Part 2/3");
-
+
while( anim.getTotalFPSDuration() < durationPerTest ) {
Thread.sleep(60);
}
-
- final int frameCountT1 = frameCount;
+
+ final int frameCountT1 = frameCount;
System.err.println("GLCanvas invisible frame count: Before "+frameCountT0+", after "+frameCountT1);
- Assert.assertTrue("GLCanvas rendered more that 4 times while being invisible, before "+frameCountT0+", after "+frameCountT1,
+ Assert.assertTrue("GLCanvas rendered more that 4 times while being invisible, before "+frameCountT0+", after "+frameCountT1,
4 >= frameCountT1 - frameCountT0);
-
+
+ System.err.println("XXXX Visible Part 3/3");
setComponentVisible(glc, true);
Assert.assertTrue("Component didn't become visible", AWTRobotUtil.waitForVisible(glc, true));
anim.resetFPSCounter();
- System.err.println("Visible Part 3/3");
-
+
while( anim.getTotalFPSDuration() < durationPerTest ) {
Thread.sleep(60);
}
-
+
System.err.println("GLCanvas isOffscreenLayerSurfaceEnabled: "+glc.isOffscreenLayerSurfaceEnabled()+": "+glc.getChosenGLCapabilities());
-
- dispose(top[0]);
+
+ dispose(top[0]);
}
}
@@ -258,7 +258,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
}
runTestGL(false, caps);
}
-
+
public static void main(String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -272,10 +272,10 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
shallUseOffscreenPBufferLayer = true;
} else if(args[i].equals("-wait")) {
waitForKey = true;
- }
+ }
}
System.err.println("waitForKey "+waitForKey);
-
+
System.err.println("shallUseOffscreenFBOLayer "+shallUseOffscreenFBOLayer);
System.err.println("shallUseOffscreenPBufferLayer "+shallUseOffscreenPBufferLayer);
if(waitForKey) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
index f28a034dd..84af232d4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
@@ -34,6 +34,7 @@ import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
+import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
@@ -63,7 +64,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
- static long durationPerTest = 500*4; // ms
+ static long durationPerTest = 500*6; // ms
static boolean manual = false;
@Test
@@ -72,6 +73,7 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
final JPanel panel1 = new javax.swing.JPanel();
final JPanel panel2 = new javax.swing.JPanel();
+ final JPanel panel3 = new javax.swing.JPanel();
panel1.setLayout(new BorderLayout());
panel2.setLayout(new BorderLayout());
@@ -82,23 +84,29 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
glCanvas.setSize(new java.awt.Dimension(640, 480));
glCanvas.addGLEventListener(new GearsES2(1));
panel1.add(glCanvas, BorderLayout.CENTER);
+ panel3.add(new JLabel("A label to cover the canvas"), BorderLayout.CENTER);
final JTabbedPane tabbedPanel = new JTabbedPane();
- tabbedPanel.addTab("tab1", panel1);
- tabbedPanel.addTab("tab2", panel2);
+ tabbedPanel.addTab("tab1", panel1); // glcanvas
+ tabbedPanel.addTab("tab2", panel2); // glcanvas
+ tabbedPanel.addTab("tab3", panel3); // text
tabbedPanel.addChangeListener(new javax.swing.event.ChangeListener() {
@Override
public void stateChanged(javax.swing.event.ChangeEvent evt) {
if (tabbedPanel.getSelectedIndex() == 0) {
+ System.err.println("XXXX Add GLCanvas Panel2("+id(panel2)+" -> Panel1("+id(panel1)+") START");
dumpGLCanvasStats(glCanvas);
panel1.add(glCanvas, BorderLayout.CENTER);
dumpGLCanvasStats(glCanvas);
- } else {
+ } else if (tabbedPanel.getSelectedIndex() == 1) {
System.err.println("XXXX Add GLCanvas Panel1("+id(panel1)+" -> Panel2("+id(panel2)+") START");
dumpGLCanvasStats(glCanvas);
panel2.add(glCanvas, BorderLayout.CENTER);
dumpGLCanvasStats(glCanvas);
+ } else {
+ System.err.println("XXXX NOP");
+ dumpGLCanvasStats(glCanvas);
}
}
});
@@ -119,33 +127,44 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
Thread.sleep(100);
}
} else {
+ Thread.sleep(durationPerTest/6);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- System.err.println("XXXX Add GLCanvas Panel2("+id(panel2)+") -> Panel1("+id(panel1)+" START");
- tabbedPanel.setSelectedIndex(0);
+ System.err.println("XXXX Panel1("+id(panel1)+" -> Panel2("+id(panel2)+") START");
+ tabbedPanel.setSelectedIndex(1);
}});
- Thread.sleep(durationPerTest/4);
+ Thread.sleep(durationPerTest/6);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- System.err.println("XXXX Add GLCanvas Panel1("+id(panel1)+" -> Panel2("+id(panel2)+") START");
- tabbedPanel.setSelectedIndex(1);
+ System.err.println("XXXX Panel2("+id(panel2)+") -> Panel3("+id(panel3)+" START");
+ tabbedPanel.setSelectedIndex(2);
}});
- Thread.sleep(durationPerTest/4);
+ Thread.sleep(durationPerTest/6);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- System.err.println("XXXX Add GLCanvas Panel2("+id(panel2)+") -> Panel1("+id(panel1)+" START");
+ System.err.println("XXXX Panel3("+id(panel3)+") -> Panel1("+id(panel1)+" START");
tabbedPanel.setSelectedIndex(0);
}});
- Thread.sleep(durationPerTest/4);
+ // one loop done
+
+ Thread.sleep(durationPerTest/6);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- System.err.println("XXXX Add GLCanvas Panel1("+id(panel1)+" -> Panel2("+id(panel2)+") START");
+ System.err.println("XXXX Panel1("+id(panel1)+" -> Panel2("+id(panel2)+") START");
tabbedPanel.setSelectedIndex(1);
}});
- Thread.sleep(durationPerTest/4);
+
+ Thread.sleep(durationPerTest/6);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ System.err.println("XXXX Panel2("+id(panel2)+") -> Panel1("+id(panel1)+" START");
+ tabbedPanel.setSelectedIndex(0);
+ }});
+
+ Thread.sleep(durationPerTest/6);
}
SwingUtilities.invokeLater(new Runnable() {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
index e1a0944e1..29dc9a190 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
@@ -95,8 +95,10 @@ public class TestBug816OSXCALayerPos03aB729AWT extends UITestCase {
final Checkbox checkbox = new Checkbox("Visible canvas", true);
checkbox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ev) {
- glCanvas1.setVisible(checkbox.getState());
- System.out.println("Canvas visible: "+glCanvas1.isVisible());
+ final boolean visible = checkbox.getState();
+ System.err.println("XXXX Canvas setVisible "+visible);
+ glCanvas1.setVisible(visible);
+ System.err.println("XXXX Canvas visible: "+glCanvas1.isVisible());
if( glCanvas1.isVisible() ) {
frame.validate(); // take care of resized frame while hidden
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
index b9ee6a4f6..3e60c8b47 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
@@ -101,8 +101,10 @@ public class TestBug816OSXCALayerPos03bB849AWT extends UITestCase {
final Checkbox checkbox = new Checkbox("Visible canvas", true);
checkbox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ev) {
- panel.setVisible(checkbox.getState());
- System.out.println("Visible: [panel "+panel.isVisible()+", canvas "+glCanvas1.isVisible()+"]; Displayable: [panel "+panel.isDisplayable()+", canvas "+glCanvas1.isDisplayable()+"]");
+ final boolean visible = checkbox.getState();
+ System.err.println("XXXX Panel setVisible "+visible);
+ panel.setVisible(visible);
+ System.err.println("XXXX Visible: [panel "+panel.isVisible()+", canvas "+glCanvas1.isVisible()+"]; Displayable: [panel "+panel.isDisplayable()+", canvas "+glCanvas1.isDisplayable()+"]");
if( panel.isVisible() ) {
frame.validate(); // take care of resized frame while hidden
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
index 9a536d50c..24f9de961 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
@@ -103,8 +103,10 @@ public class TestBug816OSXCALayerPos03cB849AWT extends UITestCase {
final JCheckBox checkbox = new JCheckBox("Visible canvas", true);
checkbox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ev) {
- panel.setVisible(checkbox.getSelectedObjects()!=null);
- System.out.println("Visible: [panel "+panel.isVisible()+", canvas "+glCanvas1.isVisible()+"]; Displayable: [panel "+panel.isDisplayable()+", canvas "+glCanvas1.isDisplayable()+"]");
+ final boolean visible = checkbox.getSelectedObjects()!=null;
+ System.err.println("XXXX Panel setVisible "+visible);
+ panel.setVisible(visible);
+ System.err.println("XXXX Visible: [panel "+panel.isVisible()+", canvas "+glCanvas1.isVisible()+"]; Displayable: [panel "+panel.isDisplayable()+", canvas "+glCanvas1.isDisplayable()+"]");
if( panel.isVisible() ) {
frame.validate(); // take care of resized frame while hidden
}