2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
\r
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3
\r
10 * of the License, or (at your option) any later version.
\r
12 * Jalview is distributed in the hope that it will be useful, but
\r
13 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
15 * PURPOSE. See the GNU General Public License for more details.
\r
17 * You should have received a copy of the GNU General Public License
\r
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
\r
21 package jalview.appletgui;
\r
23 import jalview.api.AlignmentViewPanel;
\r
24 import jalview.api.FeatureRenderer;
\r
25 import jalview.api.SequenceRenderer;
\r
26 import jalview.datamodel.PDBEntry;
\r
27 import jalview.datamodel.SequenceI;
\r
28 import jalview.ext.jmol.JalviewJmolBinding;
\r
30 import java.awt.Container;
\r
31 import java.util.ArrayList;
\r
32 import java.util.List;
\r
33 import java.util.Map;
\r
34 import java.util.Vector;
\r
36 import org.jmol.api.JmolAppConsoleInterface;
\r
37 import org.jmol.java.BS;
\r
38 import org.jmol.viewer.Viewer;
\r
41 * bind an alignment view to an external Jmol instance.
\r
46 public class ExtJmol extends JalviewJmolBinding
\r
49 private AlignmentPanel ap;
\r
51 protected ExtJmol(jalview.appletgui.AlignFrame alframe,
\r
52 PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains,
\r
55 super(alframe.alignPanel.getStructureSelectionManager(), pdbentry, seq,
\r
59 public ExtJmol(Viewer viewer, AlignmentPanel alignPanel,
\r
62 super(alignPanel.getStructureSelectionManager(), seqs, viewer);
\r
64 notifyFileLoaded(null, null, null, null, 0);
\r
67 private void notifyFileLoaded(Object object, Object object2, Object object3,
\r
68 Object object4, int i) {
\r
69 // TODO Auto-generated method stub
\r
73 public void updateColours(Object source)
\r
76 // TODO Auto-generated method stub
\r
80 public void showUrl(String arg0)
\r
82 showUrl(arg0, "jmol");
\r
86 public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment)
\r
88 AlignmentPanel ap = (AlignmentPanel) alignment;
\r
89 if (ap.av.isShowSequenceFeatures())
\r
91 return ap.getFeatureRenderer();
\r
100 public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment)
\r
102 return ((AlignmentPanel) alignment).getSequenceRenderer();
\r
106 public void notifyScriptTermination(String strStatus, int msWalltime)
\r
112 public void sendConsoleEcho(String strEcho)
\r
118 public void sendConsoleMessage(String strStatus)
\r
124 public void showUrl(String url, String target)
\r
126 ap.alignFrame.showURL(url, target);
\r
130 public void refreshGUI()
\r
135 public void selectionChanged(BS arg0)
\r
137 System.out.println(arg0);
\r
141 public void refreshPdbEntries()
\r
143 List<PDBEntry> pdbe = new ArrayList<PDBEntry>();
\r
144 List<String> fileids = new ArrayList<String>();
\r
145 SequenceI[] sq = ap.av.getAlignment().getSequencesArray();
\r
146 for (int s = 0; s < sq.length; s++)
\r
148 Vector<PDBEntry> pdbids = sq[s].getPDBId();
\r
149 if (pdbids != null)
\r
151 for (int pe = 0, peSize = pdbids.size(); pe < peSize; pe++)
\r
153 PDBEntry pentry = pdbids.elementAt(pe);
\r
154 if (!fileids.contains(pentry.getId()))
\r
160 fileids.add(pentry.getId());
\r
165 PDBEntry[] newEntries = new PDBEntry[pdbe.size()];
\r
166 for (int pe = 0; pe < pdbe.size(); pe++)
\r
168 newEntries[pe] = pdbe.get(pe);
\r
170 setPdbentry(newEntries);
\r
174 public void showConsole(boolean show)
\r
176 // This never gets called because we haven't overriden the associated Jmol's
\r
179 .println("WARNING: unexpected call to ExtJmol's showConsole method. (showConsole="
\r
184 protected JmolAppConsoleInterface createJmolConsole(
\r
185 Container consolePanel, String buttonsToShow)
\r
187 // TODO Auto-generated method stub
\r
192 protected void releaseUIResources()
\r
200 public void releaseReferences(Object svl)
\r
202 // TODO Auto-generated method stub
\r
207 public Map<String, Object> getJSpecViewProperty(String arg0)
\r
209 // TODO Auto-generated method stub
\r