6 import java.util.BitSet;
7 import java.util.Vector;
9 import jalview.bin.Cache;
10 import jalview.datamodel.PDBEntry;
11 import jalview.datamodel.SequenceI;
13 import org.jmol.popup.JmolPopup;
15 class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding
21 private AppJmol appJmolWindow;
23 public AppJmolBinding(AppJmol appJmol, PDBEntry[] pdbentry,
24 SequenceI[] seq, String[] chains, String protocol)
26 super(pdbentry, seq, chains, protocol);
27 appJmolWindow = appJmol;
29 FeatureRenderer fr=null;
31 public jalview.api.FeatureRenderer getFeatureRenderer()
33 if (appJmolWindow.ap.av.showSequenceFeatures)
37 fr = new FeatureRenderer(appJmolWindow.ap);
40 fr.transferSettings(appJmolWindow.ap.seqPanel.seqCanvas
41 .getFeatureRenderer());
48 public jalview.api.SequenceRenderer getSequenceRenderer()
50 return new SequenceRenderer(appJmolWindow.ap.av);
53 public void sendConsoleEcho(String strEcho)
55 if (appJmolWindow.scriptWindow != null)
57 appJmolWindow.scriptWindow.sendConsoleEcho(strEcho);
61 public void sendConsoleMessage(String strStatus)
63 if (appJmolWindow.scriptWindow!=null && strStatus != null
65 // && !strStatus.equals("Script completed"))
66 // should we squash the script completed string ?
68 appJmolWindow.scriptWindow.sendConsoleMessage(strStatus);
73 public void showUrl(String url, String target)
76 jalview.util.BrowserLauncher.openURL(url);
77 } catch (Exception e) {
78 Cache.log.error("Failed to launch Jmol-associated url " + url, e);
79 // TODO: 2.6 : warn user if browser was not configured.
84 public void refreshGUI()
86 // appJmolWindow.repaint();
87 appJmolWindow.updateTitleAndMenus();
90 public void updateColours(Object source)
92 AlignmentPanel ap = (AlignmentPanel) source;
93 if (appJmolWindow.ap.alignFrame.getCurrentView()!=ap.av)
96 colourBySequence(ap.av.getShowSequenceFeatures(), ap.av.alignment);
99 public void notifyScriptTermination(String strStatus, int msWalltime)
101 if (appJmolWindow.scriptWindow != null)
102 appJmolWindow.scriptWindow.notifyScriptTermination(strStatus, msWalltime);
105 public void showUrl(String url)
110 public void newJmolPopup(boolean translateLocale, String menuName,
114 jmolpopup = JmolPopup.newJmolPopup(viewer, translateLocale, menuName,
117 public synchronized void addSequence(SequenceI[] seq)
119 Vector v = new Vector();
120 for (int i = 0; i < sequence.length; i++)
121 v.addElement(sequence[i]);
123 for (int i = 0; i < seq.length; i++)
124 if (!v.contains(seq[i]))
125 v.addElement(seq[i]);
127 SequenceI[] tmp = new SequenceI[v.size()];
132 public void selectionChanged(BitSet arg0)
134 // TODO Auto-generated method stub
138 public void refreshPdbEntries()
140 // TODO Auto-generated method stub