Mercurial > hg > Members > riono > TreeVNC_ja_comment
diff src/main/java/jp/ac/u_ryukyu/treevnc/test/IsRetina.java @ 373:b6665f7f18d1
Fix Change Server
author | innparusu |
---|---|
date | Tue, 25 Aug 2015 17:52:05 +0900 |
parents | d393cb629016 |
children | 0aab561a8cf4 |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/test/IsRetina.java Tue Aug 18 18:59:01 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/test/IsRetina.java Tue Aug 25 17:52:05 2015 +0900 @@ -13,22 +13,21 @@ private static boolean isRetina() { //other OS and JVM specific checks... - GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); - final GraphicsDevice device = env.getDefaultScreenDevice(); + GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); + final GraphicsDevice device = env.getDefaultScreenDevice(); - try { - Field field = device.getClass().getDeclaredField("scale"); + try { + Field field = device.getClass().getDeclaredField("scale"); - if (field != null) { - field.setAccessible(true); - Object scale = field.get(device); + if (field != null) { + field.setAccessible(true); + Object scale = field.get(device); - if (scale instanceof Integer && ((Integer)scale).intValue() == 2) { - return true; - } + if (scale instanceof Integer && ((Integer)scale).intValue() == 2) { + return true; } - } catch (Exception ignore) {} - + } + } catch (Exception ignore) {} //... return false; }