< prev index next >

test/java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java

Print this page
rev 14836 : 8159690: [TESTBUG] Mark headful tests with @key headful.
   1 /*
   2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.BorderLayout;
  25 import java.awt.Color;
  26 import java.awt.Container;
  27 import java.awt.Point;
  28 import java.awt.Robot;
  29 import java.awt.event.MouseAdapter;
  30 import java.awt.event.MouseEvent;
  31 import javax.swing.JFrame;
  32 import javax.swing.JInternalFrame;
  33 import javax.swing.SwingUtilities;
  34 import test.java.awt.regtesthelpers.Util;
  35 
  36 /**
  37  * AWT/Swing overlapping test with JInternalFrame being put in GlassPane.
  38  * See <a href="https://bugs.openjdk.java.net/browse/JDK-6637655">JDK-6637655</a> and
  39  * <a href="https://bugs.openjdk.java.net/browse/JDK-6985776">JDK-6985776</a>.
  40  * <p>See base class for details.
  41  */
  42 /*
  43 @test
  44 @bug 6637655 6985776
  45 @summary Overlapping test for javax.swing.JScrollPane
  46 @author sergey.grinev@oracle.com: area=awt.mixing
  47 @library ../../regtesthelpers
  48 @modules java.desktop/sun.awt
  49          java.desktop/java.awt.peer
  50 @build Util
  51 @run main JGlassPaneInternalFrameOverlapping

  52  */
  53 public class JGlassPaneInternalFrameOverlapping extends OverlappingTestBase {
  54 
  55     private boolean lwClicked = true;
  56     private Point lLoc;
  57     private Point lLoc2;
  58     private JInternalFrame internalFrame;
  59 
  60     protected boolean performTest() {
  61         try {
  62             SwingUtilities.invokeAndWait(new Runnable() {
  63                 public void run() {
  64                     lLoc = internalFrame.getContentPane().getLocationOnScreen();
  65                     lLoc2 = lLoc.getLocation();
  66                     lLoc2.translate(0, internalFrame.getContentPane().getHeight() + 10);
  67                 }
  68             });
  69         } catch (Exception e) {
  70             e.printStackTrace();
  71             throw new RuntimeException("Where is internal frame?");


   1 /*
   2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.BorderLayout;
  25 import java.awt.Color;
  26 import java.awt.Container;
  27 import java.awt.Point;
  28 import java.awt.Robot;
  29 import java.awt.event.MouseAdapter;
  30 import java.awt.event.MouseEvent;
  31 import javax.swing.JFrame;
  32 import javax.swing.JInternalFrame;
  33 import javax.swing.SwingUtilities;
  34 import test.java.awt.regtesthelpers.Util;
  35 
  36 /**
  37  * AWT/Swing overlapping test with JInternalFrame being put in GlassPane.
  38  * See <a href="https://bugs.openjdk.java.net/browse/JDK-6637655">JDK-6637655</a> and
  39  * <a href="https://bugs.openjdk.java.net/browse/JDK-6985776">JDK-6985776</a>.
  40  * <p>See base class for details.
  41  */
  42 /*
  43  * @test
  44  * @key headful
  45  * @bug 6637655 6985776
  46  * @summary Overlapping test for javax.swing.JScrollPane
  47  * @author sergey.grinev@oracle.com: area=awt.mixing
  48  * @library ../../regtesthelpers
  49  * @modules java.desktop/sun.awt
  50  *          java.desktop/java.awt.peer
  51  * @build Util
  52  * @run main JGlassPaneInternalFrameOverlapping
  53  */
  54 public class JGlassPaneInternalFrameOverlapping extends OverlappingTestBase {
  55 
  56     private boolean lwClicked = true;
  57     private Point lLoc;
  58     private Point lLoc2;
  59     private JInternalFrame internalFrame;
  60 
  61     protected boolean performTest() {
  62         try {
  63             SwingUtilities.invokeAndWait(new Runnable() {
  64                 public void run() {
  65                     lLoc = internalFrame.getContentPane().getLocationOnScreen();
  66                     lLoc2 = lLoc.getLocation();
  67                     lLoc2.translate(0, internalFrame.getContentPane().getHeight() + 10);
  68                 }
  69             });
  70         } catch (Exception e) {
  71             e.printStackTrace();
  72             throw new RuntimeException("Where is internal frame?");


< prev index next >