1 /*
2 * Copyright (c) 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 */
23
24 import sun.awt.image.MultiResolutionToolkitImage;
25 import sun.java2d.SunGraphics2D;
26
27 import javax.swing.*;
28 import java.awt.*;
29 import java.awt.image.BufferedImage;
30
31 import static java.awt.event.InputEvent.BUTTON1_DOWN_MASK;
32
33 /**
34 * @test
35 * @bug 8076106
36 * @author Hendrik Schreiber
37 * @summary [macosx] Drag image of TransferHandler does not honor
38 * MultiResolutionImage
39 * @run main MultiResolutionDragImageTest TEST_DRAG
40 */
41 public class MultiResolutionDragImageTest {
42
43 private static final Color COLOR_1X = Color.BLUE;
44 private static final Color COLOR_2X = Color.RED;
45 private static JFrame frame;
46 private static JTextField field;
47 private static Point p;
48
49 public static void main(String[] args) throws Exception {
50
51 final String test = args[0];
52
53 switch (test) {
54 case "TEST_DRAG":
|
1 /*
2 * Copyright (c) 2015, 2017, 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 sun.awt.image.MultiResolutionToolkitImage;
25 import sun.java2d.SunGraphics2D;
26
27 import javax.swing.*;
28 import java.awt.*;
29 import java.awt.image.BufferedImage;
30
31 import static java.awt.event.InputEvent.BUTTON1_DOWN_MASK;
32
33 /**
34 * @test
35 * @key headful
36 * @bug 8076106
37 * @author Hendrik Schreiber
38 * @summary [macosx] Drag image of TransferHandler does not honor
39 * MultiResolutionImage
40 * @run main MultiResolutionDragImageTest TEST_DRAG
41 */
42 public class MultiResolutionDragImageTest {
43
44 private static final Color COLOR_1X = Color.BLUE;
45 private static final Color COLOR_2X = Color.RED;
46 private static JFrame frame;
47 private static JTextField field;
48 private static Point p;
49
50 public static void main(String[] args) throws Exception {
51
52 final String test = args[0];
53
54 switch (test) {
55 case "TEST_DRAG":
|