1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui; |
22 |
|
|
23 |
|
import jalview.api.AlignmentViewPanel; |
24 |
|
import jalview.api.structures.JalviewStructureDisplayI; |
25 |
|
import jalview.bin.Cache; |
26 |
|
import jalview.datamodel.PDBEntry; |
27 |
|
import jalview.datamodel.SequenceI; |
28 |
|
import jalview.ext.jmol.JalviewJmolBinding; |
29 |
|
import jalview.io.DataSourceType; |
30 |
|
import jalview.structure.StructureSelectionManager; |
31 |
|
|
32 |
|
import java.awt.Container; |
33 |
|
import java.util.Map; |
34 |
|
|
35 |
|
import org.jmol.api.JmolAppConsoleInterface; |
36 |
|
import javajs.util.BS; |
37 |
|
import org.openscience.jmol.app.jmolpanel.console.AppConsole; |
38 |
|
|
|
|
| 64.7% |
Uncovered Elements: 24 (68) |
Complexity: 30 |
Complexity Density: 0.91 |
|
39 |
|
public class AppJmolBinding extends JalviewJmolBinding |
40 |
|
{ |
41 |
|
private AppJmol appJmolWindow; |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
43 |
10 |
public AppJmolBinding(AppJmol appJmol, StructureSelectionManager sSm,... |
44 |
|
PDBEntry[] pdbentry, SequenceI[][] sequenceIs, |
45 |
|
DataSourceType protocol) |
46 |
|
{ |
47 |
10 |
super(sSm, pdbentry, sequenceIs, protocol); |
48 |
10 |
appJmolWindow = appJmol; |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
12 |
@Override... |
52 |
|
protected IProgressIndicator getIProgressIndicator() |
53 |
|
{ |
54 |
12 |
return appJmolWindow.progressBar; |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
9 |
@Override... |
58 |
|
public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment) |
59 |
|
{ |
60 |
9 |
return new SequenceRenderer(((AlignmentPanel) alignment).av); |
61 |
|
} |
62 |
|
|
|
|
| 50% |
Uncovered Elements: 2 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
63 |
22 |
@Override... |
64 |
|
public void sendConsoleEcho(String strEcho) |
65 |
|
{ |
66 |
22 |
if (console != null) |
67 |
|
{ |
68 |
0 |
console.sendConsoleEcho(strEcho); |
69 |
|
} |
70 |
|
} |
71 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 3 |
Complexity Density: 1.5 |
|
72 |
0 |
@Override... |
73 |
|
public void sendConsoleMessage(String strStatus) |
74 |
|
{ |
75 |
0 |
if (console != null && strStatus != null) |
76 |
|
|
77 |
|
|
78 |
|
{ |
79 |
0 |
console.sendConsoleMessage(strStatus); |
80 |
|
} |
81 |
|
} |
82 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
83 |
0 |
@Override... |
84 |
|
public void showUrl(String url, String target) |
85 |
|
{ |
86 |
0 |
try |
87 |
|
{ |
88 |
0 |
jalview.util.BrowserLauncher.openURL(url); |
89 |
|
} catch (Exception e) |
90 |
|
{ |
91 |
0 |
Cache.log.error("Failed to launch Jmol-associated url " + url, e); |
92 |
|
|
93 |
|
} |
94 |
|
} |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
11 |
@Override... |
97 |
|
public void refreshGUI() |
98 |
|
{ |
99 |
|
|
100 |
11 |
javax.swing.SwingUtilities.invokeLater(new Runnable() |
101 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
102 |
11 |
@Override... |
103 |
|
public void run() |
104 |
|
{ |
105 |
11 |
appJmolWindow.updateTitleAndMenus(); |
106 |
10 |
appJmolWindow.revalidate(); |
107 |
|
} |
108 |
|
}); |
109 |
|
} |
110 |
|
|
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
111 |
911 |
@Override... |
112 |
|
public void updateColours(Object source) |
113 |
|
{ |
114 |
911 |
AlignmentPanel ap = (AlignmentPanel) source; |
115 |
|
|
116 |
911 |
if (!appJmolWindow.isUsedforcolourby(ap)) |
117 |
|
{ |
118 |
892 |
return; |
119 |
|
} |
120 |
19 |
if (!isLoadingFromArchive()) |
121 |
|
{ |
122 |
19 |
colourBySequence(ap); |
123 |
|
} |
124 |
|
} |
125 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
126 |
318 |
@Override... |
127 |
|
public void notifyScriptTermination(String strStatus, int msWalltime) |
128 |
|
{ |
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
} |
134 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
0 |
@Override... |
136 |
|
public void showUrl(String url) |
137 |
|
{ |
138 |
0 |
showUrl(url, "jmol"); |
139 |
|
} |
140 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
141 |
0 |
public void newJmolPopup(String menuName)... |
142 |
|
{ |
143 |
|
|
144 |
|
|
145 |
|
} |
146 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
147 |
0 |
@Override... |
148 |
|
public void selectionChanged(BS arg0) |
149 |
|
{ |
150 |
|
|
151 |
|
|
152 |
|
} |
153 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
154 |
11 |
@Override... |
155 |
|
public void refreshPdbEntries() |
156 |
|
{ |
157 |
|
|
158 |
|
|
159 |
|
} |
160 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
161 |
0 |
@Override... |
162 |
|
public void showConsole(boolean b) |
163 |
|
{ |
164 |
0 |
appJmolWindow.showConsole(b); |
165 |
|
} |
166 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
167 |
10 |
@Override... |
168 |
|
protected JmolAppConsoleInterface createJmolConsole( |
169 |
|
Container consolePanel, String buttonsToShow) |
170 |
|
{ |
171 |
10 |
viewer.setJmolCallbackListener(this); |
172 |
10 |
return null; |
173 |
|
} |
174 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
175 |
10 |
@Override... |
176 |
|
protected void releaseUIResources() |
177 |
|
{ |
178 |
10 |
appJmolWindow = null; |
179 |
10 |
closeConsole(); |
180 |
|
} |
181 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
182 |
82 |
@Override... |
183 |
|
public void releaseReferences(Object svl) |
184 |
|
{ |
185 |
82 |
if (svl instanceof SeqPanel) |
186 |
|
{ |
187 |
82 |
appJmolWindow.removeAlignmentPanel(((SeqPanel) svl).ap); |
188 |
|
} |
189 |
|
} |
190 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
191 |
0 |
@Override... |
192 |
|
public Map<String, Object> getJSpecViewProperty(String arg0) |
193 |
|
{ |
194 |
|
|
195 |
0 |
return null; |
196 |
|
} |
197 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
198 |
0 |
@Override... |
199 |
|
public JalviewStructureDisplayI getViewer() |
200 |
|
{ |
201 |
0 |
return appJmolWindow; |
202 |
|
} |
203 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
204 |
11 |
@Override... |
205 |
|
public jalview.api.FeatureRenderer getFeatureRenderer( |
206 |
|
AlignmentViewPanel alignment) |
207 |
|
{ |
208 |
11 |
AlignmentPanel ap = (alignment == null) |
209 |
|
? appJmolWindow.getAlignmentPanel() |
210 |
|
: (AlignmentPanel) alignment; |
211 |
11 |
if (ap.av.isShowSequenceFeatures()) |
212 |
|
{ |
213 |
1 |
return ap.av.getAlignPanel().getSeqPanel().seqCanvas.fr; |
214 |
|
} |
215 |
|
|
216 |
10 |
return null; |
217 |
|
} |
218 |
|
} |