import java.awt.*;
import java.awt.event.*;
+import org.jmol.api.JmolViewer;
+
import jalview.analysis.*;
+import jalview.api.SequenceStructureBinding;
import jalview.bin.JalviewLite;
import jalview.commands.*;
import jalview.datamodel.*;
DEFAULT_HEIGHT);
}
}
+
+ public SequenceStructureBinding addJmolInstance(JmolViewer viewer, String[] sequenceIds)
+ {
+ SequenceI[] seqs=null;
+ if (sequenceIds==null || sequenceIds.length==0)
+ {
+ seqs = viewport.getAlignment().getSequencesArray();
+ } else {
+ // resolve seqs for sequenceIds.
+ }
+ if (// viewer is not mapped)
+ true){
+ AppletJmol jmv = new AppletJmol(viewer, alignPanel, seqs);
+ return jmv;
+ }
+ return null;
+
+ }
}
import java.io.InputStreamReader;
import java.util.*;
+import jalview.api.SequenceStructureBinding;
import jalview.appletgui.*;
import jalview.datamodel.*;
import jalview.io.*;
* @param alFrame
* @param pdbFile - pdbFile URI as given via applet's parameters or by addPdb
* @param viewer
- * @return true if instance was bound corectly.
+ * @return binding for viewer
* TODO: consider making an exception structure for indicating when binding fails
*/
- public boolean addJmolInstance(AlignFrame alFrame, String pdbFile, org.jmol.api.JmolViewer viewer)
+ 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)
{
-/* viewer.getFrameCount
- }
- String alreadyMapped = StructureSelectionManager
- .getStructureSelectionManager().alreadyMappedToFile(
- pdbentry.getId());
-MCview.PDBfile reader = null;
-if (alreadyMapped != null)
-{
-reader = StructureSelectionManager.getStructureSelectionManager()
- .setMapping(seq, chains, pdbentry.getFile(), protocol);
-
- } */
+ if (sequenceIds!=null && sequenceIds.length()>0)
+ {
+ return alFrame.addJmolInstance(viewer, separatorListToArray(sequenceIds));
+ } else {
+ return alFrame.addJmolInstance(viewer, null);
+ }
}
- return false;
+ return null;
}
-
}