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 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
39 * @library ../../../../lib/testlibrary
40 * @build Common ExtendedRobot
41 * @run main FocusAWTTest
42 */
43
44 public class FocusAWTTest extends Common {
45
46 ExtendedRobot robot;
47 int dx;
48 int dy;
49 static final int x = 20;
50 static final int y = 400;
51
52 static volatile HashMap<String, Boolean> flags = new HashMap<String, Boolean>();
53 static {
54 flags.put("backgroundWindowActivated", false);
|
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 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
40 * @library ../../../../lib/testlibrary
41 * @build Common ExtendedRobot
42 * @run main FocusAWTTest
43 */
44
45 public class FocusAWTTest extends Common {
46
47 ExtendedRobot robot;
48 int dx;
49 int dy;
50 static final int x = 20;
51 static final int y = 400;
52
53 static volatile HashMap<String, Boolean> flags = new HashMap<String, Boolean>();
54 static {
55 flags.put("backgroundWindowActivated", false);
|