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 */
26 import java.awt.Frame;
27 import java.awt.Graphics;
28 import java.awt.Graphics2D;
29 import java.awt.GraphicsEnvironment;
30 import java.awt.Panel;
31 import java.awt.Rectangle;
32 import java.awt.Robot;
33 import java.awt.SplashScreen;
34 import java.awt.TextField;
35 import java.awt.Window;
36 import java.awt.event.KeyEvent;
37 import java.awt.image.BufferedImage;
38 import java.io.File;
39 import javax.imageio.ImageIO;
40 import sun.java2d.SunGraphics2D;
41
42
43 /**
44 * @test
45 * @key headful
46 * @bug 8043869 8075244 8078082 8145173 8151787
47 * @summary Tests the HiDPI splash screen support for windows and MAC
48 * @modules java.desktop/sun.java2d
49 * @run main MultiResolutionSplashTest GENERATE_IMAGES
50 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_SPLASH 0
51 * @run main/othervm -splash:splash2 MultiResolutionSplashTest TEST_SPLASH 1
52 * @run main/othervm -splash:splash3. MultiResolutionSplashTest TEST_SPLASH 2
53 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_FOCUS
54 */
55 public class MultiResolutionSplashTest {
56
57 private static final int IMAGE_WIDTH = 300;
58 private static final int IMAGE_HEIGHT = 200;
59 private static boolean isMac;
60
61 static {
62 isMac = System.getProperty("os.name").contains("OS X");
63 }
64 private static final ImageInfo[] tests = {
65 new ImageInfo("splash1.png", "splash1@2x.png", Color.BLUE, Color.GREEN),
66 new ImageInfo("splash2", "splash2@2x", Color.WHITE, Color.BLACK),
|
1 /*
2 * Copyright (c) 2014, 2018, 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 */
26 import java.awt.Frame;
27 import java.awt.Graphics;
28 import java.awt.Graphics2D;
29 import java.awt.GraphicsEnvironment;
30 import java.awt.Panel;
31 import java.awt.Rectangle;
32 import java.awt.Robot;
33 import java.awt.SplashScreen;
34 import java.awt.TextField;
35 import java.awt.Window;
36 import java.awt.event.KeyEvent;
37 import java.awt.image.BufferedImage;
38 import java.io.File;
39 import javax.imageio.ImageIO;
40 import sun.java2d.SunGraphics2D;
41
42
43 /**
44 * @test
45 * @key headful
46 * @bug 8043869 8075244 8078082 8145173 8151787 8212213
47 * @summary Tests the HiDPI splash screen support for windows and MAC
48 * @modules java.desktop/sun.java2d
49 * @run main MultiResolutionSplashTest GENERATE_IMAGES
50 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_SPLASH 0
51 * @run main/othervm -splash:splash2 MultiResolutionSplashTest TEST_SPLASH 1
52 * @run main/othervm -splash:splash3. MultiResolutionSplashTest TEST_SPLASH 2
53 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_FOCUS
54 */
55 public class MultiResolutionSplashTest {
56
57 private static final int IMAGE_WIDTH = 300;
58 private static final int IMAGE_HEIGHT = 200;
59 private static boolean isMac;
60
61 static {
62 isMac = System.getProperty("os.name").contains("OS X");
63 }
64 private static final ImageInfo[] tests = {
65 new ImageInfo("splash1.png", "splash1@2x.png", Color.BLUE, Color.GREEN),
66 new ImageInfo("splash2", "splash2@2x", Color.WHITE, Color.BLACK),
|