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.Robot;
30 import java.awt.event.InputEvent;
31 import java.awt.event.MouseAdapter;
32 import java.awt.event.MouseEvent;
33 import javax.swing.BorderFactory;
34 import javax.swing.JButton;
35 import javax.swing.JComponent;
36 import javax.swing.JFrame;
37 import javax.swing.JPanel;
38 import javax.swing.JScrollPane;
39 import javax.swing.SwingUtilities;
40 import test.java.awt.regtesthelpers.Util;
41
42 /**
43 * AWT/Swing overlapping test for viewport
44 * <p>This test verify if AWT components are drawn correctly being partially shown through viewport
45 * <p>See <a href="http://monaco.sfbay.sun.com/detail.jsf?cr=6778882">CR6778882</a> for details
46 * <p>See base class for test info.
47 */
48 /*
49 @test
50 @bug 6778882
51 @summary Viewport overlapping test for each AWT component
52 @author sergey.grinev@oracle.com: area=awt.mixing
53 @library /java/awt/patchlib ../../regtesthelpers
54 @modules java.desktop/sun.awt
55 java.desktop/java.awt.peer
56 @build java.desktop/java.awt.Helper
57 @build Util
58 @run main ViewportOverlapping
59 */
60 public class ViewportOverlapping extends OverlappingTestBase {
61
62 private volatile int frameClicked;
63 private Point hLoc;
64 private Point vLoc;
65 private Point testLoc;
66 private Point resizeLoc;
67
68 private JFrame f;
69 private JPanel p;
70 private JButton b;
71 private JScrollPane scrollPane;
72
73 protected void prepareControls() {
74 p = new JPanel(new GridLayout(0, 1));
75 propagateAWTControls(p);
76 b = new JButton("Space extender");
77 p.add(b);
78 p.setPreferredSize(new Dimension(500, 500));
|
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 */
29 import java.awt.Robot;
30 import java.awt.event.InputEvent;
31 import java.awt.event.MouseAdapter;
32 import java.awt.event.MouseEvent;
33 import javax.swing.BorderFactory;
34 import javax.swing.JButton;
35 import javax.swing.JComponent;
36 import javax.swing.JFrame;
37 import javax.swing.JPanel;
38 import javax.swing.JScrollPane;
39 import javax.swing.SwingUtilities;
40 import test.java.awt.regtesthelpers.Util;
41
42 /**
43 * AWT/Swing overlapping test for viewport
44 * <p>This test verify if AWT components are drawn correctly being partially shown through viewport
45 * <p>See <a href="http://monaco.sfbay.sun.com/detail.jsf?cr=6778882">CR6778882</a> for details
46 * <p>See base class for test info.
47 */
48 /*
49 * @test
50 * @key headful
51 * @bug 6778882
52 * @summary Viewport overlapping test for each AWT component
53 * @author sergey.grinev@oracle.com: area=awt.mixing
54 * @library /java/awt/patchlib ../../regtesthelpers
55 * @modules java.desktop/sun.awt
56 * java.desktop/java.awt.peer
57 * @build java.desktop/java.awt.Helper
58 * @build Util
59 * @run main ViewportOverlapping
60 */
61 public class ViewportOverlapping extends OverlappingTestBase {
62
63 private volatile int frameClicked;
64 private Point hLoc;
65 private Point vLoc;
66 private Point testLoc;
67 private Point resizeLoc;
68
69 private JFrame f;
70 private JPanel p;
71 private JButton b;
72 private JScrollPane scrollPane;
73
74 protected void prepareControls() {
75 p = new JPanel(new GridLayout(0, 1));
76 propagateAWTControls(p);
77 b = new JButton("Space extender");
78 p.add(b);
79 p.setPreferredSize(new Dimension(500, 500));
|