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 org.jmol.api.JmolAppConsoleInterface;
33 import org.jmol.console.AppletConsole;
34 import org.jmol.java.BS;
36 class AppletJmolBinding extends JalviewJmolBinding
40 * Window that contains the bound Jmol instance
42 private AppletJmol appletJmolBinding;
44 public AppletJmolBinding(AppletJmol appletJmol,
45 StructureSelectionManager sSm, PDBEntry[] pdbentry,
46 SequenceI[][] seq, String protocol)
48 super(sSm, pdbentry, seq, protocol);
49 appletJmolBinding = appletJmol;
53 public jalview.api.FeatureRenderer getFeatureRenderer(
54 AlignmentViewPanel alignment)
56 AlignmentPanel ap = (AlignmentPanel) alignment;
57 if (appletJmolBinding.ap.av.isShowSequenceFeatures())
59 if (appletJmolBinding.fr == null)
61 appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(
62 appletJmolBinding.ap.av);
66 .transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas
67 .getFeatureRenderer());
70 return appletJmolBinding.fr;
74 public jalview.api.SequenceRenderer getSequenceRenderer(
75 AlignmentViewPanel alignment)
77 return new SequenceRenderer(((AlignmentPanel) alignment).av);
81 public void sendConsoleEcho(String strEcho)
83 if (appletJmolBinding.scriptWindow == null)
85 appletJmolBinding.showConsole(true);
88 appletJmolBinding.addToHistory(strEcho);
92 public void sendConsoleMessage(String strStatus)
94 if (appletJmolBinding.history != null && strStatus != null
95 && !strStatus.equals("Script completed"))
97 appletJmolBinding.addToHistory(strStatus);
102 public void showUrl(String url, String target)
104 appletJmolBinding.ap.alignFrame.showURL(url, target);
109 public void refreshGUI()
111 appletJmolBinding.updateTitleAndMenus();
115 public void updateColours(Object source)
117 AlignmentPanel ap = (AlignmentPanel) source;
118 colourBySequence(ap);
122 public void showUrl(String url)
126 appletJmolBinding.ap.av.applet.getAppletContext().showDocument(
127 new java.net.URL(url), "jmol");
128 } catch (java.net.MalformedURLException ex)
133 public void newJmolPopup(boolean translateLocale, String menuName,
136 // jmolpopup = new JmolAwtPopup(); // is this used?
137 // jmolpopup.jpiInitialize((viewer), menuName);
141 public void notifyScriptTermination(String strStatus, int msWalltime)
147 public void selectionChanged(BS arg0)
149 // TODO Auto-generated method stub
154 public void refreshPdbEntries()
160 public void showConsole(boolean show)
162 appletJmolBinding.showConsole(show);
166 protected JmolAppConsoleInterface createJmolConsole(
167 Container consolePanel, String buttonsToShow)
169 JmolAppConsoleInterface appc = new AppletConsole();
175 protected void releaseUIResources()
177 appletJmolBinding = null;
182 public void releaseReferences(Object svl)
187 public int[] resizeInnerPanel(String data)
189 // TODO Auto-generated method stub
194 public Map<String, Object> getJSpecViewProperty(String arg0)
196 // TODO Auto-generated method stub