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 import java.awt.BorderLayout;
24 import java.awt.Color;
25 import java.awt.Cursor;
26 import java.awt.Dialog;
27 import java.awt.Frame;
28 import java.awt.Graphics2D;
29 import java.awt.Image;
30 import java.awt.Label;
31 import java.awt.Point;
32 import java.awt.TextArea;
33 import java.awt.Toolkit;
34 import java.awt.image.BaseMultiResolutionImage;
35 import java.awt.image.BufferedImage;
36 import javax.swing.JApplet;
37 import jdk.testlibrary.OSInfo;
38
39 /**
40 * @test
41 * @bug 8028212
42 * @summary [macosx] Custom Cursor HiDPI support
43 * @author Alexander Scherbatiy
44 * @library ../../../../lib/testlibrary
45 * @modules java.desktop/sun.awt.image
46 * @build jdk.testlibrary.OSInfo
47 * @run applet/manual=yesno MultiResolutionCursorTest.html
48 */
49 public class MultiResolutionCursorTest extends JApplet {
50 //Declare things used in the test, like buttons and labels here
51
52 static final int sizes[] = {8, 16, 32, 128};
53 static final Color colors[] = {Color.WHITE, Color.RED, Color.GREEN, Color.BLUE};
54
55 public void init() {
56 //Create instructions for the user here, as well as set up
57 // the environment -- set the layout manager, add buttons,
58 // etc.
59 this.setLayout(new BorderLayout());
60
61 if (OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
62 String[] instructions = {
63 "Verify that high resolution custom cursor is used"
64 + " on HiDPI displays.",
65 "1) Run the test on Retina display or enable the Quartz Debug"
66 + " and select the screen resolution with (HiDPI) label",
67 "2) Move the cursor to the Test Frame",
68 "3) Check that cursor has red, green or blue color",
69 "If so, press PASS, else press FAIL."
70 };
71 Sysout.createDialogWithInstructions(instructions);
72
73 } else {
74 String[] instructions = {
75 "This test is not applicable to the current platform. Press PASS."
76 };
77 Sysout.createDialogWithInstructions(instructions);
78 }
79 }//End init()
80
81 public void start() {
|
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 import java.awt.BorderLayout;
24 import java.awt.Color;
25 import java.awt.Cursor;
26 import java.awt.Dialog;
27 import java.awt.Frame;
28 import java.awt.Graphics2D;
29 import java.awt.Image;
30 import java.awt.Label;
31 import java.awt.Point;
32 import java.awt.TextArea;
33 import java.awt.Toolkit;
34 import java.awt.image.BaseMultiResolutionImage;
35 import java.awt.image.BufferedImage;
36 import javax.swing.JApplet;
37
38 import jdk.test.lib.Platform;
39
40 /**
41 * @test
42 * @bug 8028212
43 * @summary [macosx] Custom Cursor HiDPI support
44 * @author Alexander Scherbatiy
45 * @library /test/lib
46 * @modules java.desktop/sun.awt.image
47 * @build jdk.test.lib.Platform
48 * @run applet/manual=yesno MultiResolutionCursorTest.html
49 */
50 public class MultiResolutionCursorTest extends JApplet {
51 //Declare things used in the test, like buttons and labels here
52
53 static final int sizes[] = {8, 16, 32, 128};
54 static final Color colors[] = {Color.WHITE, Color.RED, Color.GREEN, Color.BLUE};
55
56 public void init() {
57 //Create instructions for the user here, as well as set up
58 // the environment -- set the layout manager, add buttons,
59 // etc.
60 this.setLayout(new BorderLayout());
61
62 if (Platform.isOSX()) {
63 String[] instructions = {
64 "Verify that high resolution custom cursor is used"
65 + " on HiDPI displays.",
66 "1) Run the test on Retina display or enable the Quartz Debug"
67 + " and select the screen resolution with (HiDPI) label",
68 "2) Move the cursor to the Test Frame",
69 "3) Check that cursor has red, green or blue color",
70 "If so, press PASS, else press FAIL."
71 };
72 Sysout.createDialogWithInstructions(instructions);
73
74 } else {
75 String[] instructions = {
76 "This test is not applicable to the current platform. Press PASS."
77 };
78 Sysout.createDialogWithInstructions(instructions);
79 }
80 }//End init()
81
82 public void start() {
|