/**
     * Returns the "device pixel ratio" for the current display. A return value 
     * higher than 1.0 indicates a "retina" or "HiDPI" screen.
     * @deprecated This method relies on Apple-specific AWT properties, which
     *             remain from the old Apple JDK but will be removed from the
     *             JDK in Java 9.
     */
@Deprecated
    public static float getScreenPixelRatio() {
        //TODO replace with API from Java 9 once that is released
        if (Platform.isMac()) {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Object contentScaleFactor = toolkit.getDesktopProperty("apple.awt.contentScaleFactor");
            if (contentScaleFactor instanceof Number) {
                return ((Number) contentScaleFactor).floatValue();
            } else {
                return 1.0f;
            }
        } else {
            return 1.0f;
        }
    }
@Deprecated
public static float getScreenPixelRatio() {
//TODO replace with API from Java 9 once that is released
if (Platform.isMac()) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Object contentScaleFactor = toolkit.getDesktopProperty("apple.awt.contentScaleFactor");
if (contentScaleFactor instanceof Number) {
return ((Number) contentScaleFactor).floatValue();
} else {
return 1.0f;
}
} else {
return 1.0f;
}
}
@Deprecated
public static float getScreenPixelRatio() {
//TODO replace with API from Java 9 once that is released
if (Platform.isMac()) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Object contentScaleFactor = toolkit.getDesktopProperty("apple.awt.contentScaleFactor");
if (contentScaleFactor instanceof Number) {
return ((Number) contentScaleFactor).floatValue();
} else {
return 1.0f;
}
} else {
return 1.0f;
}
}
@Deprecated
public static float getScreenPixelRatio() {
//TODO replace with API from Java 9 once that is released
if (Platform.isMac()) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
Object contentScaleFactor = toolkit.getDesktopProperty("apple.awt.contentScaleFactor");
if (contentScaleFactor instanceof Number) {
return ((Number) contentScaleFactor).floatValue();
} else {
return 1.0f;
}
} else {
return 1.0f;
}
}