+
+ /**
+ * 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;
+ }
+ /**
+ * bind a pdb file to a sequence in the given alignFrame.
+ * @param alFrame - null or specific alignFrame. This specifies the dataset that will be searched for a seuqence called sequenceId
+ * @param sequenceId - sequenceId within the dataset.
+ * @param pdbEntryString - the short name for the PDB file
+ * @param pdbFile - pdb file - either a URL or a valid PDB file.
+ * @return true if binding was as success
+ * TODO: consider making an exception structure for indicating when PDB parsing or seqeunceId location fails.
+ */
+ public boolean addPdbFile(AlignFrame alFrame, String sequenceId, String pdbEntryString, String pdbFile)
+ {
+ System.err.println("addPdbFile not yet implemented.");
+ return true;
+ }
+ /**
+ * bind the viewer instance to the pdbFile associated with sequences in the given alFrame.
+ * @param alFrame
+ * @param pdbFile - pdbFile URI as given via applet's parameters or by addPdb
+ * @param viewer
+ * @return binding for viewer
+ * TODO: consider making an exception structure for indicating when binding fails
+ */
+ public SequenceStructureBinding addJmolInstance(AlignFrame alFrame, String pdbFile, org.jmol.api.JmolViewer viewer)
+ {
+ System.err.println("addJmolInstance not yet implemented.");
+ /**
+ */
+ return null;
+ }
+ /**
+ * bind structures in a viewer to any matching sequences in an alignFrame (use seuqenceIds to limit scope of search to specific sequences)
+ * @param alFrame
+ * @param viewer
+ * @param sequenceIds
+ * @return
+ */
+ public SequenceStructureBinding addJmolInstance(AlignFrame alFrame, org.jmol.api.JmolViewer viewer, String sequenceIds)
+ {
+ if (viewer!=null)
+ {
+ if (sequenceIds!=null && sequenceIds.length()>0)
+ {
+ return alFrame.addJmolInstance(viewer, separatorListToArray(sequenceIds));
+ } else {
+ return alFrame.addJmolInstance(viewer, null);
+ }
+ }
+ return null;
+ }