1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.appletgui; |
22 |
|
|
23 |
|
import jalview.api.AlignmentViewPanel; |
24 |
|
import jalview.api.SequenceRenderer; |
25 |
|
import jalview.datamodel.PDBEntry; |
26 |
|
import jalview.datamodel.SequenceI; |
27 |
|
import jalview.ext.jmol.JalviewJmolBinding; |
28 |
|
import jalview.io.DataSourceType; |
29 |
|
|
30 |
|
import java.awt.Container; |
31 |
|
import java.util.ArrayList; |
32 |
|
import java.util.List; |
33 |
|
import java.util.Map; |
34 |
|
import java.util.Vector; |
35 |
|
|
36 |
|
import org.jmol.api.JmolAppConsoleInterface; |
37 |
|
import javajs.util.BS; |
38 |
|
import org.jmol.viewer.Viewer; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
@author |
44 |
|
|
45 |
|
|
|
|
| 0% |
Uncovered Elements: 54 (54) |
Complexity: 21 |
Complexity Density: 0.75 |
|
46 |
|
public class ExtJmol extends JalviewJmolBinding |
47 |
|
{ |
48 |
|
|
49 |
|
private AlignmentPanel ap; |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
0 |
protected ExtJmol(AlignFrame alframe, PDBEntry[] pdbentry,... |
52 |
|
SequenceI[][] seq, DataSourceType protocol) |
53 |
|
{ |
54 |
0 |
super(alframe.alignPanel.getStructureSelectionManager(), pdbentry, seq, |
55 |
|
protocol); |
56 |
|
} |
57 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
58 |
0 |
public ExtJmol(Viewer viewer, AlignmentPanel alignPanel,... |
59 |
|
SequenceI[][] seqs) |
60 |
|
{ |
61 |
0 |
super(alignPanel.getStructureSelectionManager(), seqs, viewer); |
62 |
0 |
ap = alignPanel; |
63 |
0 |
notifyFileLoaded(null, null, null, null, 0); |
64 |
|
} |
65 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
66 |
0 |
@Override... |
67 |
|
public void updateColours(Object source) |
68 |
|
{ |
69 |
|
} |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
0 |
@Override... |
72 |
|
public void showUrl(String arg0) |
73 |
|
{ |
74 |
0 |
showUrl(arg0, "jmol"); |
75 |
|
} |
76 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
0 |
@Override... |
78 |
|
public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment) |
79 |
|
{ |
80 |
0 |
return ((AlignmentPanel) alignment).getSequenceRenderer(); |
81 |
|
} |
82 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
83 |
0 |
@Override... |
84 |
|
public void notifyScriptTermination(String strStatus, int msWalltime) |
85 |
|
{ |
86 |
|
|
87 |
|
} |
88 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
89 |
0 |
@Override... |
90 |
|
public void sendConsoleEcho(String strEcho) |
91 |
|
{ |
92 |
|
|
93 |
|
} |
94 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
95 |
0 |
@Override... |
96 |
|
public void sendConsoleMessage(String strStatus) |
97 |
|
{ |
98 |
|
|
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0 |
@Override... |
102 |
|
public void showUrl(String url, String target) |
103 |
|
{ |
104 |
0 |
ap.alignFrame.showURL(url, target); |
105 |
|
} |
106 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
107 |
0 |
@Override... |
108 |
|
public void refreshGUI() |
109 |
|
{ |
110 |
|
|
111 |
|
} |
112 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
113 |
0 |
@Override... |
114 |
|
public void selectionChanged(BS arg0) |
115 |
|
{ |
116 |
0 |
System.out.println(arg0); |
117 |
|
} |
118 |
|
|
|
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 6 |
Complexity Density: 0.4 |
|
119 |
0 |
@Override... |
120 |
|
public void refreshPdbEntries() |
121 |
|
{ |
122 |
0 |
List<PDBEntry> pdbe = new ArrayList<>(); |
123 |
0 |
List<String> fileids = new ArrayList<>(); |
124 |
0 |
SequenceI[] sq = ap.av.getAlignment().getSequencesArray(); |
125 |
0 |
for (int s = 0; s < sq.length; s++) |
126 |
|
{ |
127 |
0 |
Vector<PDBEntry> pdbids = sq[s].getAllPDBEntries(); |
128 |
0 |
if (pdbids != null) |
129 |
|
{ |
130 |
0 |
for (int pe = 0, peSize = pdbids.size(); pe < peSize; pe++) |
131 |
|
{ |
132 |
0 |
PDBEntry pentry = pdbids.elementAt(pe); |
133 |
0 |
if (!fileids.contains(pentry.getId())) |
134 |
|
{ |
135 |
0 |
pdbe.add(pentry); |
136 |
|
} |
137 |
|
else |
138 |
|
{ |
139 |
0 |
fileids.add(pentry.getId()); |
140 |
|
} |
141 |
|
} |
142 |
|
} |
143 |
|
} |
144 |
0 |
PDBEntry[] newEntries = new PDBEntry[pdbe.size()]; |
145 |
0 |
for (int pe = 0; pe < pdbe.size(); pe++) |
146 |
|
{ |
147 |
0 |
newEntries[pe] = pdbe.get(pe); |
148 |
|
} |
149 |
0 |
setPdbentry(newEntries); |
150 |
|
} |
151 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
152 |
0 |
@Override... |
153 |
|
public void showConsole(boolean show) |
154 |
|
{ |
155 |
|
|
156 |
|
|
157 |
0 |
jalview.bin.Console.errPrintln( |
158 |
|
"WARNING: unexpected call to ExtJmol's showConsole method. (showConsole=" |
159 |
|
+ show); |
160 |
|
} |
161 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
162 |
0 |
@Override... |
163 |
|
protected JmolAppConsoleInterface createJmolConsole( |
164 |
|
Container consolePanel, String buttonsToShow) |
165 |
|
{ |
166 |
0 |
return null; |
167 |
|
} |
168 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
169 |
0 |
@Override... |
170 |
|
protected void releaseUIResources() |
171 |
|
{ |
172 |
0 |
ap = null; |
173 |
0 |
closeConsole(); |
174 |
|
|
175 |
|
} |
176 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
177 |
0 |
@Override... |
178 |
|
public Map<String, Object> getJSpecViewProperty(String arg0) |
179 |
|
{ |
180 |
0 |
return null; |
181 |
|
} |
182 |
|
} |