From 2c53eb970a6611d2d422df744044b579ef31f490 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 11 Oct 2007 10:37:38 +0000 Subject: [PATCH] static debug flag controlling output of excessive info. showfeaturegroups and hidefeaturegroups parameters. --- src/jalview/bin/JalviewLite.java | 60 ++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 4d1c216..c9977fd 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -198,12 +198,18 @@ public class JalviewLite boolean embedded = false; public boolean jmolAvailable = false; + public static boolean debug; /** * init method for Jalview Applet */ public void init() { + String dbg = getParameter("debug"); + if (dbg!=null) + { + debug = dbg.toLowerCase().equals("true"); + } int r = 255; int g = 255; int b = 255; @@ -323,7 +329,10 @@ public class JalviewLite if (frame instanceof AlignFrame) { currentAlignFrame = (AlignFrame) frame; - System.err.println("Activated window "+frame); + if (debug) + { + System.err.println("Activated window "+frame); + } } } @@ -390,6 +399,10 @@ public class JalviewLite public LoadingThread(String _file, JalviewLite _applet) { + if (applet.debug) + { + System.err.println("Loading thread started with:\n>>file\n"+_file+">>endfile"); + } file = _file; if (file.startsWith("PASTE")) { @@ -405,7 +418,15 @@ public class JalviewLite file = addProtocol(file); protocol = AppletFormatAdapter.URL; } + if (applet.debug) + { + System.err.println("Protocol identified as '"+protocol+"'"); + } format = new jalview.io.IdentifyFile().Identify(file, protocol); + if (applet.debug) + { + System.err.println("File identified as '"+format+"'"); + } applet = _applet; } @@ -651,7 +672,22 @@ public class JalviewLite pdbFileCount++; } while(pdbFileCount < 10); - + + ///////////////////////////// + // modify display of features + // + // hide specific groups + param = getParameter("hidefeaturegroups"); + if (param != null) + { + applet.setFeatureGroupState(param, false); + } + // show specific groups + param = getParameter("showfeaturegroups"); + if (param != null) + { + applet.setFeatureGroupState(param, true); + } } else { @@ -711,10 +747,16 @@ public class JalviewLite { String[] v = new String[jv.size()]; jv.copyInto(v); jv.removeAllElements(); - System.err.println("Array from Tabbed List:\n"+v.length+"\n"+v.toString()); + if (debug) + { + System.err.println("Array from Tabbed List:\n"+v.length+"\n"+v.toString()); + } return v; } - System.err.println("Empty Array from Tabbed List"); + if (debug) + { + System.err.println("Empty Array from Tabbed List"); + } return null; } @@ -734,10 +776,16 @@ public class JalviewLite if (list[list.length-1]!=null) { v.append(list[list.length-1]); } - System.err.println("Tabbed List:\n"+v.toString()); + if (debug) + { + System.err.println("Tabbed List:\n"+v.toString()); + } return v.toString(); } - System.err.println("Empty Tabbed List\n"); + if (debug) + { + System.err.println("Empty Tabbed List\n"); + } return ""; } /** -- 1.7.10.2