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.gui.IProgressIndicator;
28 import jalview.io.DataSourceType;
29 import jalview.structure.StructureSelectionManager;
31 import java.awt.Container;
34 import org.jmol.api.JmolAppConsoleInterface;
35 import org.jmol.console.AppletConsole;
36 import org.jmol.java.BS;
38 class AppletJmolBinding extends JalviewJmolBinding
42 * Window that contains the bound Jmol instance
44 private AppletJmol appletJmolBinding;
46 public AppletJmolBinding(AppletJmol appletJmol,
47 StructureSelectionManager sSm, PDBEntry[] pdbentry,
48 SequenceI[][] seq, DataSourceType protocol)
50 super(sSm, pdbentry, seq, protocol);
51 appletJmolBinding = appletJmol;
55 public jalview.api.FeatureRenderer getFeatureRenderer(
56 AlignmentViewPanel alignment)
58 return appletJmolBinding.ap.getFeatureRenderer();
62 public void sendConsoleEcho(String strEcho)
64 if (appletJmolBinding.scriptWindow == null)
66 appletJmolBinding.showConsole(true);
69 appletJmolBinding.addToHistory(strEcho);
73 public void sendConsoleMessage(String strStatus)
75 if (appletJmolBinding.history != null && strStatus != null
76 && !strStatus.equals("Script completed"))
78 appletJmolBinding.addToHistory(strStatus);
83 public void showUrl(String url, String target)
85 appletJmolBinding.ap.alignFrame.showURL(url, target);
90 public void refreshGUI()
92 appletJmolBinding.updateTitleAndMenus();
96 public void updateColours(Object source)
98 AlignmentPanel ap = (AlignmentPanel) source;
99 colourBySequence(ap, ap.av.isShowSequenceFeatures());
103 public void showUrl(String url)
107 appletJmolBinding.ap.av.applet.getAppletContext()
108 .showDocument(new java.net.URL(url), "jmol");
109 } catch (java.net.MalformedURLException ex)
114 public void newJmolPopup(boolean translateLocale, String menuName,
117 // jmolpopup = new JmolAwtPopup(); // is this used?
118 // jmolpopup.jpiInitialize((viewer), menuName);
122 public void notifyScriptTermination(String strStatus, int msWalltime)
128 public void selectionChanged(BS arg0)
130 // TODO Auto-generated method stub
135 public void refreshPdbEntries()
141 public void showConsole(boolean show)
143 appletJmolBinding.showConsole(show);
147 protected JmolAppConsoleInterface createJmolConsole(
148 Container consolePanel, String buttonsToShow)
150 JmolAppConsoleInterface appc = new AppletConsole();
156 protected void releaseUIResources()
158 appletJmolBinding = null;
163 public void releaseReferences(Object svl)
168 public int[] resizeInnerPanel(String data)
170 // TODO Auto-generated method stub
175 public Map<String, Object> getJSpecViewProperty(String arg0)
177 // TODO Auto-generated method stub
182 protected IProgressIndicator getIProgressIndicator()
184 // no progress indicators on the applet