1 package jalview.appletgui;
3 import java.awt.Container;
4 import java.util.BitSet;
5 import java.util.Hashtable;
6 import java.util.Vector;
8 import org.jmol.api.JmolAppConsoleInterface;
9 import org.jmol.api.JmolViewer;
11 import jalview.api.FeatureRenderer;
12 import jalview.api.SequenceRenderer;
13 import jalview.datamodel.PDBEntry;
14 import jalview.datamodel.SequenceI;
15 import jalview.ext.jmol.JalviewJmolBinding;
18 * bind an alignment view to an external Jmol instance.
22 public class ExtJmol extends JalviewJmolBinding
25 private AlignmentPanel ap;
27 protected ExtJmol(jalview.appletgui.AlignFrame alframe, PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains,
30 super(pdbentry, seq, chains, protocol);
33 public ExtJmol(JmolViewer viewer, AlignmentPanel alignPanel,
39 notifyFileLoaded(null, null, null, null, 0);
42 public void updateColours(Object source)
45 // TODO Auto-generated method stub
49 public void showUrl(String arg0)
51 showUrl(arg0, "jmol");
54 public FeatureRenderer getFeatureRenderer()
56 if (ap.av.showSequenceFeatures)
58 return ap.getFeatureRenderer();
66 public SequenceRenderer getSequenceRenderer()
68 return ap.getSequenceRenderer();
71 public void notifyScriptTermination(String strStatus, int msWalltime)
76 public void sendConsoleEcho(String strEcho)
81 public void sendConsoleMessage(String strStatus)
86 public void showUrl(String url, String target)
88 ap.alignFrame.showURL(url, target);
91 public void refreshGUI()
96 public void selectionChanged(BitSet arg0)
98 System.out.println(arg0);
101 public void refreshPdbEntries()
103 Vector pdbe = new Vector();
104 Hashtable fileids = new Hashtable();
105 SequenceI[] sq = ap.av.getAlignment().getSequencesArray();
106 for (int s=0;s<sq.length;s++)
108 Vector pdbids = sq[s].getPDBId();
111 for (int pe=0,peSize=pdbids.size(); pe<peSize; pe++)
113 PDBEntry pentry = (PDBEntry) pdbids.elementAt(pe);
114 if (!fileids.containsKey(pentry.getId())) {
115 pdbe.addElement(pentry);
120 pdbentry = new PDBEntry[pdbe.size()];
121 for (int pe=0;pe<pdbe.size(); pe++)
123 pdbentry[pe] = (PDBEntry) pdbe.elementAt(pe);
128 public void showConsole(boolean show)
130 // This never gets called because we haven't overriden the associated Jmol's console
131 System.err.println("WARNING: unexpected call to ExtJmol's showConsole method. (showConsole="+show);
135 protected JmolAppConsoleInterface createJmolConsole(JmolViewer viewer2,
136 Container consolePanel, String buttonsToShow)
138 // TODO Auto-generated method stub