From 86d8388406a8e90e7af3b2bc4fd1b796c6a673c4 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 23 Apr 2010 12:20:56 +0000 Subject: [PATCH] default value boolean parameter getter --- src/jalview/bin/JalviewLite.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 7ae85dc..43f7f19 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -707,7 +707,7 @@ public class JalviewLite extends Applet newAlignFrame.statusBar.setText("Successfully loaded file " + file); - + String treeFile = applet.getParameter("tree"); if (treeFile == null) { @@ -1194,4 +1194,24 @@ public class JalviewLite extends Applet { this.separator = separator; } + + /** + * get boolean value of applet parameter 'name' and return default if parameter is not set + * @param name name of paremeter + * @param def the value to return otherwise + * @return true or false + */ + public boolean getDefaultParameter(String name, boolean def) + { + String stn; + if ((stn=getParameter(name)) == null) + { + return def; + } + if (stn.toLowerCase().equals("true")) + { + return true; + } + return false; + } } -- 1.7.10.2