1 /*
2 * Copyright (c) 2010, 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 */
23
24 import java.awt.*;
25 import java.awt.event.WindowAdapter;
26 import java.awt.event.WindowEvent;
27 import java.awt.event.WindowFocusListener;
28 import java.awt.geom.Area;
29 import java.awt.geom.GeneralPath;
30 import java.awt.geom.Rectangle2D;
31 import java.util.HashMap;
32
33 /*
34 * @test
35 * @bug 8013450
36 * @summary Check if the window events (Focus and Activation) are triggered correctly
37 * when clicked on visible and clipped areas.
38 *
39 * Test Description: Check if PERPIXEL_TRANSPARENT Translucency type is supported
40 * by the current platform. Proceed if it is supported. Apply different
41 * types of shapes on a Window. Make it appear with a known background.
42 * Check if mouse events which result in window-activated events are
43 * triggered only within the window's shape and not outside. Repeat this
44 * for Window, Dialog and Frame.
45 * Expected Result: If PERPIXEL_TRANSPARENT Translucency type is supported, window should
46 * gain focus and should trigger activated events only when it is clicked on the
47 * visible areas. Events should be delivered to the background window if clicked
48 * on the clipped areas.
49 *
50 * @author mrkam
51 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
52 * @library ../../../../lib/testlibrary
53 * @build Common ExtendedRobot
54 * @run main FocusAWTTest
|
1 /*
2 * Copyright (c) 2010, 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.*;
25 import java.awt.event.WindowAdapter;
26 import java.awt.event.WindowEvent;
27 import java.awt.event.WindowFocusListener;
28 import java.awt.geom.Area;
29 import java.awt.geom.GeneralPath;
30 import java.awt.geom.Rectangle2D;
31 import java.util.HashMap;
32
33 /*
34 * @test
35 * @key headful
36 * @bug 8013450
37 * @summary Check if the window events (Focus and Activation) are triggered correctly
38 * when clicked on visible and clipped areas.
39 *
40 * Test Description: Check if PERPIXEL_TRANSPARENT Translucency type is supported
41 * by the current platform. Proceed if it is supported. Apply different
42 * types of shapes on a Window. Make it appear with a known background.
43 * Check if mouse events which result in window-activated events are
44 * triggered only within the window's shape and not outside. Repeat this
45 * for Window, Dialog and Frame.
46 * Expected Result: If PERPIXEL_TRANSPARENT Translucency type is supported, window should
47 * gain focus and should trigger activated events only when it is clicked on the
48 * visible areas. Events should be delivered to the background window if clicked
49 * on the clipped areas.
50 *
51 * @author mrkam
52 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
53 * @library ../../../../lib/testlibrary
54 * @build Common ExtendedRobot
55 * @run main FocusAWTTest
|