Index: getdown/lib/FJVL_VERSION =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/lib/FJVL_VERSION (.../FJVL_VERSION) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/lib/FJVL_VERSION (.../FJVL_VERSION) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -1 +1 @@ -1.8.3-1.2.4_FJVL +1.8.3-1.2.5_FJVL Index: getdown/lib/JVL_VERSION =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/lib/JVL_VERSION (.../JVL_VERSION) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/lib/JVL_VERSION (.../JVL_VERSION) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -1 +1 @@ -1.8.3-1.2.4_JVL +1.8.3-1.2.5_JVL Index: getdown/lib/getdown-core.jar =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 Binary files differ Index: getdown/lib/getdown-launcher-local.jar =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 Binary files differ Index: getdown/lib/getdown-launcher.jar =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 Binary files differ Index: getdown/src/getdown/ant/pom.xml =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/src/getdown/ant/pom.xml (.../pom.xml) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/src/getdown/ant/pom.xml (.../pom.xml) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.2.4_FJVL + 1.8.3-1.2.5_FJVL getdown-ant Index: getdown/src/getdown/core/pom.xml =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/src/getdown/core/pom.xml (.../pom.xml) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/src/getdown/core/pom.xml (.../pom.xml) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.2.4_FJVL + 1.8.3-1.2.5_FJVL getdown-core Index: getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java =================================================================== diff -u -N -r3fade83499e769d08529a9da301b64af33795610 -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java (.../Application.java) (revision 3fade83499e769d08529a9da301b64af33795610) +++ getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java (.../Application.java) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -27,6 +27,7 @@ import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; +import jalview.bin.HiDPISetting; import jalview.bin.MemorySetting; //import com.install4j.api.launcher.Variables; @@ -1071,6 +1072,13 @@ args.add("-Dinstaller_template_version=" + System.getProperty("installer_template_version")); args.add("-Dlauncher_version=" + Build.version()); + // set HiDPI property if wanted + String scalePropertyArg = HiDPISetting.getScalePropertyArg(); + if (scalePropertyArg != null) + { + args.add(scalePropertyArg); + } + // set the native library path if we have native resources // @TODO optional getdown.txt parameter to set addCurrentLibraryPath to true or false? ClassPath javaLibPath = PathBuilder.buildLibsPath(this, true); Index: getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java =================================================================== diff -u -N --- getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java (revision 0) +++ getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -0,0 +1,48 @@ +package jalview.bin; + +import java.awt.Toolkit; + +public class HiDPISetting +{ + public static final int dpi; + + public static final int scale; + + private static final int hidpi = 110; + + private static final String scaleProperty = "sun.java2d.uiScale"; + + private static final boolean isAMac = System.getProperty("os.name") + .indexOf("Mac") > -1; + + private static final boolean isLinux = System.getProperty("os.name") + .toLowerCase().indexOf("linux") > -1; + + private static final boolean isWindows = System.getProperty("os.name") + .toLowerCase().indexOf("windows") > -1; + + static + { + dpi = Toolkit.getDefaultToolkit().getScreenResolution(); + scale = dpi / hidpi + 1; + if (scale > 1 && isLinux) + { + System.out.println("DPI detected as " + dpi + + ". Scaling factor set to " + scale + "."); + } + } + + public static String getScalePropertyArg() + { + // HiDPI setting. Just looking at Linux to start with. Test with Windows. + if (!isLinux) + { + return null; + } + if (scale > 1) + { + return "-D" + scaleProperty + "=" + scale; + } + return null; + } +} Index: getdown/src/getdown/launcher/pom.xml =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/src/getdown/launcher/pom.xml (.../pom.xml) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/src/getdown/launcher/pom.xml (.../pom.xml) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.2.4_FJVL + 1.8.3-1.2.5_FJVL getdown-launcher Index: getdown/src/getdown/mvn_cmd =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/src/getdown/mvn_cmd (.../mvn_cmd) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/src/getdown/mvn_cmd (.../mvn_cmd) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -3,7 +3,7 @@ if [ x$JVLVERSION != x ]; then export VERSION=$JVLVERSION else - export VERSION=1.8.3-1.2.4_JVL + export VERSION=1.8.3-1.2.5_JVL fi if [ x${VERSION%_JVL} = x$VERSION ]; then Index: getdown/src/getdown/pom.xml =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- getdown/src/getdown/pom.xml (.../pom.xml) (revision 93aa4558431fabba858943e9b2e8f871381a691c) +++ getdown/src/getdown/pom.xml (.../pom.xml) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -10,7 +10,7 @@ com.threerings.getdown getdown pom - 1.8.3-1.2.4_FJVL + 1.8.3-1.2.5_FJVL getdown An application installer and updater. Index: j11lib/getdown-core.jar =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 Binary files differ Index: j8lib/getdown-core.jar =================================================================== diff -u -N -r93aa4558431fabba858943e9b2e8f871381a691c -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 Binary files differ Index: src/jalview/bin/HiDPISetting.java =================================================================== diff -u -N --- src/jalview/bin/HiDPISetting.java (revision 0) +++ src/jalview/bin/HiDPISetting.java (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -0,0 +1,48 @@ +package jalview.bin; + +import java.awt.Toolkit; + +public class HiDPISetting +{ + public static final int dpi; + + public static final int scale; + + private static final int hidpi = 110; + + private static final String scaleProperty = "sun.java2d.uiScale"; + + private static final boolean isAMac = System.getProperty("os.name") + .indexOf("Mac") > -1; + + private static final boolean isLinux = System.getProperty("os.name") + .toLowerCase().indexOf("linux") > -1; + + private static final boolean isWindows = System.getProperty("os.name") + .toLowerCase().indexOf("windows") > -1; + + static + { + dpi = Toolkit.getDefaultToolkit().getScreenResolution(); + scale = dpi / hidpi + 1; + if (scale > 1 && isLinux) + { + System.out.println("DPI detected as " + dpi + + ". Scaling factor set to " + scale + "."); + } + } + + public static String getScalePropertyArg() + { + // HiDPI setting. Just looking at Linux to start with. Test with Windows. + if (!isLinux) + { + return null; + } + if (scale > 1) + { + return "-D" + scaleProperty + "=" + scale; + } + return null; + } +} Index: src/jalview/bin/Jalview.java =================================================================== diff -u -N -re77b677c404d0850fab45aecac341abc64d8766d -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- src/jalview/bin/Jalview.java (.../Jalview.java) (revision e77b677c404d0850fab45aecac341abc64d8766d) +++ src/jalview/bin/Jalview.java (.../Jalview.java) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -20,27 +20,6 @@ */ package jalview.bin; -import jalview.ext.so.SequenceOntology; -import jalview.gui.AlignFrame; -import jalview.gui.Desktop; -import jalview.gui.PromptUserConfig; -import jalview.io.AppletFormatAdapter; -import jalview.io.BioJsHTMLOutput; -import jalview.io.DataSourceType; -import jalview.io.FileFormat; -import jalview.io.FileFormatException; -import jalview.io.FileFormatI; -import jalview.io.FileLoader; -import jalview.io.HtmlSvgOutput; -import jalview.io.IdentifyFile; -import jalview.io.NewickFile; -import jalview.io.gff.SequenceOntologyFactory; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.ColourSchemeProperty; -import jalview.util.MessageManager; -import jalview.util.Platform; -import jalview.ws.jws2.Jws2Discoverer; - import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; @@ -68,6 +47,26 @@ import groovy.lang.Binding; import groovy.util.GroovyScriptEngine; +import jalview.ext.so.SequenceOntology; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.PromptUserConfig; +import jalview.io.AppletFormatAdapter; +import jalview.io.BioJsHTMLOutput; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; +import jalview.io.FileFormatException; +import jalview.io.FileFormatI; +import jalview.io.FileLoader; +import jalview.io.HtmlSvgOutput; +import jalview.io.IdentifyFile; +import jalview.io.NewickFile; +import jalview.io.gff.SequenceOntologyFactory; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ColourSchemeProperty; +import jalview.util.MessageManager; +import jalview.util.Platform; +import jalview.ws.jws2.Jws2Discoverer; /** * Main class for Jalview Application
@@ -183,7 +182,7 @@ * main class for Jalview application * * @param args - * open filename + * open filename */ public static void main(String[] args) { @@ -198,22 +197,24 @@ { System.setSecurityManager(null); System.out - .println("Java version: " - + System.getProperty("java.version")); + .println("Java version: " + System.getProperty("java.version")); System.out.println("Java Home: " + System.getProperty("java.home")); System.out.println(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version")); String val = System.getProperty("sys.install4jVersion"); - if (val != null) { - System.out.println("Install4j version: " + val); + if (val != null) + { + System.out.println("Install4j version: " + val); } val = System.getProperty("installer_template_version"); - if (val != null) { + if (val != null) + { System.out.println("Install4j template version: " + val); } val = System.getProperty("launcher_version"); - if (val != null) { + if (val != null) + { System.out.println("Launcher version: " + val); } @@ -353,6 +354,7 @@ if (!headless) { + desktop = new Desktop(); desktop.setInBatchMode(true); // indicate we are starting up @@ -836,10 +838,10 @@ * Locate the given string as a file and pass it to the groovy interpreter. * * @param groovyscript - * the script to execute + * the script to execute * @param jalviewContext - * the Jalview Desktop object passed in to the groovy - * binding as the 'Jalview' object. + * the Jalview Desktop object passed in to the groovy binding as the + * 'Jalview' object. */ private void executeGroovyScript(String groovyscript, AlignFrame af) { @@ -968,8 +970,8 @@ } /** - * Quit method delegates to Desktop.quit - unless running in headless mode when - * it just ends the JVM + * Quit method delegates to Desktop.quit - unless running in headless mode + * when it just ends the JVM */ public void quit() { Index: src/jalview/bin/Launcher.java =================================================================== diff -u -N -rc7827c8c0d28158fcea4ebc132c7b457d60f557d -r6402aef8acf127e8c5fee47ccaeb0b33aab07663 --- src/jalview/bin/Launcher.java (.../Launcher.java) (revision c7827c8c0d28158fcea4ebc132c7b457d60f557d) +++ src/jalview/bin/Launcher.java (.../Launcher.java) (revision 6402aef8acf127e8c5fee47ccaeb0b33aab07663) @@ -49,8 +49,8 @@ /** * main method for jalview.bin.Launcher. This restarts the same JRE's JVM with - * the same arguments but with memory adjusted based on extracted -jvmmempc and - * -jvmmemmax application arguments. If on a Mac then extra dock:icon and + * the same arguments but with memory adjusted based on extracted -jvmmempc + * and -jvmmemmax application arguments. If on a Mac then extra dock:icon and * dock:name arguments are also set. * * @param args @@ -130,7 +130,7 @@ if (!memSet) { long maxMemLong = MemorySetting.getMemorySetting(jvmmemmax, jvmmempc); - + if (maxMemLong > 0) { memSetting = "-Xmx" + Long.toString(maxMemLong); @@ -153,6 +153,12 @@ } } + String scalePropertyArg = HiDPISetting.getScalePropertyArg(); + if (scalePropertyArg != null) + { + command.add(scalePropertyArg); + } + command.add(startClass); command.addAll(arguments); @@ -176,7 +182,8 @@ if (e.getMessage().toLowerCase().contains("memory")) { System.out.println("Caught a memory exception: " + e.getMessage()); - // Probably the "Cannot allocate memory" error, try without the memory setting + // Probably the "Cannot allocate memory" error, try without the memory + // setting ArrayList commandNoMem = new ArrayList<>(); for (int i = 0; i < command.size(); i++) {