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.io.DataSourceType;
28 import jalview.structure.StructureSelectionManager;
30 import java.awt.Container;
33 import org.jmol.api.JmolAppConsoleInterface;
34 import org.jmol.console.AppletConsole;
35 import javajs.util.BS;
37 class AppletJmolBinding extends JalviewJmolBinding
41 * Window that contains the bound Jmol instance
43 private AppletJmol appletJmolBinding;
45 public AppletJmolBinding(AppletJmol appletJmol,
46 StructureSelectionManager sSm, PDBEntry[] pdbentry,
47 SequenceI[][] seq, DataSourceType protocol)
49 super(sSm, pdbentry, seq, protocol);
50 appletJmolBinding = appletJmol;
54 public jalview.api.SequenceRenderer getSequenceRenderer(
55 AlignmentViewPanel alignment)
57 return new SequenceRenderer(((AlignmentPanel) alignment).av);
61 public void sendConsoleEcho(String strEcho)
63 if (appletJmolBinding.scriptWindow == null)
65 appletJmolBinding.showConsole(true);
68 appletJmolBinding.addToHistory(strEcho);
72 public void sendConsoleMessage(String strStatus)
74 if (appletJmolBinding.history != null && strStatus != null
75 && !strStatus.equals("Script completed"))
77 appletJmolBinding.addToHistory(strStatus);
82 public void showUrl(String url, String target)
84 appletJmolBinding.ap.alignFrame.showURL(url, target);
89 public void refreshGUI()
91 appletJmolBinding.updateTitleAndMenus();
95 public void updateColours(Object source)
97 AlignmentPanel ap = (AlignmentPanel) source;
102 public void showUrl(String url)
106 appletJmolBinding.ap.av.applet.getAppletContext()
107 .showDocument(new java.net.URL(url), "jmol");
108 } catch (java.net.MalformedURLException ex)
113 public void newJmolPopup(boolean translateLocale, String menuName,
116 // jmolpopup = new JmolAwtPopup(); // is this used?
117 // jmolpopup.jpiInitialize((viewer), menuName);
121 public void notifyScriptTermination(String strStatus, int msWalltime)
127 public void selectionChanged(BS arg0)
129 // TODO Auto-generated method stub
134 public void refreshPdbEntries()
140 public void showConsole(boolean show)
142 appletJmolBinding.showConsole(show);
146 protected JmolAppConsoleInterface createJmolConsole(
147 Container consolePanel, String buttonsToShow)
149 JmolAppConsoleInterface appc = new AppletConsole();
150 appc.start(jmolViewer);
155 protected void releaseUIResources()
157 appletJmolBinding = null;
162 public void releaseReferences(Object svl)
167 public int[] resizeInnerPanel(String data)
173 public Map<String, Object> getJSpecViewProperty(String arg0)