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;
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, String[][] chains, String protocol)
50 super(sSm, pdbentry, seq, chains, protocol);
51 appletJmolBinding = appletJmol;
55 public jalview.api.FeatureRenderer getFeatureRenderer(
56 AlignmentViewPanel alignment)
58 AlignmentPanel ap = (AlignmentPanel) alignment;
59 if (appletJmolBinding.ap.av.isShowSequenceFeatures())
61 if (appletJmolBinding.fr == null)
63 appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(
64 appletJmolBinding.ap.av);
68 .transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas
69 .getFeatureRenderer());
72 return appletJmolBinding.fr;
76 public jalview.api.SequenceRenderer getSequenceRenderer(
77 AlignmentViewPanel alignment)
79 return new SequenceRenderer(((AlignmentPanel) alignment).av);
83 public void sendConsoleEcho(String strEcho)
85 if (appletJmolBinding.scriptWindow == null)
87 appletJmolBinding.showConsole(true);
90 appletJmolBinding.history.append("\n" + strEcho);
94 public void sendConsoleMessage(String strStatus)
96 if (appletJmolBinding.history != null && strStatus != null
97 && !strStatus.equals("Script completed"))
99 appletJmolBinding.history.append("\n" + strStatus);
104 public void showUrl(String url, String target)
106 appletJmolBinding.ap.alignFrame.showURL(url, target);
111 public void refreshGUI()
113 appletJmolBinding.updateTitleAndMenus();
116 public void updateColours(Object source)
118 AlignmentPanel ap = (AlignmentPanel) source;
119 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)
146 public void selectionChanged(BS arg0)
148 // TODO Auto-generated method stub
153 public void refreshPdbEntries()
159 public void showConsole(boolean show)
161 appletJmolBinding.showConsole(show);
165 protected JmolAppConsoleInterface createJmolConsole(
166 Container consolePanel, String buttonsToShow)
168 JmolAppConsoleInterface appc = new AppletConsole();
174 protected void releaseUIResources()
176 appletJmolBinding = null;
181 public void releaseReferences(Object svl)
186 public Dimension resizeInnerPanel(String data)
188 // TODO Auto-generated method stub
193 public Map<String, Object> getJSpecViewProperty(String arg0)
195 // TODO Auto-generated method stub