import jalview.gui.Preferences;
/**
- * Collection of all known applet tags from JalviewLite
+ * Collection of all known applet tags from JalviewLite.
+ * Three cases; can be one or more of these:
+ *
+ * CASE I. args[] name and value for ArgsParser
+ *
+ * CASE II. applet parameter for JalviewJSApp
+ *
+ * CASE III. mapped to a Preference
+ *
*
* @author hansonr
*
// note that Application arguments ARE case-sensitive, but
// Applet.getParameter() is not.
- String appletName = prefName.toLowerCase();
- String argName = prefName;
+ // prefName // CASE III
+
+ String argName = null; // CASE I
+
+ String appletName = prefName.toLowerCase(); // CASE II
+
+ // by nulling one or more of these names, that route will not be used.
+
switch (appletName)
{
case "file":
argName = "open";
- appletName = null;
+ prefName = null;
value = resourcePath + value;
break;
case "file2":
prefName = null;
value = resourcePath + value;
break;
- case "features":
- case "jnetfile":
- case "jpredfile":
- case "pdbfile":
- case "scorefile":
- case "sequence":
+ case "oninit":
+ case "hidefeaturegroups":
+ // applet parameter only
// setting argName to null indicates that we want
- // JalviewJSApp to take care of this using getParameter or getParameterAsObject
- prefName = argName = null;
- value = resourcePath + value;
+ // JalviewJSApp to take care of this using getParameter or getParameterAsObject
+ prefName = argName = null;
break;
case "tree":
case "treefile":
// setting appletName to null indicates that we want
// Jalview.doMain to taken care of this as Jalview args
argName = "tree";
- appletName = null;
+ prefName = null;
value = resourcePath + value;
break;
- // non-loading preferences
+ case "features":
+ case "jnetfile":
+ case "jpredfile":
+ case "pdbfile":
+ case "scorefile":
+ case "sequence":
+ case "annotations":
+ prefName = argName = null;
+ value = resourcePath + value;
+ break;
+
+ // non-loading preferences
case "defaultcolour":
prefName = Preferences.DEFAULT_COLOUR;
case "wrap":
prefName = Preferences.WRAP_ALIGNMENT;
break;
+ case "sortbytree":
+ argName = prefName;
+ prefName = Preferences.SORT_BY_TREE;
+ value = checkTF(value);
+ break;
// implemented; not tested:
- case "oninit":
- argName = null;
- break;
- case "annotations":
- value = resourcePath + value;
- argName = null;
- break;
- case "hidefeaturegroups":
- // TODO
- break;
case "pdbseq":
- argName = prefName = null;
- break;
- case "sortbytree":
- prefName = Preferences.SORT_BY_TREE;
- value = checkTF(value);
- appletName = null; // taken care of by Jalview
+ case "alignpdbfiles":
+ prefName = null;
break;
case "format":
- break;
- case "alignpdbfiles":
- argName = prefName = null;
+ argName = prefName;
break;
case "separator":
+ argName = prefName;
break;
// TODO: probably not relevant?
case "widthscale":
case "windowheight":
case "windowwidth":
- argName = prefName = null;
+ prefName = null;
break;
// TRUE/FALSE
case "debug":
- value = checkTF(value);
- break;
case "embedded":
- value = checkTF(value);
- break;
case "showbutton":
value = checkTF(value);
break;
prefName = Preferences.SHOW_CONSENSUS_LOGO;
value = checkTF(value);
break;
- case "showfeaturegroups":
+ case "showunconserved":
+ prefName = Preferences.SHOW_UNCONSERVED;
value = checkTF(value);
break;
+ case "showfeaturegroups":
case "showfeaturesettings":
- value = checkTF(value);
- break;
case "showfullid":
- value = checkTF(value);
- break;
case "showtreebootstraps":
- value = checkTF(value);
- break;
case "showtreedistances":
- value = checkTF(value);
- break;
- case "showunconserved":
- prefName = Preferences.SHOW_UNCONSERVED;
- value = checkTF(value);
- break;
case "showunlinkedtreenodes":
value = checkTF(value);
break;
break;
}
+ // CASE I. args[] name and value for ArgsParser
+ //
+ // If given an argument name,
// put name and value into application args
if (value != null && argName != null)
{
vargs.add(value.toString());
}
}
+
+ // CASE II. applet parameter for JalviewJSApp
+
if (value == null)
{
value = "false";
}
System.out.println("AppletParams propName=" + prefName + " argName="
- + argName + " appletName=" + appletName + " value=" + value);
+ + argName + " appletName=" + appletName + " value=" + value);
if (appletName != null)
{
appletParams.put(appletName, value);
}
+
+ // CASE III. mapped to a Preference
+
if (prefName != null)
{
Cache.setPropertyNoSave(prefName, value.toString());