< prev index next >

test/java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java

Print this page


   1 /*
   2  * Copyright (c) 2014, 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  */


  29 import java.awt.event.InputEvent;
  30 import java.awt.event.MouseAdapter;
  31 import java.awt.event.MouseEvent;
  32 import javax.swing.JFrame;
  33 import javax.swing.JInternalFrame;
  34 import javax.swing.SwingUtilities;
  35 import test.java.awt.regtesthelpers.Util;
  36 
  37 /**
  38  * AWT/Swing overlapping test with JInternalFrame being moved in GlassPane.
  39  * See <a href="https://bugs.openjdk.java.net/browse/JDK-6637655">JDK-6637655</a> and
  40  * <a href="https://bugs.openjdk.java.net/browse/JDK-6981919">JDK-6981919</a>.
  41  * <p>See base class for details.
  42  */
  43 /*
  44 @test
  45 @bug 6637655 6981919
  46 @summary Overlapping test for javax.swing.JScrollPane
  47 @author sergey.grinev@oracle.com: area=awt.mixing
  48 @library ../../regtesthelpers

  49 @build Util
  50 @run main JGlassPaneMoveOverlapping
  51  */
  52 public class JGlassPaneMoveOverlapping extends OverlappingTestBase {
  53 
  54     private boolean lwClicked = true;
  55     private volatile Point lLoc;
  56     private volatile Point lLoc2;
  57 
  58     private JInternalFrame internalFrame;
  59     private JFrame frame = null;
  60     private volatile Point frameLoc;
  61 
  62     protected boolean performTest() {
  63 
  64         try {
  65             SwingUtilities.invokeAndWait(new Runnable() {
  66                 public void run() {
  67                     lLoc = internalFrame.getContentPane().getLocationOnScreen();
  68                     lLoc2 = lLoc.getLocation();


   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  */


  29 import java.awt.event.InputEvent;
  30 import java.awt.event.MouseAdapter;
  31 import java.awt.event.MouseEvent;
  32 import javax.swing.JFrame;
  33 import javax.swing.JInternalFrame;
  34 import javax.swing.SwingUtilities;
  35 import test.java.awt.regtesthelpers.Util;
  36 
  37 /**
  38  * AWT/Swing overlapping test with JInternalFrame being moved in GlassPane.
  39  * See <a href="https://bugs.openjdk.java.net/browse/JDK-6637655">JDK-6637655</a> and
  40  * <a href="https://bugs.openjdk.java.net/browse/JDK-6981919">JDK-6981919</a>.
  41  * <p>See base class for details.
  42  */
  43 /*
  44 @test
  45 @bug 6637655 6981919
  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 @build Util
  51 @run main JGlassPaneMoveOverlapping
  52  */
  53 public class JGlassPaneMoveOverlapping extends OverlappingTestBase {
  54 
  55     private boolean lwClicked = true;
  56     private volatile Point lLoc;
  57     private volatile Point lLoc2;
  58 
  59     private JInternalFrame internalFrame;
  60     private JFrame frame = null;
  61     private volatile Point frameLoc;
  62 
  63     protected boolean performTest() {
  64 
  65         try {
  66             SwingUtilities.invokeAndWait(new Runnable() {
  67                 public void run() {
  68                     lLoc = internalFrame.getContentPane().getLocationOnScreen();
  69                     lLoc2 = lLoc.getLocation();


< prev index next >