-1.8.3-1.2.4_FJVL
+1.8.3-1.2.5_FJVL
-1.8.3-1.2.4_JVL
+1.8.3-1.2.5_JVL
<parent>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
- <version>1.8.3-1.2.4_FJVL</version>
+ <version>1.8.3-1.2.5_FJVL</version>
</parent>
<artifactId>getdown-ant</artifactId>
<parent>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
- <version>1.8.3-1.2.4_FJVL</version>
+ <version>1.8.3-1.2.5_FJVL</version>
</parent>
<artifactId>getdown-core</artifactId>
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
+import jalview.bin.HiDPISetting;
import jalview.bin.MemorySetting;
//import com.install4j.api.launcher.Variables;
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);
--- /dev/null
+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;
+ }
+}
<parent>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
- <version>1.8.3-1.2.4_FJVL</version>
+ <version>1.8.3-1.2.5_FJVL</version>
</parent>
<artifactId>getdown-launcher</artifactId>
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
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
<packaging>pom</packaging>
- <version>1.8.3-1.2.4_FJVL</version>
+ <version>1.8.3-1.2.5_FJVL</version>
<name>getdown</name>
<description>An application installer and updater.</description>
--- /dev/null
+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;
+ }
+}
if (!headless)
{
+
desktop = new Desktop();
desktop.setInBatchMode(true); // indicate we are starting up
/**
* 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
if (!memSet)
{
long maxMemLong = MemorySetting.getMemorySetting(jvmmemmax, jvmmempc);
-
+
if (maxMemLong > 0)
{
memSetting = "-Xmx" + Long.toString(maxMemLong);
}
}
+ String scalePropertyArg = HiDPISetting.getScalePropertyArg();
+ if (scalePropertyArg != null)
+ {
+ command.add(scalePropertyArg);
+ }
+
command.add(startClass);
command.addAll(arguments);
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<String> commandNoMem = new ArrayList<>();
for (int i = 0; i < command.size(); i++)
{