X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalviewLite.java;h=b73fffc5abeafae97ef7cfa54e3fbcd4646ea441;hb=ccc53e88e3260886f5d3bdacc619c0f374be9b8f;hp=7d66f6d9997df9376d595679eaa0d9a127d8593a;hpb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;p=jalview.git diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 7d66f6d..b73fffc 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -292,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 @@ -344,7 +345,7 @@ public class JalviewLite extends Applet 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; @@ -355,7 +356,7 @@ public class JalviewLite extends Applet 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; @@ -396,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 + "]"); } } @@ -422,7 +423,7 @@ public class JalviewLite extends Applet } else { - System.err.println( + jalview.bin.Console.errPrintln( "ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'"); return; @@ -451,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 + "]"); } } } @@ -940,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; } @@ -952,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."); } } @@ -987,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; } @@ -999,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."); } } @@ -1027,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; } @@ -1039,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."); } } @@ -1087,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 @@ -1097,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(); } @@ -1189,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 + "'"); } } @@ -1220,9 +1225,10 @@ public class JalviewLite extends Applet } 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(); } } @@ -1251,8 +1257,9 @@ public class JalviewLite extends Applet } 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(); } @@ -1283,7 +1290,7 @@ public class JalviewLite extends Applet } catch (Exception ex) { - System.err.println( + jalview.bin.Console.errPrintln( "Couldn't parse integer arguments (leftHandColumn='" + leftHandColumn + "')"); ex.printStackTrace(); @@ -1415,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) { @@ -1436,9 +1444,9 @@ 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) @@ -1465,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 @@ -1573,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 { @@ -1584,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 { @@ -1595,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."); } } @@ -1632,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."); } } @@ -1700,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. @@ -1715,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); } */ }); @@ -1801,7 +1813,7 @@ public class JalviewLite extends Applet } if (!jmolAvailable) { - System.out.println( + jalview.bin.Console.outPrintln( "Jmol not available - Using mc_view for structures"); } } catch (java.lang.ClassNotFoundException ex) @@ -1813,7 +1825,7 @@ public class JalviewLite extends Applet jmolAvailable = false; if (debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Skipping Jmol check. Will use mc_view (probably)"); } } @@ -1844,7 +1856,7 @@ public class JalviewLite extends Applet { if (JalviewLite.debug) { - System.err.println(msg); + jalview.bin.Console.errPrintln(msg); } } @@ -1884,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; @@ -1903,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; @@ -2010,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); } } @@ -2084,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(); } @@ -2214,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 + ")"); } @@ -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; @@ -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 + "'"); } } @@ -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)