git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3609 Added a -DforceHiDPISetting=true option mainly for testing, and updated...
[jalview.git]
/
getdown
/
src
/
getdown
/
core
/
src
/
main
/
java
/
jalview
/
bin
/
HiDPISetting.java
diff --git
a/getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java
b/getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java
index
5e20d76
..
bea9dae
100644
(file)
--- a/
getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java
+++ b/
getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java
@@
-10,38
+10,52
@@
public class HiDPISetting
private static final int hidpi = 110;
private static final int hidpi = 110;
- private static final String scaleProperty = "sun.java2d.uiScale";
+ private static final String scalePropertyName = "sun.java2d.uiScale";
- private static final boolean isAMac = System.getProperty("os.name")
- .indexOf("Mac") > -1;
+ private static final boolean isAMac;
- private static final boolean isLinux = System.getProperty("os.name")
- .toLowerCase().indexOf("linux") > -1;
+ private static final boolean isLinux;
- private static final boolean isWindows = System.getProperty("os.name")
- .toLowerCase().indexOf("windows") > -1;
+ private static final boolean isWindows;
+
+ public static final String forceHiDPISettingPropertyName = "forceHiDPISetting";
+
+ private static final boolean forceHiDPISetting;
static
{
static
{
+ isAMac = System.getProperty("os.name").indexOf("Mac") > -1;
+ isLinux = System.getProperty("os.name").toLowerCase()
+ .indexOf("linux") > -1;
+ isWindows = System.getProperty("os.name").toLowerCase()
+ .indexOf("windows") > -1;
dpi = Toolkit.getDefaultToolkit().getScreenResolution();
scale = dpi / hidpi + 1;
dpi = Toolkit.getDefaultToolkit().getScreenResolution();
scale = dpi / hidpi + 1;
- if (scale > 1 && isLinux)
+ String forceHiDPISettingProperty = System
+ .getProperty(forceHiDPISettingPropertyName);
+ forceHiDPISetting = forceHiDPISettingProperty != null
+ && forceHiDPISettingProperty.equalsIgnoreCase("true");
+ if (doCondition())
{
{
+ System.out.println("Property '" + forceHiDPISettingPropertyName + "'="
+ + forceHiDPISettingProperty);
+ System.out.println("boolean forceHiDPISetting=" + forceHiDPISetting);
System.out.println("DPI detected as " + dpi
+ ". Scaling factor set to " + scale + ".");
}
}
System.out.println("DPI detected as " + dpi
+ ". Scaling factor set to " + scale + ".");
}
}
- public static String getScalePropertyArg()
+ private static synchronized boolean doCondition()
+ {
+ return (scale > 1 && isLinux) || forceHiDPISetting;
+ }
+
+ public static synchronized String getScalePropertyArg()
{
// HiDPI setting. Just looking at Linux to start with. Test with Windows.
{
// HiDPI setting. Just looking at Linux to start with. Test with Windows.
- if (!isLinux)
- {
- return null;
- }
- if (scale > 1)
+ if (doCondition())
{
{
- return "-D" + scaleProperty + "=" + scale;
+ return "-D" + scalePropertyName + "=" + scale;
}
return null;
}
}
return null;
}