# HG changeset patch # User innparusu # Date 1447911810 -32400 # Node ID 0aab561a8cf49860b7fad8552de6a6ae5ae2d5b6 # Parent bbd844c15ab17e210ac7b7a4613acbf01b77a6ff Return retina scale diff -r bbd844c15ab1 -r 0aab561a8cf4 .idea/gradle.xml --- a/.idea/gradle.xml Tue Nov 17 14:02:59 2015 +0900 +++ b/.idea/gradle.xml Thu Nov 19 14:43:30 2015 +0900 @@ -11,11 +11,6 @@ - diff -r bbd844c15ab1 -r 0aab561a8cf4 .idea/workspace.xml --- a/.idea/workspace.xml Tue Nov 17 14:02:59 2015 +0900 +++ b/.idea/workspace.xml Thu Nov 19 14:43:30 2015 +0900 @@ -2,8 +2,8 @@ - - + + @@ -20,6 +20,9 @@ + + + @@ -37,11 +40,11 @@ - + - + @@ -51,7 +54,7 @@ - + @@ -61,7 +64,7 @@ - + @@ -73,7 +76,7 @@ - + @@ -83,7 +86,7 @@ - + @@ -93,7 +96,7 @@ - + @@ -103,8 +106,8 @@ - - + + @@ -113,11 +116,11 @@ - + - + @@ -129,14 +132,9 @@ - - - - - - - - + + + @@ -144,7 +142,7 @@ - + @@ -154,7 +152,7 @@ - + @@ -164,7 +162,7 @@ - + @@ -176,10 +174,9 @@ - - + + - @@ -189,40 +186,38 @@ - + - - - - - - - - - - - - - + - + - - + + + + + + + + + + + + @@ -509,7 +504,6 @@ @@ -574,11 +569,8 @@ - - - @@ -738,6 +730,36 @@ + @@ -914,7 +937,7 @@ - + @@ -971,35 +994,6 @@ - - - - - - @@ -1313,61 +1244,61 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1382,6 +1313,9 @@ + @@ -1398,7 +1332,7 @@ file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java - 879 + 877 @@ -1619,12 +1553,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1725,7 +1749,7 @@ - + @@ -1733,7 +1757,7 @@ - + @@ -1744,14 +1768,14 @@ - + - + @@ -1763,7 +1787,7 @@ - + @@ -1771,137 +1795,71 @@ - + - + - + - + - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - + - - - - - - - - - + - + @@ -1909,21 +1867,21 @@ - + - + - + @@ -1931,7 +1889,7 @@ - + @@ -1939,14 +1897,14 @@ - + - + @@ -1957,7 +1915,7 @@ - + @@ -1965,14 +1923,14 @@ - + - + @@ -1982,21 +1940,14 @@ - + - - - - - - - - + @@ -2004,23 +1955,9 @@ - - - - - - - - - - - - - - - + @@ -2028,7 +1965,7 @@ - + @@ -2036,7 +1973,7 @@ - + @@ -2044,7 +1981,7 @@ - + @@ -2052,7 +1989,7 @@ - + @@ -2060,7 +1997,7 @@ - + @@ -2070,10 +2007,9 @@ - - + + - @@ -2081,7 +2017,7 @@ - + @@ -2091,7 +2027,7 @@ - + @@ -2099,29 +2035,32 @@ - - + + - - - - - - - - + + + - - + + + + + + + + + + @@ -2129,7 +2068,6 @@ diff -r bbd844c15ab1 -r 0aab561a8cf4 src/main/java/jp/ac/u_ryukyu/treevnc/test/IsRetina.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/test/IsRetina.java Tue Nov 17 14:02:59 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/test/IsRetina.java Thu Nov 19 14:43:30 2015 +0900 @@ -8,11 +8,11 @@ * Created by one on 15/08/18. */ public class IsRetina { - public static final boolean isRetina = isRetina(); + public static final int isRetina = getRetinaScale(); - private static boolean isRetina() { + private static int getRetinaScale() { //other OS and JVM specific checks... - + int scale = 1; GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); final GraphicsDevice device = env.getDefaultScreenDevice(); @@ -21,18 +21,19 @@ if (field != null) { field.setAccessible(true); - Object scale = field.get(device); + Object retinaScale = field.get(device); - if (scale instanceof Integer && ((Integer)scale).intValue() == 2) { - return true; + if (retinaScale instanceof Integer) { + scale = ((Integer)retinaScale).intValue(); + return scale; } } } catch (Exception ignore) {} //... - return false; + return scale; } public static void main(String args[]) { - System.out.println(isRetina()); + System.out.println(isRetina); } }