2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.appletgui;
23 import jalview.api.AlignmentViewPanel;
24 import jalview.datamodel.PDBEntry;
25 import jalview.datamodel.SequenceI;
26 import jalview.ext.jmol.JalviewJmolBinding;
27 import jalview.structure.StructureSelectionManager;
29 import java.awt.Container;
32 import javajs.awt.Dimension;
34 import org.jmol.api.JmolAppConsoleInterface;
35 import org.jmol.console.AppletConsole;
36 import org.jmol.java.BS;
37 import org.jmol.popup.JmolAwtPopup;
39 class AppletJmolBinding extends JalviewJmolBinding
43 * Window that contains the bound Jmol instance
45 private AppletJmol appletJmolBinding;
47 public AppletJmolBinding(AppletJmol appletJmol,
48 StructureSelectionManager sSm, PDBEntry[] pdbentry,
49 SequenceI[][] seq, String[][] chains, String protocol)
51 super(sSm, pdbentry, seq, chains, protocol);
52 appletJmolBinding = appletJmol;
56 public jalview.api.FeatureRenderer getFeatureRenderer(
57 AlignmentViewPanel alignment)
59 AlignmentPanel ap = (AlignmentPanel) alignment;
60 if (appletJmolBinding.ap.av.isShowSequenceFeatures())
62 if (appletJmolBinding.fr == null)
64 appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(
65 appletJmolBinding.ap.av);
69 .transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas
70 .getFeatureRenderer());
73 return appletJmolBinding.fr;
77 public jalview.api.SequenceRenderer getSequenceRenderer(
78 AlignmentViewPanel alignment)
80 return new SequenceRenderer(((AlignmentPanel) alignment).av);
84 public void sendConsoleEcho(String strEcho)
86 if (appletJmolBinding.scriptWindow == null)
88 appletJmolBinding.showConsole(true);
91 appletJmolBinding.history.append("\n" + strEcho);
95 public void sendConsoleMessage(String strStatus)
97 if (appletJmolBinding.history != null && strStatus != null
98 && !strStatus.equals("Script completed"))
100 appletJmolBinding.history.append("\n" + strStatus);
105 public void showUrl(String url, String target)
107 appletJmolBinding.ap.alignFrame.showURL(url, target);
112 public void refreshGUI()
114 appletJmolBinding.updateTitleAndMenus();
117 public void updateColours(Object source)
119 AlignmentPanel ap = (AlignmentPanel) source;
120 colourBySequence(ap.av.isShowSequenceFeatures(), ap);
123 public void showUrl(String url)
127 appletJmolBinding.ap.av.applet.getAppletContext().showDocument(
128 new java.net.URL(url), "jmol");
129 } catch (java.net.MalformedURLException ex)
134 public void newJmolPopup(boolean translateLocale, String menuName,
137 jmolpopup = new JmolAwtPopup(); // is this used?
138 jmolpopup.jpiInitialize((viewer), menuName);
143 public void notifyScriptTermination(String strStatus, int msWalltime)
148 public void selectionChanged(BS arg0)
150 // TODO Auto-generated method stub
155 public void refreshPdbEntries()
161 public void showConsole(boolean show)
163 appletJmolBinding.showConsole(show);
167 protected JmolAppConsoleInterface createJmolConsole(
168 Container consolePanel, String buttonsToShow)
170 JmolAppConsoleInterface appc = new AppletConsole();
176 protected void releaseUIResources()
178 appletJmolBinding = null;
183 public void releaseReferences(Object svl)
188 public Dimension resizeInnerPanel(String data)
190 // TODO Auto-generated method stub
195 public Map<String, Object> getJSpecViewProperty(String arg0)
197 // TODO Auto-generated method stub