test/java/awt/image/MultiResolutionImageTest.java

Print this page




  30 import java.io.File;
  31 import java.lang.reflect.Method;
  32 import java.net.URL;
  33 import javax.imageio.ImageIO;
  34 import sun.awt.OSInfo;
  35 import sun.awt.SunHints;
  36 import java.awt.MediaTracker;
  37 import java.awt.geom.AffineTransform;
  38 import java.awt.image.ImageObserver;
  39 import java.util.Arrays;
  40 import java.util.List;
  41 import javax.swing.JPanel;
  42 import sun.awt.SunToolkit;
  43 import sun.awt.image.MultiResolutionImage;
  44 
  45 /**
  46  * @test
  47  * @bug 8011059
  48  * @author Alexander Scherbatiy
  49  * @summary [macosx] Make JDK demos look perfect on retina displays

  50  * @modules java.desktop/sun.awt
  51  *          java.desktop/sun.awt.image

  52  * @run main MultiResolutionImageTest CUSTOM
  53  * @run main MultiResolutionImageTest TOOLKIT_PREPARE
  54  * @run main MultiResolutionImageTest TOOLKIT_LOAD
  55  * @run main MultiResolutionImageTest TOOLKIT
  56  */
  57 public class MultiResolutionImageTest {
  58 
  59     private static final int IMAGE_WIDTH = 300;
  60     private static final int IMAGE_HEIGHT = 200;
  61     private static final Color COLOR_1X = Color.GREEN;
  62     private static final Color COLOR_2X = Color.BLUE;
  63     private static final String IMAGE_NAME_1X = "image.png";
  64     private static final String IMAGE_NAME_2X = "image@2x.png";
  65 
  66     public static void main(String[] args) throws Exception {
  67 
  68         System.out.println("args: " + args.length);
  69 
  70         if (args.length == 0) {
  71             throw new RuntimeException("Not found a test");




  30 import java.io.File;
  31 import java.lang.reflect.Method;
  32 import java.net.URL;
  33 import javax.imageio.ImageIO;
  34 import sun.awt.OSInfo;
  35 import sun.awt.SunHints;
  36 import java.awt.MediaTracker;
  37 import java.awt.geom.AffineTransform;
  38 import java.awt.image.ImageObserver;
  39 import java.util.Arrays;
  40 import java.util.List;
  41 import javax.swing.JPanel;
  42 import sun.awt.SunToolkit;
  43 import sun.awt.image.MultiResolutionImage;
  44 
  45 /**
  46  * @test
  47  * @bug 8011059
  48  * @author Alexander Scherbatiy
  49  * @summary [macosx] Make JDK demos look perfect on retina displays
  50  * @requires (os.family == "mac")
  51  * @modules java.desktop/sun.awt
  52  *          java.desktop/sun.awt.image
  53  *          java.desktop/sun.lwawt.macosx
  54  * @run main MultiResolutionImageTest CUSTOM
  55  * @run main MultiResolutionImageTest TOOLKIT_PREPARE
  56  * @run main MultiResolutionImageTest TOOLKIT_LOAD
  57  * @run main MultiResolutionImageTest TOOLKIT
  58  */
  59 public class MultiResolutionImageTest {
  60 
  61     private static final int IMAGE_WIDTH = 300;
  62     private static final int IMAGE_HEIGHT = 200;
  63     private static final Color COLOR_1X = Color.GREEN;
  64     private static final Color COLOR_2X = Color.BLUE;
  65     private static final String IMAGE_NAME_1X = "image.png";
  66     private static final String IMAGE_NAME_2X = "image@2x.png";
  67 
  68     public static void main(String[] args) throws Exception {
  69 
  70         System.out.println("args: " + args.length);
  71 
  72         if (args.length == 0) {
  73             throw new RuntimeException("Not found a test");