* create a new binding between structures in an existing jmol viewer instance
* and an alignpanel with sequences that have existing PDBFile entries. Note,
* this does not open a new Jmol window, or modify the display of the
- * structures in the original jmol window.
+ * structures in the original jmol window. Note
*
* @param viewer JmolViewer instance
* @param sequenceIds
* - sequence Ids to search for associations
- */
+ * This method doesn't work. See http://issues.jalview.org/browse/JAL-621
+ *
public SequenceStructureBinding addStructureViewInstance(Object jmolviewer, String[] sequenceIds)
{
- org.jmol.api.JmolViewer viewer;
- if (jmolviewer instanceof JmolViewer)
- {
+ org.jmol.api.JmolViewer viewer=null;
+ try {
+ viewer = (org.jmol.api.JmolViewer) jmolviewer;
+ }
+ catch (ClassCastException ex) {
System.err.println("Unsupported viewer object :"+jmolviewer.getClass());
+ }
+ if (viewer==null)
+ {
+ System.err.println("Can't use this object as a structure viewer:"+jmolviewer.getClass());
return null;
- } else {
- viewer = (JmolViewer) jmolviewer;
}
SequenceI[] seqs=null;
if (sequenceIds==null || sequenceIds.length==0)
{
seqs[sid] = (SequenceI) sqi.elementAt(sid);
}
+ } else {
+ return null;
}
}
ExtJmol jmv=null;
return jmv;
}
-
+ **/
public boolean addPdbFile(String sequenceId, String pdbEntryString,
String pdbFile)
{
public void newStructureView(JalviewLite applet, PDBEntry pdb, SequenceI[] seqs,
String[] chains, String protocol)
{
+ if (seqs!=null)
+ {
+ Vector sequences=new Vector();
+ for (int i=0;i<seqs.length;i++) {
+ if (seqs[i]!=null)
+ {
+ sequences.addElement(seqs[i]);
+ }
+ }
+ seqs = new SequenceI[sequences.size()];
+ for (int i=0,isize=sequences.size(); i<isize; i++)
+ {
+ seqs[i] = (SequenceI) sequences.elementAt(i);
+ }
+ }
+ if (seqs==null || seqs.length==0)
+ {
+ System.err.println("JalviewLite.AlignFrame:newStructureView: No sequence to bind structure to.");
+ }
if (protocol==null || protocol.trim().length()==0 || protocol.equals("null"))
{
protocol = (String) pdb.getProperty().get("protocol");