String arg = args[i].trim();
if (arg.startsWith("name="))
{
- String appName = getAttr(arg, "name");
+ String prefName = getAttr(arg, "name");
+ String appletName = prefName.toLowerCase();
+ String argName = prefName;
String value = getAttr(arg, "value");
- String appletName = appName.toLowerCase();
// note that Application arguments ARE case-sensitive, but
// Applet.getParameter() is not.
switch (appletName)
{
- // tested, working:
-
case "file":
- appName = "open";
- value = resourcePath + value;
+ argName = "open";
appletName = null;
+ value = resourcePath + value;
break;
case "file2":
+ argName = "open2";
+ prefName = null;
value = resourcePath + value;
- appName = null;
break;
+ case "features":
case "jnetfile":
- value = resourcePath + value;
- appName = null;
- break;
case "jpredfile":
- value = resourcePath + value;
- appName = null;
- break;
- case "features":
- value = resourcePath + value;
- appName = null;
- break;
case "pdbfile":
+ case "scorefile":
+ case "sequence":
+ // setting argName to null indicates that we want
+ // JalviewAppLoader to take care of this.
+ prefName = argName = null;
value = resourcePath + value;
- appName = null;
break;
case "tree":
case "treefile":
- appName = "tree";
+ // setting appletName to null indicates that we want
+ // Jalview.doMain to taken care of this as Jalview args
+ argName = "tree";
+ appletName = null;
value = resourcePath + value;
- appletName = null; // taken care of by Jalview
break;
+
+ // non-loading preferences
+
case "defaultcolour":
- appName = Preferences.DEFAULT_COLOUR;
+ prefName = Preferences.DEFAULT_COLOUR;
break;
case "defaultcolournuc":
- appName = Preferences.DEFAULT_COLOUR_NUC;
+ prefName = Preferences.DEFAULT_COLOUR_NUC;
break;
case "defaultcolourprot":
- appName = Preferences.DEFAULT_COLOUR_PROT;
+ prefName = Preferences.DEFAULT_COLOUR_PROT;
+ break;
+ case "annotationcolour_max":
+ prefName = Preferences.ANNOTATIONCOLOUR_MAX;
+ break;
+ case "annotationcolour_min":
+ prefName = Preferences.ANNOTATIONCOLOUR_MIN;
+ break;
+ case "enablesplitframe":
+ prefName = Preferences.ENABLE_SPLIT_FRAME;
+ break;
+ case "centrecolumnlabels":
+ prefName = Preferences.CENTRE_COLUMN_LABELS;
+ break;
+ case "sortby":
+ prefName = Preferences.SORT_ALIGNMENT; // id, etc.
+ break;
+ case "normalisesequencelogo":
+ prefName = Preferences.NORMALISE_CONSENSUS_LOGO;
+ break;
+ case "relaxedidmatch":
+ prefName = Preferences.RELAXEDSEQIDMATCHING;
+ break;
+ case "scaleproteinascdna":
+ prefName = Preferences.SCALE_PROTEIN_TO_CDNA;
+ break;
+ case "userdefinedcolour":
+ argName = "colour";
+ prefName = Preferences.USER_DEFINED_COLOURS;
+ break;
+ case "wrap":
+ prefName = Preferences.WRAP_ALIGNMENT;
break;
// implemented; not tested:
case "oninit":
- appName = null;
+ prefName = null;
break;
case "annotations":
value = resourcePath + value;
- appName = null;
- break;
- case "annotationcolour_max":
- appName = Preferences.ANNOTATIONCOLOUR_MAX;
- break;
- case "annotationcolour_min":
- appName = Preferences.ANNOTATIONCOLOUR_MIN;
- break;
- case "enablesplitframe":
- appName = Preferences.ENABLE_SPLIT_FRAME;
+ argName = null;
break;
case "hidefeaturegroups":
- break;
- case "centrecolumnlabels":
- appName = null;
+ // TODO
break;
case "pdbseq":
- appName = null;
- break;
- case "sortby":
- appName = Preferences.SORT_ALIGNMENT; // id, etc.
+ argName = prefName = null;
break;
case "sortbytree":
- appName = Preferences.SORT_BY_TREE;
+ prefName = Preferences.SORT_BY_TREE;
value = checkTF(value);
appletName = null; // taken care of by Jalview
break;
case "format":
break;
+ case "alignpdbfiles":
+ argName = prefName = null;
+ break;
+ case "separator":
+ break;
- // probably not relevant:
+ // TODO: probably not relevant?
- case "externalstructureviewer":
+ case "rgb":
+ prefName = null; // TODO no background for application?
break;
- case "alignpdbfiles":
+ case "externalstructureviewer":
break;
case "application_url":
- appName = "APPLICATION_URL";
break;
case "automaticscrolling":
- appName = "automaticScrolling";
break;
case "heightscale":
- appName = "heightScale";
break;
case "jalviewhelpurl":
break;
case "label":
break;
case "linklabel_":
- appName = "linkLabel_";
+ prefName = "linkLabel_";
break;
case "linklabel_1":
- appName = "linkLabel_1";
+ prefName = "linkLabel_1";
break;
case "linkurl_":
- appName = "linkURL_";
- break;
- case "rgb":
- appName = null; // no background for application
+ prefName = "linkURL_";
break;
// unknown:
case "nojmol":
- break;
case "normaliselogo":
- appName = Preferences.NORMALISE_LOGO;
- break;
- case "normalisesequencelogo":
- appName = Preferences.NORMALISE_CONSENSUS_LOGO;
- break;
- case "relaxedidmatch":
- break;
case "resolvetocodebase":
- break;
- case "scaleproteinascdna":
- appName = "scaleProteinAsCdna";
- break;
- case "separator":
- break;
- case "sequence":
- break;
case "uppercase":
- appName = "upperCase";
- break;
- case "userdefinedcolour":
- appName = "colour";
- break;
case "widthscale":
- appName = "widthScale";
- break;
case "windowheight":
- appName = "windowHeight";
- break;
case "windowwidth":
- appName = "windowWidth";
- break;
- case "wrap":
- appName = Preferences.WRAP_ALIGNMENT;
- break;
- case "scorefile":
- appName = "scoreFile";
- value = resourcePath + value;
+ argName = prefName = null;
break;
// TRUE/FALSE
value = checkTF(value);
break;
case "showannotation":
- appName = Preferences.SHOW_ANNOTATIONS;
+ prefName = Preferences.SHOW_ANNOTATIONS;
value = checkTF(value);
break;
case "showconsensus":
- appName = Preferences.SHOW_CONSENSUS_LOGO;
+ prefName = Preferences.SHOW_CONSENSUS_LOGO;
value = checkTF(value);
break;
case "showconsensushistogram":
- appName = Preferences.SHOW_CONSENSUS_HISTOGRAM;
+ prefName = Preferences.SHOW_CONSENSUS_HISTOGRAM;
value = checkTF(value);
break;
case "showconservation":
- appName = Preferences.SHOW_CONSERVATION;
+ prefName = Preferences.SHOW_CONSERVATION;
value = checkTF(value);
break;
case "showgroupconsensus":
- appName = Preferences.SHOW_GROUP_CONSENSUS;
+ prefName = Preferences.SHOW_GROUP_CONSENSUS;
value = checkTF(value);
break;
case "showgroupconservation":
- appName = Preferences.SHOW_GROUP_CONSERVATION;
+ prefName = Preferences.SHOW_GROUP_CONSERVATION;
value = checkTF(value);
break;
case "showoccupancy":
- appName = Preferences.SHOW_OCCUPANCY;
+ prefName = Preferences.SHOW_OCCUPANCY;
value = checkTF(value);
break;
case "showquality":
- appName = Preferences.SHOW_QUALITY;
+ prefName = Preferences.SHOW_QUALITY;
value = checkTF(value);
break;
case "showsequencelogo":
- appName = Preferences.SHOW_CONSENSUS_LOGO;
+ prefName = Preferences.SHOW_CONSENSUS_LOGO;
value = checkTF(value);
break;
case "showfeaturegroups":
value = checkTF(value);
break;
case "showfeaturesettings":
- appName = "showFeatureSettings";
value = checkTF(value);
break;
case "showfullid":
- appName = "showFullId";
value = checkTF(value);
break;
case "showtreebootstraps":
- appName = "showTreeBootstraps";
value = checkTF(value);
break;
case "showtreedistances":
- appName = "showTreeDistances";
value = checkTF(value);
break;
case "showunconserved":
- appName = Preferences.SHOW_UNCONSERVED;
+ prefName = Preferences.SHOW_UNCONSERVED;
value = checkTF(value);
break;
case "showunlinkedtreenodes":
- appName = "showUnlinkedTreeNodes";
value = checkTF(value);
break;
default:
- // could be pdbFile2, for example
+ if (appletName.startsWith("pdbfile")
+ || appletName.startsWith("sequence") && Character.isDigit(
+ appletName.charAt(appletName.length() - 1)))
+ {
+ // could be pdbFile2, for example
+ prefName = argName = null;
+ value = resourcePath + value;
+ break;
+ }
// or one of the app preference names
break;
}
- if (value != null)
+ // put name and value into application args
+ if (value != null && argName != null)
{
- vargs.add(appName);
+ vargs.add(argName);
if (value != "true")
{
vargs.add(value);
{
value = "false";
}
- System.out.println("AppletParams appName=" + appName + "appletName="
+ System.out.println("AppletParams propName=" + prefName + " argName="
+ + argName + " appletName="
+ appletName + " value=" + value);
- Cache.setPropertyNoSave(appName, value);
if (appletName != null)
{
appletParams.put(appletName, value);
}
+ if (prefName != null)
+ {
+ Cache.setPropertyNoSave(prefName, value);
+ }
}
}
return appletParams;