+ if (setHiDPI && setHiDPIScale > 0)
+ {
+ setHiDPIScale(setHiDPIScale);
+ return;
+ }
+
+ // check to see if the scale property has already been set by something else
+ // (e.g. the OS)
+ String existingProperty = System.getProperty(scalePropertyName);
+ if (existingProperty != null)
+ {
+ try
+ {
+ int existingPropertyVal = Integer.parseInt(existingProperty);
+ System.out.println("Existing " + scalePropertyName + " is "
+ + existingPropertyVal);
+ if (existingPropertyVal > 1)
+ {
+ setHiDPIScale(existingPropertyVal);
+ return;
+ }
+ } catch (NumberFormatException e)
+ {
+ System.out.println("Could not convert property " + scalePropertyName
+ + " vale '" + existingProperty + "' to number");
+ }
+ }
+
+ // Try and auto guess a good scale based on reported DPI (not trustworthy)
+ // and screen resolution (more trustworthy)