< prev index next >

test/java/awt/image/multiresolution/MenuMultiresolutionIconTest.java

Print this page

        

@@ -113,17 +113,10 @@
                 popup.show(MenuMultiresolutionIconTest.this, e.getX(), e.getY());
             }
         }
     }
 
-    private static boolean is2x() {
-
-        return GraphicsEnvironment.getLocalGraphicsEnvironment().
-            getDefaultScreenDevice().getDefaultConfiguration().
-            getDefaultTransform().getScaleX() > 1.001;
-    }
-
     private boolean eqColors(Color c1, Color c2) {
 
         int tol = 15;
         return (
             Math.abs(c2.getRed()   - c1.getRed()  ) < tol &&

@@ -131,11 +124,12 @@
             Math.abs(c2.getBlue()  - c1.getBlue() ) < tol);
     }
 
     private void checkIconColor(Point p, String what) {
 
-        Color expected = is2x() ? C2X : C1X;
+        String scale = System.getProperty(SCALE);
+        Color expected = "2".equals(scale) ? C2X : C1X;
         Color c = r.getPixelColor(p.x + SZ / 2, p.y + SZ / 2);
         if (!eqColors(c, expected)) {
             frame.dispose();
             throw new RuntimeException("invalid " + what + "menu item icon " +
                 "color, expected: " + expected + ", got: " + c);

@@ -175,11 +169,8 @@
         frame.dispose();
     }
 
     public static void main(String s[]) throws Exception {
 
-        // TODO: remove is2x() after JDK-8150844 fix
-        if (is2x() == "2".equals(System.getProperty(SCALE))) {
             (new MenuMultiresolutionIconTest()).doTest();
         }
-    }
 }
< prev index next >