1 /*
2 * Copyright (c) 2013, 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 */
28 import java.awt.Graphics;
29 import java.awt.Graphics2D;
30 import java.awt.Image;
31 import java.awt.Label;
32 import java.awt.Point;
33 import java.awt.TextArea;
34 import java.awt.Toolkit;
35 import java.awt.image.BufferedImage;
36 import java.util.LinkedList;
37 import java.util.List;
38 import javax.swing.JApplet;
39 import jdk.testlibrary.OSInfo;
40 import sun.awt.image.MultiResolutionImage;
41
42 /**
43 * @test
44 * @bug 8028212
45 * @summary [macosx] Custom Cursor HiDPI support
46 * @author Alexander Scherbatiy
47 * @library ../../../../lib/testlibrary
48 * @build jdk.testlibrary.OSInfo
49 * @run applet/manual=yesno MultiResolutionCursorTest.html
50 */
51 public class MultiResolutionCursorTest extends JApplet {
52 //Declare things used in the test, like buttons and labels here
53
54 static final int sizes[] = {16, 32, 128};
55 static final Color colors[] = {Color.WHITE, Color.RED, Color.GREEN, Color.BLUE};
56
57 public void init() {
58 //Create instructions for the user here, as well as set up
59 // the environment -- set the layout manager, add buttons,
60 // etc.
61 this.setLayout(new BorderLayout());
62
63 if (OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
64 String[] instructions = {
65 "Verify that high resolution custom cursor is used"
66 + " on HiDPI displays.",
67 "1) Run the test on Retina display or enable the Quartz Debug"
|
1 /*
2 * Copyright (c) 2013, 2015, 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 */
28 import java.awt.Graphics;
29 import java.awt.Graphics2D;
30 import java.awt.Image;
31 import java.awt.Label;
32 import java.awt.Point;
33 import java.awt.TextArea;
34 import java.awt.Toolkit;
35 import java.awt.image.BufferedImage;
36 import java.util.LinkedList;
37 import java.util.List;
38 import javax.swing.JApplet;
39 import jdk.testlibrary.OSInfo;
40 import sun.awt.image.MultiResolutionImage;
41
42 /**
43 * @test
44 * @bug 8028212
45 * @summary [macosx] Custom Cursor HiDPI support
46 * @author Alexander Scherbatiy
47 * @library ../../../../lib/testlibrary
48 * @modules java.desktop/sun.awt.image
49 * @build jdk.testlibrary.OSInfo
50 * @run applet/manual=yesno MultiResolutionCursorTest.html
51 */
52 public class MultiResolutionCursorTest extends JApplet {
53 //Declare things used in the test, like buttons and labels here
54
55 static final int sizes[] = {16, 32, 128};
56 static final Color colors[] = {Color.WHITE, Color.RED, Color.GREEN, Color.BLUE};
57
58 public void init() {
59 //Create instructions for the user here, as well as set up
60 // the environment -- set the layout manager, add buttons,
61 // etc.
62 this.setLayout(new BorderLayout());
63
64 if (OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
65 String[] instructions = {
66 "Verify that high resolution custom cursor is used"
67 + " on HiDPI displays.",
68 "1) Run the test on Retina display or enable the Quartz Debug"
|