JAL-4090 JAL-1551 spotlessApply
[jalview.git] / src / jalview / bin / JalviewLite.java
index 6504290..b73fffc 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.bin;
 
+import java.util.Locale;
+
 import jalview.analysis.AlignmentUtils;
 import jalview.api.StructureSelectionManagerProvider;
 import jalview.appletgui.AlignFrame;
@@ -31,7 +33,6 @@ import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentOrder;
 import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
@@ -199,7 +200,7 @@ public class JalviewLite extends Applet
       int apos = -1;
       try
       {
-        apos = new Integer(position).intValue();
+        apos = Integer.valueOf(position).intValue();
         apos--;
       } catch (NumberFormatException ex)
       {
@@ -208,8 +209,9 @@ public class JalviewLite extends Applet
       final StructureSelectionManagerProvider me = this;
       final int pos = apos;
       // use vamsas listener to broadcast to all listeners in scope
-      if (alignedPosition != null && (alignedPosition.trim().length() == 0
-              || alignedPosition.toLowerCase().indexOf("false") > -1))
+      if (alignedPosition != null
+              && (alignedPosition.trim().length() == 0 || alignedPosition
+                      .toLowerCase(Locale.ROOT).indexOf("false") > -1))
       {
         java.awt.EventQueue.invokeLater(new Runnable()
         {
@@ -290,8 +292,9 @@ public class JalviewLite extends Applet
     {
       if (debug)
       {
-        System.err.println("Selecting region using separator string '"
-                + separator + "'");
+        jalview.bin.Console
+                .errPrintln("Selecting region using separator string '"
+                        + separator + "'");
       }
     }
     // deparse fields
@@ -338,22 +341,22 @@ public class JalviewLite extends Applet
           int from = -1, to = -1;
           try
           {
-            from = new Integer(cl.substring(0, p)).intValue();
+            from = Integer.valueOf(cl.substring(0, p)).intValue();
             from--;
           } catch (NumberFormatException ex)
           {
-            System.err.println(
+            jalview.bin.Console.errPrintln(
                     "ERROR: Couldn't parse first integer in range element column selection string '"
                             + cl + "' - format is 'from-to'");
             return;
           }
           try
           {
-            to = new Integer(cl.substring(p + 1)).intValue();
+            to = Integer.valueOf(cl.substring(p + 1)).intValue();
             to--;
           } catch (NumberFormatException ex)
           {
-            System.err.println(
+            jalview.bin.Console.errPrintln(
                     "ERROR: Couldn't parse second integer in range element column selection string '"
                             + cl + "' - format is 'from-to'");
             return;
@@ -394,13 +397,13 @@ public class JalviewLite extends Applet
             }
             if (debug)
             {
-              System.err.println("Range '" + cl + "' deparsed as [" + from
-                      + "," + to + "]");
+              jalview.bin.Console.errPrintln("Range '" + cl
+                      + "' deparsed as [" + from + "," + to + "]");
             }
           }
           else
           {
-            System.err.println("ERROR: Invalid Range '" + cl
+            jalview.bin.Console.errPrintln("ERROR: Invalid Range '" + cl
                     + "' deparsed as [" + from + "," + to + "]");
           }
         }
@@ -409,18 +412,18 @@ public class JalviewLite extends Applet
           int r = -1;
           try
           {
-            r = new Integer(cl).intValue();
+            r = Integer.valueOf(cl).intValue();
             r--;
           } catch (NumberFormatException ex)
           {
-            if (cl.toLowerCase().equals("sequence"))
+            if (cl.toLowerCase(Locale.ROOT).equals("sequence"))
             {
               // we are in the dataset sequence's coordinate frame.
               inseqpos = true;
             }
             else
             {
-              System.err.println(
+              jalview.bin.Console.errPrintln(
                       "ERROR: Couldn't parse integer from point selection element of column selection string '"
                               + cl + "'");
               return;
@@ -449,14 +452,15 @@ public class JalviewLite extends Applet
             csel.addElement(r);
             if (debug)
             {
-              System.err.println("Point selection '" + cl
+              jalview.bin.Console.errPrintln("Point selection '" + cl
                       + "' deparsed as [" + r + "]");
             }
           }
           else
           {
-            System.err.println("ERROR: Invalid Point selection '" + cl
-                    + "' deparsed as [" + r + "]");
+            jalview.bin.Console
+                    .errPrintln("ERROR: Invalid Point selection '" + cl
+                            + "' deparsed as [" + r + "]");
           }
         }
       }
@@ -471,7 +475,7 @@ public class JalviewLite extends Applet
         SequenceI rs = sel.getSequenceAt(0);
         start = rs.findIndex(start);
         end = rs.findIndex(end);
-        List<Integer> cs = new ArrayList<Integer>(csel.getSelected());
+        List<Integer> cs = new ArrayList<>(csel.getSelected());
         csel.clear();
         for (Integer selectedCol : cs)
         {
@@ -921,7 +925,7 @@ public class JalviewLite extends Applet
     setMouseoverListener(currentAlignFrame, listener);
   }
 
-  private Vector<jalview.javascript.JSFunctionExec> javascriptListeners = new Vector<jalview.javascript.JSFunctionExec>();
+  private Vector<jalview.javascript.JSFunctionExec> javascriptListeners = new Vector<>();
 
   /*
    * (non-Javadoc)
@@ -938,7 +942,7 @@ public class JalviewLite extends Applet
       listener = listener.trim();
       if (listener.length() == 0)
       {
-        System.err.println(
+        jalview.bin.Console.errPrintln(
                 "jalview Javascript error: Ignoring empty function for mouseover listener.");
         return;
       }
@@ -950,12 +954,12 @@ public class JalviewLite extends Applet
             .addStructureViewerListener(mol);
     if (debug)
     {
-      System.err.println("Added a mouseover listener for "
+      jalview.bin.Console.errPrintln("Added a mouseover listener for "
               + ((af == null) ? "All frames"
                       : "Just views for "
                               + af.getAlignViewport().getSequenceSetId()));
-      System.err.println("There are now " + javascriptListeners.size()
-              + " listeners in total.");
+      jalview.bin.Console.errPrintln("There are now "
+              + javascriptListeners.size() + " listeners in total.");
     }
   }
 
@@ -985,7 +989,7 @@ public class JalviewLite extends Applet
       listener = listener.trim();
       if (listener.length() == 0)
       {
-        System.err.println(
+        jalview.bin.Console.errPrintln(
                 "jalview Javascript error: Ignoring empty function for selection listener.");
         return;
       }
@@ -997,12 +1001,12 @@ public class JalviewLite extends Applet
             .addSelectionListener(mol);
     if (debug)
     {
-      System.err.println("Added a selection listener for "
+      jalview.bin.Console.errPrintln("Added a selection listener for "
               + ((af == null) ? "All frames"
                       : "Just views for "
                               + af.getAlignViewport().getSequenceSetId()));
-      System.err.println("There are now " + javascriptListeners.size()
-              + " listeners in total.");
+      jalview.bin.Console.errPrintln("There are now "
+              + javascriptListeners.size() + " listeners in total.");
     }
   }
 
@@ -1025,7 +1029,7 @@ public class JalviewLite extends Applet
       listener = listener.trim();
       if (listener.length() == 0)
       {
-        System.err.println(
+        jalview.bin.Console.errPrintln(
                 "jalview Javascript error: Ignoring empty function for selection listener.");
         return;
       }
@@ -1037,10 +1041,11 @@ public class JalviewLite extends Applet
             .addStructureViewerListener(mol);
     if (debug)
     {
-      System.err.println("Added a javascript structure viewer listener '"
-              + listener + "'");
-      System.err.println("There are now " + javascriptListeners.size()
-              + " listeners in total.");
+      jalview.bin.Console
+              .errPrintln("Added a javascript structure viewer listener '"
+                      + listener + "'");
+      jalview.bin.Console.errPrintln("There are now "
+              + javascriptListeners.size() + " listeners in total.");
     }
   }
 
@@ -1085,7 +1090,8 @@ public class JalviewLite extends Applet
         rprt = debug;
         if (debug)
         {
-          System.err.println("Removed listener '" + listener + "'");
+          jalview.bin.Console
+                  .errPrintln("Removed listener '" + listener + "'");
         }
       }
       else
@@ -1095,22 +1101,22 @@ public class JalviewLite extends Applet
     }
     if (rprt)
     {
-      System.err.println("There are now " + javascriptListeners.size()
-              + " listeners in total.");
+      jalview.bin.Console.errPrintln("There are now "
+              + javascriptListeners.size() + " listeners in total.");
     }
   }
 
   @Override
   public void stop()
   {
-    System.err.println("Applet " + getName() + " stop().");
+    jalview.bin.Console.errPrintln("Applet " + getName() + " stop().");
     tidyUp();
   }
 
   @Override
   public void destroy()
   {
-    System.err.println("Applet " + getName() + " destroy().");
+    jalview.bin.Console.errPrintln("Applet " + getName() + " destroy().");
     tidyUp();
   }
 
@@ -1177,7 +1183,7 @@ public class JalviewLite extends Applet
         try
         {
           StructureSelectionManager.getStructureSelectionManager(me)
-                  .mouseOverStructure(new Integer(pdbResNum).intValue(),
+                  .mouseOverStructure(Integer.valueOf(pdbResNum).intValue(),
                           chain, pdbfile);
           if (debug)
           {
@@ -1187,8 +1193,9 @@ public class JalviewLite extends Applet
           }
         } catch (NumberFormatException e)
         {
-          System.err.println("Ignoring invalid residue number string '"
-                  + pdbResNum + "'");
+          jalview.bin.Console
+                  .errPrintln("Ignoring invalid residue number string '"
+                          + pdbResNum + "'");
         }
 
       }
@@ -1213,14 +1220,15 @@ public class JalviewLite extends Applet
       {
         try
         {
-          alf.scrollTo(new Integer(topRow).intValue(),
-                  new Integer(leftHandColumn).intValue());
+          alf.scrollTo(Integer.valueOf(topRow).intValue(),
+                  Integer.valueOf(leftHandColumn).intValue());
 
         } catch (Exception ex)
         {
-          System.err.println("Couldn't parse integer arguments (topRow='"
-                  + topRow + "' and leftHandColumn='" + leftHandColumn
-                  + "')");
+          jalview.bin.Console
+                  .errPrintln("Couldn't parse integer arguments (topRow='"
+                          + topRow + "' and leftHandColumn='"
+                          + leftHandColumn + "')");
           ex.printStackTrace();
         }
       }
@@ -1245,12 +1253,13 @@ public class JalviewLite extends Applet
       {
         try
         {
-          alf.scrollToRow(new Integer(topRow).intValue());
+          alf.scrollToRow(Integer.valueOf(topRow).intValue());
 
         } catch (Exception ex)
         {
-          System.err.println("Couldn't parse integer arguments (topRow='"
-                  + topRow + "')");
+          jalview.bin.Console
+                  .errPrintln("Couldn't parse integer arguments (topRow='"
+                          + topRow + "')");
           ex.printStackTrace();
         }
 
@@ -1277,11 +1286,11 @@ public class JalviewLite extends Applet
       {
         try
         {
-          alf.scrollToColumn(new Integer(leftHandColumn).intValue());
+          alf.scrollToColumn(Integer.valueOf(leftHandColumn).intValue());
 
         } catch (Exception ex)
         {
-          System.err.println(
+          jalview.bin.Console.errPrintln(
                   "Couldn't parse integer arguments (leftHandColumn='"
                           + leftHandColumn + "')");
           ex.printStackTrace();
@@ -1334,7 +1343,7 @@ public class JalviewLite extends Applet
   private boolean alignPdbStructures = false;
 
   /**
-   * use an external structure viewer exclusively (no jmols or MCViews will be
+   * use an external structure viewer exclusively (no jmols or mc_views will be
    * opened by JalviewLite itself)
    */
   public boolean useXtrnalSviewer = false;
@@ -1413,18 +1422,19 @@ public class JalviewLite extends Applet
     {
       if (debug)
       {
-        System.err.println("Applet context is '"
+        jalview.bin.Console.errPrintln("Applet context is '"
                 + getAppletContext().getClass().toString() + "'");
       }
       JSObject scriptObject = JSObject.getWindow(this);
       if (debug && scriptObject != null)
       {
-        System.err.println("Applet has Javascript callback support.");
+        jalview.bin.Console
+                .errPrintln("Applet has Javascript callback support.");
       }
 
     } catch (Exception ex)
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "Warning: No JalviewLite javascript callbacks available.");
       if (debug)
       {
@@ -1434,14 +1444,15 @@ public class JalviewLite extends Applet
 
     if (debug)
     {
-      System.err.println("JalviewLite Version " + getVersion());
-      System.err.println("Build Date : " + getBuildDate());
-      System.err.println("Installation : " + getInstallation());
+      jalview.bin.Console.errPrintln("JalviewLite Version " + getVersion());
+      jalview.bin.Console.errPrintln("Build Date : " + getBuildDate());
+      jalview.bin.Console.errPrintln("Installation : " + getInstallation());
     }
     String externalsviewer = getParameter("externalstructureviewer");
     if (externalsviewer != null)
     {
-      useXtrnalSviewer = externalsviewer.trim().toLowerCase().equals(TRUE);
+      useXtrnalSviewer = externalsviewer.trim().toLowerCase(Locale.ROOT)
+              .equals(TRUE);
     }
     /**
      * if true disable the check for jmol
@@ -1462,7 +1473,8 @@ public class JalviewLite extends Applet
         separator = sep;
         if (debug)
         {
-          System.err.println("Separator set to '" + separator + "'");
+          jalview.bin.Console
+                  .errPrintln("Separator set to '" + separator + "'");
         }
       }
       else
@@ -1570,7 +1582,8 @@ public class JalviewLite extends Applet
     {
       if (tries > 0)
       {
-        System.err.println("LiveConnect request thread going to sleep.");
+        jalview.bin.Console
+                .errPrintln("LiveConnect request thread going to sleep.");
       }
       try
       {
@@ -1581,7 +1594,8 @@ public class JalviewLite extends Applet
       ;
       if (tries++ > 0)
       {
-        System.err.println("LiveConnect request thread woken up.");
+        jalview.bin.Console
+                .errPrintln("LiveConnect request thread woken up.");
       }
       try
       {
@@ -1592,7 +1606,7 @@ public class JalviewLite extends Applet
         }
       } catch (Exception jsex)
       {
-        System.err.println("Attempt " + tries
+        jalview.bin.Console.errPrintln("Attempt " + tries
                 + " to access LiveConnect javascript failed.");
       }
     }
@@ -1629,14 +1643,15 @@ public class JalviewLite extends Applet
                   "Calling oninit callback '" + initjscallback + "'.");
         } catch (Exception e)
         {
-          System.err.println("Exception when executing _oninit callback '"
-                  + initjscallback + "'.");
+          jalview.bin.Console
+                  .errPrintln("Exception when executing _oninit callback '"
+                          + initjscallback + "'.");
           e.printStackTrace();
         }
       }
       else
       {
-        System.err.println("Not executing _oninit callback '"
+        jalview.bin.Console.errPrintln("Not executing _oninit callback '"
                 + initjscallback + "' - no scripting allowed.");
       }
     }
@@ -1697,7 +1712,7 @@ public class JalviewLite extends Applet
           ((AlignFrame) frame).viewport.applet.currentAlignFrame = (AlignFrame) frame;
           if (debug)
           {
-            System.err.println("Activated window " + frame);
+            jalview.bin.Console.errPrintln("Activated window " + frame);
           }
         }
         // be good.
@@ -1712,7 +1727,7 @@ public class JalviewLite extends Applet
        * 
        * public void windowDeactivated(WindowEvent e) { if (currentAlignFrame ==
        * frame) { currentAlignFrame = null; if (debug) {
-       * System.err.println("Deactivated window "+frame); } }
+       * jalview.bin.Console.errPrintln("Deactivated window "+frame); } }
        * super.windowDeactivated(e); }
        */
     });
@@ -1798,8 +1813,8 @@ public class JalviewLite extends Applet
           }
           if (!jmolAvailable)
           {
-            System.out.println(
-                    "Jmol not available - Using MCview for structures");
+            jalview.bin.Console.outPrintln(
+                    "Jmol not available - Using mc_view for structures");
           }
         } catch (java.lang.ClassNotFoundException ex)
         {
@@ -1810,8 +1825,8 @@ public class JalviewLite extends Applet
         jmolAvailable = false;
         if (debug)
         {
-          System.err.println(
-                  "Skipping Jmol check. Will use MCView (probably)");
+          jalview.bin.Console.errPrintln(
+                  "Skipping Jmol check. Will use mc_view (probably)");
         }
       }
       checkedForJmol = true;
@@ -1841,7 +1856,7 @@ public class JalviewLite extends Applet
     {
       if (JalviewLite.debug)
       {
-        System.err.println(msg);
+        jalview.bin.Console.errPrintln(msg);
       }
     }
 
@@ -1881,8 +1896,8 @@ public class JalviewLite extends Applet
       {
         if (debug)
         {
-          System.err.println("Prepended document base '" + documentBase
-                  + "' to make: '" + withDocBase + "'");
+          jalview.bin.Console.errPrintln("Prepended document base '"
+                  + documentBase + "' to make: '" + withDocBase + "'");
         }
         protocol = DataSourceType.URL;
         return withDocBase;
@@ -1900,7 +1915,7 @@ public class JalviewLite extends Applet
         protocol = DataSourceType.URL;
         if (debug)
         {
-          System.err.println("Prepended codebase '" + codeBase
+          jalview.bin.Console.errPrintln("Prepended codebase '" + codeBase
                   + "' to make: '" + withCodeBase + "'");
         }
         return withCodeBase;
@@ -2007,7 +2022,7 @@ public class JalviewLite extends Applet
                   + " as "
                   + (al1.isNucleotide() ? "protein product" : "cDNA")
                   + " for " + af.getTitle();
-          System.err.println(msg);
+          jalview.bin.Console.errPrintln(msg);
         }
       }
 
@@ -2081,7 +2096,7 @@ public class JalviewLite extends Applet
             dbgMsg(">>>Dump finished.");
           } catch (Exception e)
           {
-            System.err.println(
+            jalview.bin.Console.errPrintln(
                     "Exception when trying to dump the content of the file parameter.");
             e.printStackTrace();
           }
@@ -2165,8 +2180,8 @@ public class JalviewLite extends Applet
           else
           {
             param = st.nextToken();
-            List<SequenceI> tmp = new ArrayList<SequenceI>();
-            List<String> tmp2 = new ArrayList<String>();
+            List<SequenceI> tmp = new ArrayList<>();
+            List<String> tmp2 = new ArrayList<>();
 
             while (st.hasMoreTokens())
             {
@@ -2211,7 +2226,7 @@ public class JalviewLite extends Applet
                 {
                   // this may not really be a problem but we give a warning
                   // anyway
-                  System.err.println(
+                  jalview.bin.Console.errPrintln(
                           "Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence "
                                   + i + ")");
                 }
@@ -2279,12 +2294,9 @@ public class JalviewLite extends Applet
           JnetAnnotationMaker.add_annotation(predictions,
                   alignFrame.viewport.getAlignment(), 0, false);
           // false == do not add sequence profile from concise output
-          SequenceI repseq = alignFrame.viewport.getAlignment()
-                  .getSequenceAt(0);
-          alignFrame.viewport.getAlignment().setSeqrep(repseq);
-          HiddenColumns cs = new HiddenColumns();
-          cs.hideInsertionsFor(repseq);
-          alignFrame.viewport.getAlignment().setHiddenColumns(cs);
+
+          alignFrame.viewport.getAlignment().setupJPredAlignment();
+
           alignFrame.alignPanel.fontChanged();
           alignFrame.alignPanel.setScrollValues(0, 0);
           result = true;
@@ -2320,7 +2332,7 @@ public class JalviewLite extends Applet
         }
         else
         {
-          System.err.println(
+          jalview.bin.Console.errPrintln(
                   "Annotations were not added from annotation file '"
                           + param + "'");
         }
@@ -2392,13 +2404,13 @@ public class JalviewLite extends Applet
         {
           if (debug)
           {
-            System.err.println(
+            jalview.bin.Console.errPrintln(
                     "Attempting to load T-COFFEE score file from the scoreFile parameter");
           }
           result = alignFrame.loadScoreFile(sScoreFile);
           if (!result)
           {
-            System.err.println(
+            jalview.bin.Console.errPrintln(
                     "Failed to parse T-COFFEE parameter as a valid score file ('"
                             + sScoreFile + "')");
           }
@@ -2469,13 +2481,14 @@ public class JalviewLite extends Applet
         boolean rtn = (getClass().getResourceAsStream("/" + f) != null);
         if (debug)
         {
-          System.err.println("Resource '" + f + "' was "
+          jalview.bin.Console.errPrintln("Resource '" + f + "' was "
                   + (rtn ? "" : "not ") + "located by classloader.");
         }
         return rtn;
       } catch (Exception ex)
       {
-        System.out.println("Exception checking resources: " + f + " " + ex);
+        jalview.bin.Console.outPrintln(
+                "Exception checking resources: " + f + " " + ex);
         return false;
       }
     }
@@ -2496,7 +2509,7 @@ public class JalviewLite extends Applet
     {
       return initialAlignFrame;
     }
-    System.err.println(
+    jalview.bin.Console.errPrintln(
             "Implementation error: Jalview Applet API cannot work out which AlignFrame to use.");
     return null;
   }
@@ -2564,18 +2577,18 @@ public class JalviewLite extends Applet
       jv.removeAllElements();
       if (debug)
       {
-        System.err.println("Array from '" + separator
+        jalview.bin.Console.errPrintln("Array from '" + separator
                 + "' separated List:\n" + v.length);
         for (int i = 0; i < v.length; i++)
         {
-          System.err.println("item " + i + " '" + v[i] + "'");
+          jalview.bin.Console.errPrintln("item " + i + " '" + v[i] + "'");
         }
       }
       return v;
     }
     if (debug)
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "Empty Array from '" + separator + "' separated List");
     }
     return null;
@@ -2620,13 +2633,13 @@ public class JalviewLite extends Applet
       {
         System.err
                 .println("Returning '" + separator + "' separated List:\n");
-        System.err.println(v);
+        jalview.bin.Console.errPrintln(v);
       }
       return v.toString();
     }
     if (debug)
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "Returning empty '" + separator + "' separated List\n");
     }
     return "" + separator;
@@ -2695,7 +2708,7 @@ public class JalviewLite extends Applet
           final String groups, boolean state)
   {
     final boolean st = state;// !(state==null || state.equals("") ||
-    // state.toLowerCase().equals("false"));
+    // state.toLowerCase(Locale.ROOT).equals("false"));
     java.awt.EventQueue.invokeLater(new Runnable()
     {
       @Override
@@ -2745,7 +2758,8 @@ public class JalviewLite extends Applet
     this.separator = separator;
     if (debug)
     {
-      System.err.println("Default Separator now: '" + separator + "'");
+      jalview.bin.Console
+              .errPrintln("Default Separator now: '" + separator + "'");
     }
   }
 
@@ -2802,9 +2816,9 @@ public class JalviewLite extends Applet
     // callInitCallback();
   }
 
-  private Hashtable<String, long[]> jshashes = new Hashtable<String, long[]>();
+  private Hashtable<String, long[]> jshashes = new Hashtable<>();
 
-  private Hashtable<String, Hashtable<String, String[]>> jsmessages = new Hashtable<String, Hashtable<String, String[]>>();
+  private Hashtable<String, Hashtable<String, String[]>> jsmessages = new Hashtable<>();
 
   public void setJsMessageSet(String messageclass, String viewId,
           String[] colcommands)
@@ -2812,7 +2826,7 @@ public class JalviewLite extends Applet
     Hashtable<String, String[]> msgset = jsmessages.get(messageclass);
     if (msgset == null)
     {
-      msgset = new Hashtable<String, String[]>();
+      msgset = new Hashtable<>();
       jsmessages.put(messageclass, msgset);
     }
     msgset.put(viewId, colcommands);
@@ -2901,8 +2915,8 @@ public class JalviewLite extends Applet
     Color col = ColorUtils.parseColourString(colprop);
     if (col == null)
     {
-      System.err.println("Couldn't parse '" + colprop + "' as a colour for "
-              + colparam);
+      jalview.bin.Console.errPrintln("Couldn't parse '" + colprop
+              + "' as a colour for " + colparam);
     }
     return (col == null) ? defcolour : col;
   }
@@ -2971,7 +2985,7 @@ public class JalviewLite extends Applet
     }
     if (debug)
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "resolveUrlForLocalOrAbsolute returning " + resolvedPath);
     }
     return resolvedPath;
@@ -3000,7 +3014,7 @@ public class JalviewLite extends Applet
                         : getDocumentBase());
         if (debug)
         {
-          System.err.println("Show url (prepended " + prepend
+          jalview.bin.Console.errPrintln("Show url (prepended " + prepend
                   + " - toggle resolvetocodebase if code/docbase resolution is wrong): "
                   + url);
         }
@@ -3009,7 +3023,7 @@ public class JalviewLite extends Applet
       {
         if (debug)
         {
-          System.err.println("Show url: " + url);
+          jalview.bin.Console.errPrintln("Show url: " + url);
         }
       }
       if (url.indexOf("javascript:") == 0)