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.structure.StructureSelectionManager;
28 import java.awt.Container;
29 import java.util.BitSet;
31 import org.jmol.api.JmolAppConsoleInterface;
32 import org.jmol.api.JmolViewer;
33 import org.jmol.popup.JmolPopup;
35 class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding
39 * Window that contains the bound Jmol instance
41 private AppletJmol appletJmolBinding;
43 public AppletJmolBinding(AppletJmol appletJmol,
44 StructureSelectionManager sSm, PDBEntry[] pdbentry,
45 SequenceI[][] seq, String[][] chains, String protocol)
47 super(sSm, pdbentry, seq, chains, protocol);
48 appletJmolBinding = appletJmol;
51 public jalview.api.FeatureRenderer getFeatureRenderer(
52 AlignmentViewPanel alignment)
54 AlignmentPanel ap = (AlignmentPanel) alignment;
55 if (appletJmolBinding.ap.av.isShowSequenceFeatures())
57 if (appletJmolBinding.fr == null)
59 appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(
60 appletJmolBinding.ap.av);
64 .transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas
65 .getFeatureRenderer());
68 return appletJmolBinding.fr;
71 public jalview.api.SequenceRenderer getSequenceRenderer(
72 AlignmentViewPanel alignment)
74 return new SequenceRenderer(((AlignmentPanel) alignment).av);
77 public void sendConsoleEcho(String strEcho)
79 if (appletJmolBinding.scriptWindow == null)
81 appletJmolBinding.showConsole(true);
84 appletJmolBinding.history.append("\n" + strEcho);
87 public void sendConsoleMessage(String strStatus)
89 if (appletJmolBinding.history != null && strStatus != null
90 && !strStatus.equals("Script completed"))
92 appletJmolBinding.history.append("\n" + strStatus);
96 public void showUrl(String url, String target)
98 appletJmolBinding.ap.alignFrame.showURL(url, target);
102 public void refreshGUI()
104 appletJmolBinding.updateTitleAndMenus();
107 public void updateColours(Object source)
109 AlignmentPanel ap = (AlignmentPanel) source;
110 colourBySequence(ap.av.isShowSequenceFeatures(), ap);
113 public void showUrl(String url)
117 appletJmolBinding.ap.av.applet.getAppletContext().showDocument(
118 new java.net.URL(url), "jmol");
119 } catch (java.net.MalformedURLException ex)
124 public void newJmolPopup(boolean translateLocale, String menuName,
128 jmolpopup = new JmolPopup();
129 jmolpopup.initialize(viewer, translateLocale, menuName, asPopup);
132 public void notifyScriptTermination(String strStatus, int msWalltime)
137 public void selectionChanged(BitSet arg0)
139 // TODO Auto-generated method stub
144 public void refreshPdbEntries()
150 public void showConsole(boolean show)
152 appletJmolBinding.showConsole(show);
156 protected JmolAppConsoleInterface createJmolConsole(JmolViewer viewer2,
157 Container consolePanel, String buttonsToShow)
159 // return new org.jmol.console.AppletConsole(viewer2, consolePanel);
160 JmolAppConsoleInterface appc = new org.jmol.console.AppletConsole()
161 .getAppConsole(viewer2);
166 protected void releaseUIResources()
168 appletJmolBinding = null;
173 public void releaseReferences(Object svl)
178 public void resizeInnerPanel(String data)
180 // TODO Auto-generated method stub