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 java.awt.Container; |
24 |
|
import java.io.File; |
25 |
|
import java.util.List; |
26 |
|
import java.util.Map; |
27 |
|
|
28 |
|
import javax.swing.JComponent; |
29 |
|
|
30 |
|
import org.jmol.api.JmolAppConsoleInterface; |
31 |
|
import org.openscience.jmol.app.jmolpanel.console.AppConsole; |
32 |
|
|
33 |
|
import jalview.api.AlignmentViewPanel; |
34 |
|
import jalview.api.structures.JalviewStructureDisplayI; |
35 |
|
import jalview.bin.Cache; |
36 |
|
import jalview.datamodel.PDBEntry; |
37 |
|
import jalview.datamodel.SequenceI; |
38 |
|
import jalview.ext.jmol.JalviewJmolBinding; |
39 |
|
import jalview.io.DataSourceType; |
40 |
|
import jalview.structure.StructureSelectionManager; |
41 |
|
import jalview.util.Platform; |
42 |
|
import javajs.util.BS; |
43 |
|
|
|
|
| 53.4% |
Uncovered Elements: 27 (58) |
Complexity: 25 |
Complexity Density: 0.86 |
|
44 |
|
public class AppJmolBinding extends JalviewJmolBinding |
45 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
46 |
7 |
public AppJmolBinding(AppJmol appJmol, StructureSelectionManager sSm,... |
47 |
|
PDBEntry[] pdbentry, SequenceI[][] sequenceIs, |
48 |
|
DataSourceType protocol) |
49 |
|
{ |
50 |
7 |
super(sSm, pdbentry, sequenceIs, protocol); |
51 |
7 |
setViewer(appJmol); |
52 |
|
} |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
10 |
@Override... |
55 |
|
public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment) |
56 |
|
{ |
57 |
10 |
return new SequenceRenderer(((AlignmentPanel) alignment).av); |
58 |
|
} |
59 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
60 |
6 |
@Override... |
61 |
|
public void sendConsoleEcho(String strEcho) |
62 |
|
{ |
63 |
6 |
if (console != null) |
64 |
|
{ |
65 |
6 |
console.sendConsoleEcho(strEcho); |
66 |
|
} |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 3 |
Complexity Density: 1.5 |
|
69 |
0 |
@Override... |
70 |
|
public void sendConsoleMessage(String strStatus) |
71 |
|
{ |
72 |
0 |
if (console != null && strStatus != null) |
73 |
|
|
74 |
|
|
75 |
|
{ |
76 |
0 |
console.sendConsoleMessage(strStatus); |
77 |
|
} |
78 |
|
} |
79 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
80 |
0 |
@Override... |
81 |
|
public void showUrl(String url, String target) |
82 |
|
{ |
83 |
0 |
try |
84 |
|
{ |
85 |
0 |
jalview.util.BrowserLauncher.openURL(url); |
86 |
|
} catch (Exception e) |
87 |
|
{ |
88 |
0 |
Cache.log.error("Failed to launch Jmol-associated url " + url, e); |
89 |
|
|
90 |
|
} |
91 |
|
} |
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
93 |
25 |
@Override... |
94 |
|
public void refreshGUI() |
95 |
|
{ |
96 |
25 |
if (getMappedStructureCount() == 0) |
97 |
|
{ |
98 |
|
|
99 |
19 |
return; |
100 |
|
} |
101 |
|
|
102 |
6 |
javax.swing.SwingUtilities.invokeLater(new Runnable() |
103 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
104 |
6 |
@Override... |
105 |
|
public void run() |
106 |
|
{ |
107 |
6 |
JalviewStructureDisplayI theViewer = getViewer(); |
108 |
|
|
109 |
6 |
theViewer.updateTitleAndMenus(); |
110 |
6 |
((JComponent) theViewer).revalidate(); |
111 |
|
} |
112 |
|
}); |
113 |
|
} |
114 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
115 |
4 |
@Override... |
116 |
|
public void notifyScriptTermination(String strStatus, int msWalltime) |
117 |
|
{ |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
} |
123 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
0 |
@Override... |
125 |
|
public void showUrl(String url) |
126 |
|
{ |
127 |
0 |
showUrl(url, "jmol"); |
128 |
|
} |
129 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
130 |
0 |
public void newJmolPopup(String menuName)... |
131 |
|
{ |
132 |
|
|
133 |
|
|
134 |
|
} |
135 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
136 |
0 |
@Override... |
137 |
|
public void selectionChanged(BS arg0) |
138 |
|
{ |
139 |
|
} |
140 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
141 |
0 |
@Override... |
142 |
|
public void showConsole(boolean b) |
143 |
|
{ |
144 |
0 |
getViewer().showConsole(b); |
145 |
|
} |
146 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
147 |
7 |
@Override... |
148 |
|
protected JmolAppConsoleInterface createJmolConsole( |
149 |
|
Container consolePanel, String buttonsToShow) |
150 |
|
{ |
151 |
7 |
jmolViewer.setJmolCallbackListener(this); |
152 |
|
|
153 |
7 |
return Platform.isJS() ? null |
154 |
|
: new AppConsole(jmolViewer, consolePanel, buttonsToShow); |
155 |
|
} |
156 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
157 |
7 |
@Override... |
158 |
|
protected void releaseUIResources() |
159 |
|
{ |
160 |
7 |
setViewer(null); |
161 |
7 |
closeConsole(); |
162 |
|
} |
163 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
164 |
36 |
@Override... |
165 |
|
public void releaseReferences(Object svl) |
166 |
|
{ |
167 |
36 |
if (svl instanceof SeqPanel) |
168 |
|
{ |
169 |
36 |
getViewer().removeAlignmentPanel(((SeqPanel) svl).ap); |
170 |
|
} |
171 |
|
} |
172 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
173 |
0 |
@Override... |
174 |
|
public Map<String, Object> getJSpecViewProperty(String arg0) |
175 |
|
{ |
176 |
|
|
177 |
0 |
return null; |
178 |
|
} |
179 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
180 |
0 |
@SuppressWarnings("unused")... |
181 |
|
public void cacheFiles(List<File> files) |
182 |
|
{ |
183 |
0 |
if (files == null) |
184 |
|
{ |
185 |
0 |
return; |
186 |
|
} |
187 |
0 |
for (File f : files) |
188 |
|
{ |
189 |
0 |
Platform.cacheFileData(f); |
190 |
|
} |
191 |
|
} |
192 |
|
} |