1 /*
2 * Copyright (c) 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.Color;
25 import java.awt.Dialog;
26 import java.awt.Frame;
27 import java.awt.Graphics;
28 import java.awt.Graphics2D;
29 import java.awt.Panel;
30 import java.awt.Rectangle;
31 import java.awt.Robot;
32 import java.awt.SplashScreen;
33 import java.awt.TextField;
34 import java.awt.Window;
35 import java.awt.event.KeyEvent;
36 import java.awt.image.BufferedImage;
37 import java.io.File;
38 import javax.imageio.ImageIO;
39 import sun.java2d.SunGraphics2D;
40
41 /**
42 * @test
43 * @bug 8043869 8075244 8078082
44 * @author Alexander Scherbatiy
45 * @summary [macosx] java -splash does not honor 2x hi dpi notation for retina
46 * support
47 * @run main MultiResolutionSplashTest GENERATE_IMAGES
48 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_SPLASH 0
49 * @run main/othervm -splash:splash2 MultiResolutionSplashTest TEST_SPLASH 1
50 * @run main/othervm -splash:splash3. MultiResolutionSplashTest TEST_SPLASH 2
51 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_FOCUS
52 */
53 public class MultiResolutionSplashTest {
54
55 private static final int IMAGE_WIDTH = 300;
56 private static final int IMAGE_HEIGHT = 200;
57
58 private static final ImageInfo[] tests = {
59 new ImageInfo("splash1.png", "splash1@2x.png", Color.BLUE, Color.GREEN),
60 new ImageInfo("splash2", "splash2@2x", Color.WHITE, Color.BLACK),
61 new ImageInfo("splash3.", "splash3@2x.", Color.YELLOW, Color.RED)
62 };
|
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 */
23
24 import java.awt.Color;
25 import java.awt.Dialog;
26 import java.awt.Frame;
27 import java.awt.Graphics;
28 import java.awt.Graphics2D;
29 import java.awt.Panel;
30 import java.awt.Rectangle;
31 import java.awt.Robot;
32 import java.awt.SplashScreen;
33 import java.awt.TextField;
34 import java.awt.Window;
35 import java.awt.event.KeyEvent;
36 import java.awt.image.BufferedImage;
37 import java.io.File;
38 import javax.imageio.ImageIO;
39 import sun.java2d.SunGraphics2D;
40
41 /**
42 * @test
43 * @key headful
44 * @bug 8043869 8075244 8078082
45 * @author Alexander Scherbatiy
46 * @summary [macosx] java -splash does not honor 2x hi dpi notation for retina
47 * support
48 * @run main MultiResolutionSplashTest GENERATE_IMAGES
49 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_SPLASH 0
50 * @run main/othervm -splash:splash2 MultiResolutionSplashTest TEST_SPLASH 1
51 * @run main/othervm -splash:splash3. MultiResolutionSplashTest TEST_SPLASH 2
52 * @run main/othervm -splash:splash1.png MultiResolutionSplashTest TEST_FOCUS
53 */
54 public class MultiResolutionSplashTest {
55
56 private static final int IMAGE_WIDTH = 300;
57 private static final int IMAGE_HEIGHT = 200;
58
59 private static final ImageInfo[] tests = {
60 new ImageInfo("splash1.png", "splash1@2x.png", Color.BLUE, Color.GREEN),
61 new ImageInfo("splash2", "splash2@2x", Color.WHITE, Color.BLACK),
62 new ImageInfo("splash3.", "splash3@2x.", Color.YELLOW, Color.RED)
63 };
|