JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / src / jalview / appletgui / ExtJmol.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
11  *  
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.
16  * 
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.
20  */
21 package jalview.appletgui;
22
23 import jalview.api.AlignmentViewPanel;
24 import jalview.api.FeatureRenderer;
25 import jalview.api.SequenceRenderer;
26 import jalview.datamodel.PDBEntry;
27 import jalview.datamodel.SequenceI;
28 //import jalview.ext.jmol.JalviewJmolBinding;
29 import jalview.structure.AtomSpec;
30 import jalview.structure.StructureSelectionManager;
31 import jalview.structures.models.AAStructureBindingModel;
32
33 import java.awt.Container;
34 import java.util.ArrayList;
35 import java.util.List;
36 import java.util.Map;
37 import java.util.Vector;
38
39 //import org.jmol.api.JmolAppConsoleInterface;
40 //import org.jmol.java.BS;
41 import org.jmol.viewer.Viewer;
42
43 /**
44  * bind an alignment view to an external Jmol instance.
45  * 
46  * @author JimP
47  * 
48  */
49 public class ExtJmol  extends AAStructureBindingModel //extends JalviewJmolBinding
50 {
51
52         public ExtJmol(StructureSelectionManager ssm, PDBEntry[] pdbentry,
53                         SequenceI[][] sequenceIs, String[][] chains, String protocol) {
54                 super(ssm, pdbentry, sequenceIs, chains, protocol);
55                 // TODO Auto-generated constructor stub
56         }
57
58         @Override
59         public String[] getPdbFile() {
60                 // TODO Auto-generated method stub
61                 return null;
62         }
63
64         @Override
65         public void updateColours(Object source) {
66                 // TODO Auto-generated method stub
67                 
68         }
69
70         @Override
71         public void releaseReferences(Object svl) {
72                 // TODO Auto-generated method stub
73                 
74         }
75
76         @Override
77         public void highlightAtoms(List<AtomSpec> atoms) {
78                 // TODO Auto-generated method stub
79                 
80         }
81
82 //  private AlignmentPanel ap;
83 //
84 //  protected ExtJmol(jalview.appletgui.AlignFrame alframe,
85 //          PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains,
86 //          String protocol)
87 //  {
88 //    super(alframe.alignPanel.getStructureSelectionManager(), pdbentry, seq,
89 //            chains, protocol);
90 //  }
91 //
92 //  public ExtJmol(Viewer viewer, AlignmentPanel alignPanel,
93 //          SequenceI[][] seqs)
94 //  {
95 //    super(alignPanel.getStructureSelectionManager(), seqs, viewer);
96 //    ap = alignPanel;
97 //    notifyFileLoaded(null, null, null, null, 0);
98 //  }
99 //
100 //  public void updateColours(Object source)
101 //  {
102 //
103 //    // TODO Auto-generated method stub
104 //
105 //  }
106 //
107 //  public void showUrl(String arg0)
108 //  {
109 //    showUrl(arg0, "jmol");
110 //  }
111 //
112 //  @Override
113 //  public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment)
114 //  {
115 //    AlignmentPanel ap = (AlignmentPanel) alignment;
116 //    if (ap.av.isShowSequenceFeatures())
117 //    {
118 //      return ap.getFeatureRenderer();
119 //    }
120 //    else
121 //    {
122 //      return null;
123 //    }
124 //  }
125 //
126 //  @Override
127 //  public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment)
128 //  {
129 //    return ((AlignmentPanel) alignment).getSequenceRenderer();
130 //  }
131 //
132 //  @Override
133 //  public void notifyScriptTermination(String strStatus, int msWalltime)
134 //  {
135 //    // ignore
136 //  }
137 //
138 //  @Override
139 //  public void sendConsoleEcho(String strEcho)
140 //  {
141 //    // ignore
142 //  }
143 //
144 //  @Override
145 //  public void sendConsoleMessage(String strStatus)
146 //  {
147 //    // ignore
148 //  }
149 //
150 //  @Override
151 //  public void showUrl(String url, String target)
152 //  {
153 //    ap.alignFrame.showURL(url, target);
154 //  }
155 //
156 //  @Override
157 //  public void refreshGUI()
158 //  {
159 //    // ignore
160 //  }
161 //
162 //  public void selectionChanged(BS arg0)
163 //  {
164 //    System.out.println(arg0);
165 //  }
166 //
167 //  @Override
168 //  public void refreshPdbEntries()
169 //  {
170 //    List<PDBEntry> pdbe = new ArrayList<PDBEntry>();
171 //    List<String> fileids = new ArrayList<String>();
172 //    SequenceI[] sq = ap.av.getAlignment().getSequencesArray();
173 //    for (int s = 0; s < sq.length; s++)
174 //    {
175 //      Vector<PDBEntry> pdbids = sq[s].getPDBId();
176 //      if (pdbids != null)
177 //      {
178 //        for (int pe = 0, peSize = pdbids.size(); pe < peSize; pe++)
179 //        {
180 //          PDBEntry pentry = pdbids.elementAt(pe);
181 //          if (!fileids.contains(pentry.getId()))
182 //          {
183 //            pdbe.add(pentry);
184 //          }
185 //          else
186 //          {
187 //            fileids.add(pentry.getId());
188 //          }
189 //        }
190 //      }
191 //    }
192 //    PDBEntry[] newEntries = new PDBEntry[pdbe.size()];
193 //    for (int pe = 0; pe < pdbe.size(); pe++)
194 //    {
195 //      newEntries[pe] = pdbe.get(pe);
196 //    }
197 //    setPdbentry(newEntries);
198 //  }
199 //
200 //  @Override
201 //  public void showConsole(boolean show)
202 //  {
203 //    // This never gets called because we haven't overriden the associated Jmol's
204 //    // console
205 //    System.err
206 //            .println("WARNING: unexpected call to ExtJmol's showConsole method. (showConsole="
207 //                    + show);
208 //  }
209 //
210 //  @Override
211 //  protected JmolAppConsoleInterface createJmolConsole(
212 //          Container consolePanel, String buttonsToShow)
213 //  {
214 //    // TODO Auto-generated method stub
215 //    return null;
216 //  }
217 //
218 //  @Override
219 //  protected void releaseUIResources()
220 //  {
221 //    ap = null;
222 //    closeConsole();
223 //
224 //  }
225 //
226 //  @Override
227 //  public void releaseReferences(Object svl)
228 //  {
229 //    // TODO Auto-generated method stub
230 //
231 //  }
232 //
233 //  @Override
234 //  public Map<String, Object> getJSpecViewProperty(String arg0)
235 //  {
236 //    // TODO Auto-generated method stub
237 //    return null;
238 //  }
239 //
240 }