equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 |
24 |
25 import com.sun.awt.AWTUtilities; |
|
26 import java.awt.Frame; |
25 import java.awt.Frame; |
27 import java.awt.Panel; |
26 import java.awt.Panel; |
28 import java.awt.Point; |
27 import java.awt.Point; |
29 import java.awt.Rectangle; |
28 import java.awt.Rectangle; |
30 import java.awt.Robot; |
29 import java.awt.Robot; |
42 * <p>See base class for test info. |
41 * <p>See base class for test info. |
43 */ |
42 */ |
44 /* |
43 /* |
45 * @test |
44 * @test |
46 * @key headful |
45 * @key headful |
47 * @bug 6776743 |
46 * @bug 6776743 8173409 |
48 * @summary Opaque overlapping test for each AWT component |
47 * @summary Opaque overlapping test for each AWT component |
49 * @library /java/awt/patchlib ../../regtesthelpers |
48 * @library /java/awt/patchlib ../../regtesthelpers |
50 * @modules java.desktop/com.sun.awt |
49 * @modules java.desktop/java.awt.peer |
51 * java.desktop/java.awt.peer |
|
52 * java.desktop/sun.awt |
50 * java.desktop/sun.awt |
53 * @build java.desktop/java.awt.Helper |
51 * @build java.desktop/java.awt.Helper |
54 * @build Util |
52 * @build Util |
55 * @run main OpaqueOverlapping |
53 * @run main OpaqueOverlapping |
56 */ |
54 */ |
132 // Now perform the click at this point for 9 times |
130 // Now perform the click at this point for 9 times |
133 // In the middle of the process toggle the opaque |
131 // In the middle of the process toggle the opaque |
134 // flag value. |
132 // flag value. |
135 for (int i = 0; i < 9; ++i) { |
133 for (int i = 0; i < 9; ++i) { |
136 if (i == 3) { |
134 if (i == 3) { |
137 AWTUtilities.setComponentMixingCutoutShape(light, |
135 light.setMixingCutoutShape(new Rectangle()); |
138 new Rectangle()); |
|
139 } |
136 } |
140 if (i == 6) { |
137 if (i == 6) { |
141 AWTUtilities.setComponentMixingCutoutShape(light, |
138 light.setMixingCutoutShape(null); |
142 null); |
|
143 } |
139 } |
144 |
140 |
145 robot.mousePress(InputEvent.BUTTON1_MASK); |
141 robot.mousePress(InputEvent.BUTTON1_MASK); |
146 robot.mouseRelease(InputEvent.BUTTON1_MASK); |
142 robot.mouseRelease(InputEvent.BUTTON1_MASK); |
147 Util.waitForIdle(robot); |
143 Util.waitForIdle(robot); |