JAL-629 Change all stdout and stderr output to use Console.outPrintln and Console...
[jalview.git] / src / jalview / bin / HiDPISetting.java
index 6219179..3f57aed 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.bin;
 
 import java.util.Locale;
@@ -97,7 +117,7 @@ public class HiDPISetting
         }
       } catch (NumberFormatException e)
       {
-        System.err.println(setHiDPIScalePropertyName + " property give ("
+        jalview.bin.Console.errPrintln(setHiDPIScalePropertyName + " property give ("
                 + setHiDPIScaleProperty + ") but not parseable as integer");
       }
     }
@@ -115,7 +135,7 @@ public class HiDPISetting
       try
       {
         int existingPropertyVal = Integer.parseInt(existingProperty);
-        System.out.println("Existing " + scalePropertyName + " is "
+        jalview.bin.Console.outPrintln("Existing " + scalePropertyName + " is "
                 + existingPropertyVal);
         if (existingPropertyVal > 1)
         {
@@ -124,7 +144,7 @@ public class HiDPISetting
         }
       } catch (NumberFormatException e)
       {
-        System.out.println("Could not convert property " + scalePropertyName
+        jalview.bin.Console.outPrintln("Could not convert property " + scalePropertyName
                 + " vale '" + existingProperty + "' to number");
       }
     }
@@ -139,7 +159,7 @@ public class HiDPISetting
       dpi = screenInfo.getScreenResolution();
     } catch (HeadlessException e)
     {
-      System.err.println("Cannot get screen resolution: " + e.getMessage());
+      jalview.bin.Console.errPrintln("Cannot get screen resolution: " + e.getMessage());
     }
 
     // try and get screen size height and width
@@ -151,7 +171,7 @@ public class HiDPISetting
       mindimension = Math.min(height, width);
     } catch (HeadlessException e)
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "Cannot get screen size height and width:" + e.getMessage());
     }
 
@@ -169,10 +189,12 @@ public class HiDPISetting
     int dimensionScale = 1 + (mindimension / bigScreenThreshold);
 
     // reject outrageous values -- dpiScale in particular could be mistaken
-    if (dpiScale > MAX_SCALE) {
+    if (dpiScale > MAX_SCALE)
+    {
       dpiScale = 1;
     }
-    if (dimensionScale > MAX_SCALE) {
+    if (dimensionScale > MAX_SCALE)
+    {
       dimensionScale = 1;
     }