| 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.util.ArrayList; |
| 24 |
|
import java.util.EnumSet; |
| 25 |
|
import java.util.HashMap; |
| 26 |
|
import java.util.LinkedHashMap; |
| 27 |
|
import java.util.List; |
| 28 |
|
import java.util.Locale; |
| 29 |
|
import java.util.Map; |
| 30 |
|
import java.util.Map.Entry; |
| 31 |
|
|
| 32 |
|
import jalview.api.structures.JalviewStructureDisplayI; |
| 33 |
|
import jalview.bin.Cache; |
| 34 |
|
import jalview.bin.Console; |
| 35 |
|
import jalview.datamodel.PDBEntry; |
| 36 |
|
import jalview.datamodel.SequenceI; |
| 37 |
|
import jalview.datamodel.StructureViewerModel; |
| 38 |
|
import jalview.io.DataSourceType; |
| 39 |
|
import jalview.structure.StructureImportSettings.TFType; |
| 40 |
|
import jalview.structure.StructureSelectionManager; |
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
@author |
| 49 |
|
|
| |
|
| 58.6% |
Uncovered Elements: 92 (222) |
Complexity: 65 |
Complexity Density: 0.48 |
|
| 50 |
|
public class StructureViewer |
| 51 |
|
{ |
| 52 |
|
private static final String UNKNOWN_VIEWER_TYPE = "Unknown structure viewer type "; |
| 53 |
|
|
| 54 |
|
StructureSelectionManager ssm; |
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
private boolean superposeAdded = true; |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
private boolean async = true; |
| 65 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 66 |
19 |
public void setAsync(boolean b)... |
| 67 |
|
{ |
| 68 |
19 |
async = b; |
| 69 |
|
} |
| 70 |
|
|
| |
|
| 92.9% |
Uncovered Elements: 1 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
| 71 |
|
public enum ViewerType |
| 72 |
|
{ |
| 73 |
|
JMOL, CHIMERA, CHIMERAX, PYMOL; |
| 74 |
|
|
| |
|
| 90.9% |
Uncovered Elements: 1 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 75 |
64 |
public static ViewerType getFromString(String viewerString)... |
| 76 |
|
{ |
| 77 |
64 |
ViewerType viewerType = null; |
| 78 |
64 |
if (!"none".equals(viewerString)) |
| 79 |
|
{ |
| 80 |
55 |
for (ViewerType v : EnumSet.allOf(ViewerType.class)) |
| 81 |
|
{ |
| 82 |
55 |
if (viewerString.equals(v.shortName())) |
| 83 |
|
{ |
| 84 |
55 |
viewerType = v; |
| 85 |
55 |
break; |
| 86 |
|
} |
| 87 |
|
} |
| 88 |
|
} |
| 89 |
64 |
return viewerType; |
| 90 |
|
} |
| 91 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 92 |
55 |
public String shortName()... |
| 93 |
|
{ |
| 94 |
55 |
return name().toLowerCase(Locale.ROOT).replaceAll(" ", ""); |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
}; |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
@param |
| 103 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 104 |
56 |
public StructureViewer(... |
| 105 |
|
StructureSelectionManager structureSelectionManager) |
| 106 |
|
{ |
| 107 |
56 |
ssm = structureSelectionManager; |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| |
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 114 |
0 |
public static StructureViewer reconfigure(... |
| 115 |
|
JalviewStructureDisplayI display) |
| 116 |
|
{ |
| 117 |
0 |
StructureViewer sv = new StructureViewer(display.getBinding().getSsm()); |
| 118 |
0 |
sv.sview = display; |
| 119 |
0 |
return sv; |
| 120 |
|
} |
| 121 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 122 |
0 |
@Override... |
| 123 |
|
public String toString() |
| 124 |
|
{ |
| 125 |
0 |
if (sview != null) |
| 126 |
|
{ |
| 127 |
0 |
return sview.toString(); |
| 128 |
|
} |
| 129 |
0 |
return "New View"; |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
@return |
| 135 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 136 |
74 |
public static ViewerType getViewerType()... |
| 137 |
|
{ |
| 138 |
74 |
String viewType = Cache.getDefault(Preferences.STRUCTURE_DISPLAY, |
| 139 |
|
ViewerType.JMOL.name()); |
| 140 |
74 |
return ViewerType.valueOf(viewType); |
| 141 |
|
} |
| 142 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 143 |
2 |
public void setViewerType(ViewerType type)... |
| 144 |
|
{ |
| 145 |
2 |
Cache.setProperty(Preferences.STRUCTURE_DISPLAY, type.name()); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
@param |
| 152 |
|
@param |
| 153 |
|
@param |
| 154 |
|
@return |
| 155 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 156 |
0 |
public JalviewStructureDisplayI viewStructures(PDBEntry[] pdbs,... |
| 157 |
|
SequenceI[] seqs, AlignmentPanel ap) |
| 158 |
|
{ |
| 159 |
0 |
return viewStructures(pdbs, seqs, ap, null); |
| 160 |
|
} |
| 161 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 162 |
5 |
public JalviewStructureDisplayI viewStructures(String structureLocation,... |
| 163 |
|
DataSourceType type, SequenceI seq, AlignmentPanel ap, |
| 164 |
|
boolean prompt, TFType tft, String paeFileSource, |
| 165 |
|
boolean forceHeadless, boolean showRefAnnotations, |
| 166 |
|
boolean doXferSettings, boolean tempAlignStructures) |
| 167 |
|
{ |
| 168 |
5 |
PDBEntry fileEntry = new AssociatePdbFileWithSeq().associatePdbWithSeq( |
| 169 |
|
structureLocation, type, seq, prompt, Desktop.instance, tft, |
| 170 |
|
paeFileSource, doXferSettings); |
| 171 |
|
|
| 172 |
5 |
return viewStructures(new PDBEntry[] { fileEntry }, |
| 173 |
|
new SequenceI[] |
| 174 |
|
{ seq }, ap, null, tempAlignStructures); |
| 175 |
|
} |
| 176 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 177 |
5 |
public JalviewStructureDisplayI viewStructures(PDBEntry[] pdbs,... |
| 178 |
|
SequenceI[] seqs, AlignmentPanel ap, ViewerType viewerType) |
| 179 |
|
{ |
| 180 |
5 |
return viewStructures(pdbs, seqs, ap, viewerType, superposeAdded); |
| 181 |
|
} |
| 182 |
|
|
| |
|
| 39% |
Uncovered Elements: 25 (41) |
Complexity: 9 |
Complexity Density: 0.36 |
|
| 183 |
10 |
public JalviewStructureDisplayI viewStructures(PDBEntry[] pdbs,... |
| 184 |
|
SequenceI[] seqs, AlignmentPanel ap, ViewerType viewerType, |
| 185 |
|
boolean thisSuperpose) |
| 186 |
|
{ |
| 187 |
10 |
JalviewStructureDisplayI viewer = onlyOnePdb(pdbs, seqs, ap, |
| 188 |
|
thisSuperpose); |
| 189 |
10 |
if (viewer != null) |
| 190 |
|
{ |
| 191 |
|
|
| 192 |
|
|
| 193 |
|
|
| 194 |
5 |
return viewer; |
| 195 |
|
} |
| 196 |
|
|
| 197 |
5 |
if (viewerType == null) |
| 198 |
0 |
viewerType = getViewerType(); |
| 199 |
|
|
| 200 |
5 |
Map<PDBEntry, SequenceI[]> seqsForPdbs = getSequencesForPdbs(pdbs, |
| 201 |
|
seqs); |
| 202 |
5 |
PDBEntry[] pdbsForFile = seqsForPdbs.keySet() |
| 203 |
|
.toArray(new PDBEntry[seqsForPdbs.size()]); |
| 204 |
5 |
SequenceI[][] theSeqs = seqsForPdbs.values() |
| 205 |
|
.toArray(new SequenceI[seqsForPdbs.size()][]); |
| 206 |
5 |
if (sview != null) |
| 207 |
|
{ |
| 208 |
0 |
sview.setAlignAddedStructures(thisSuperpose); |
| 209 |
|
|
| 210 |
0 |
Runnable viewRunnable = new Runnable() |
| 211 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 212 |
0 |
@Override... |
| 213 |
|
public void run() |
| 214 |
|
{ |
| 215 |
|
|
| 216 |
0 |
for (int pdbep = 0; pdbep < pdbsForFile.length; pdbep++) |
| 217 |
|
{ |
| 218 |
0 |
PDBEntry pdb = pdbsForFile[pdbep]; |
| 219 |
0 |
if (!sview.addAlreadyLoadedFile(theSeqs[pdbep], null, ap, |
| 220 |
|
pdb.getId())) |
| 221 |
|
{ |
| 222 |
0 |
sview.addToExistingViewer(pdb, theSeqs[pdbep], null, ap, |
| 223 |
|
pdb.getId()); |
| 224 |
|
} |
| 225 |
|
} |
| 226 |
|
|
| 227 |
0 |
sview.updateTitleAndMenus(); |
| 228 |
|
} |
| 229 |
|
}; |
| 230 |
0 |
if (async) |
| 231 |
|
{ |
| 232 |
0 |
new Thread(viewRunnable).start(); |
| 233 |
|
} |
| 234 |
|
else |
| 235 |
|
{ |
| 236 |
0 |
viewRunnable.run(); |
| 237 |
|
} |
| 238 |
0 |
return sview; |
| 239 |
|
} |
| 240 |
|
|
| 241 |
5 |
if (viewerType.equals(ViewerType.JMOL)) |
| 242 |
|
{ |
| 243 |
5 |
sview = new AppJmol(ap, superposeAdded, pdbsForFile, theSeqs); |
| 244 |
|
} |
| 245 |
0 |
else if (viewerType.equals(ViewerType.CHIMERA)) |
| 246 |
|
{ |
| 247 |
0 |
sview = new ChimeraViewFrame(pdbsForFile, superposeAdded, theSeqs, |
| 248 |
|
ap); |
| 249 |
|
} |
| 250 |
0 |
else if (viewerType.equals(ViewerType.CHIMERAX)) |
| 251 |
|
{ |
| 252 |
0 |
sview = new ChimeraXViewFrame(pdbsForFile, superposeAdded, theSeqs, |
| 253 |
|
ap); |
| 254 |
|
} |
| 255 |
0 |
else if (viewerType.equals(ViewerType.PYMOL)) |
| 256 |
|
{ |
| 257 |
0 |
sview = new PymolViewer(pdbsForFile, superposeAdded, theSeqs, ap); |
| 258 |
|
} |
| 259 |
|
else |
| 260 |
|
{ |
| 261 |
0 |
Console.error(UNKNOWN_VIEWER_TYPE + getViewerType().toString()); |
| 262 |
|
} |
| 263 |
5 |
return sview; |
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
|
| 267 |
|
|
| 268 |
|
|
| 269 |
|
|
| 270 |
|
|
| 271 |
|
|
| 272 |
|
@param |
| 273 |
|
@param |
| 274 |
|
@return |
| 275 |
|
|
| |
|
| 96.9% |
Uncovered Elements: 1 (32) |
Complexity: 9 |
Complexity Density: 0.41 |
|
| 276 |
7 |
Map<PDBEntry, SequenceI[]> getSequencesForPdbs(PDBEntry[] pdbs,... |
| 277 |
|
SequenceI[] seqs) |
| 278 |
|
{ |
| 279 |
7 |
if (pdbs == null || seqs == null || pdbs.length != seqs.length) |
| 280 |
|
{ |
| 281 |
1 |
return null; |
| 282 |
|
} |
| 283 |
|
|
| 284 |
|
|
| 285 |
|
|
| 286 |
|
|
| 287 |
|
|
| 288 |
6 |
Map<String, PDBEntry> pdbsSeen = new HashMap<>(); |
| 289 |
|
|
| 290 |
|
|
| 291 |
|
|
| 292 |
|
|
| 293 |
|
|
| 294 |
6 |
Map<PDBEntry, List<SequenceI>> pdbSeqs = new LinkedHashMap<>(); |
| 295 |
28 |
for (int i = 0; i < pdbs.length; i++) |
| 296 |
|
{ |
| 297 |
22 |
PDBEntry pdb = pdbs[i]; |
| 298 |
22 |
SequenceI seq = seqs[i]; |
| 299 |
22 |
String pdbFile = pdb.getFile(); |
| 300 |
22 |
if (pdbFile == null || pdbFile.length() == 0) |
| 301 |
|
{ |
| 302 |
3 |
pdbFile = pdb.getId(); |
| 303 |
|
} |
| 304 |
22 |
if (!pdbsSeen.containsKey(pdbFile)) |
| 305 |
|
{ |
| 306 |
19 |
pdbsSeen.put(pdbFile, pdb); |
| 307 |
19 |
pdbSeqs.put(pdb, new ArrayList<SequenceI>()); |
| 308 |
|
} |
| 309 |
|
else |
| 310 |
|
{ |
| 311 |
3 |
pdb = pdbsSeen.get(pdbFile); |
| 312 |
|
} |
| 313 |
22 |
List<SequenceI> seqsForPdb = pdbSeqs.get(pdb); |
| 314 |
22 |
if (!seqsForPdb.contains(seq)) |
| 315 |
|
{ |
| 316 |
22 |
seqsForPdb.add(seq); |
| 317 |
|
} |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
|
| 321 |
|
|
| 322 |
|
|
| 323 |
6 |
Map<PDBEntry, SequenceI[]> result = new LinkedHashMap<>(); |
| 324 |
6 |
for (Entry<PDBEntry, List<SequenceI>> entry : pdbSeqs.entrySet()) |
| 325 |
|
{ |
| 326 |
19 |
List<SequenceI> theSeqs = entry.getValue(); |
| 327 |
19 |
result.put(entry.getKey(), |
| 328 |
|
theSeqs.toArray(new SequenceI[theSeqs.size()])); |
| 329 |
|
} |
| 330 |
|
|
| 331 |
6 |
return result; |
| 332 |
|
} |
| 333 |
|
|
| 334 |
|
|
| 335 |
|
|
| 336 |
|
|
| 337 |
|
|
| 338 |
|
|
| 339 |
|
|
| 340 |
|
|
| 341 |
|
@param |
| 342 |
|
@param |
| 343 |
|
@param |
| 344 |
|
@return |
| 345 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 346 |
0 |
private JalviewStructureDisplayI onlyOnePdb(PDBEntry[] pdbs,... |
| 347 |
|
SequenceI[] seqsForPdbs, AlignmentPanel ap) |
| 348 |
|
{ |
| 349 |
0 |
return onlyOnePdb(pdbs, seqsForPdbs, ap, superposeAdded); |
| 350 |
|
} |
| 351 |
|
|
| |
|
| 84.2% |
Uncovered Elements: 3 (19) |
Complexity: 6 |
Complexity Density: 0.46 |
|
| 352 |
10 |
private JalviewStructureDisplayI onlyOnePdb(PDBEntry[] pdbs,... |
| 353 |
|
SequenceI[] seqsForPdbs, AlignmentPanel ap, boolean thisSuperpose) |
| 354 |
|
{ |
| 355 |
10 |
List<SequenceI> seqs = new ArrayList<>(); |
| 356 |
10 |
if (pdbs == null || pdbs.length == 0) |
| 357 |
|
{ |
| 358 |
0 |
return null; |
| 359 |
|
} |
| 360 |
10 |
int i = 0; |
| 361 |
10 |
String firstFile = pdbs[0].getFile(); |
| 362 |
10 |
for (PDBEntry pdb : pdbs) |
| 363 |
|
{ |
| 364 |
15 |
String pdbFile = pdb.getFile(); |
| 365 |
15 |
if (pdbFile == null || !pdbFile.equals(firstFile)) |
| 366 |
|
{ |
| 367 |
|
|
| 368 |
5 |
return null; |
| 369 |
|
} |
| 370 |
10 |
SequenceI pdbseq = seqsForPdbs[i++]; |
| 371 |
10 |
if (pdbseq != null) |
| 372 |
|
{ |
| 373 |
10 |
seqs.add(pdbseq); |
| 374 |
|
} |
| 375 |
|
} |
| 376 |
5 |
return viewStructures(pdbs[0], seqs.toArray(new SequenceI[seqs.size()]), |
| 377 |
|
ap, null, thisSuperpose); |
| 378 |
|
} |
| 379 |
|
|
| 380 |
|
JalviewStructureDisplayI sview = null; |
| 381 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 382 |
58 |
public JalviewStructureDisplayI getJalviewStructureDisplay()... |
| 383 |
|
{ |
| 384 |
58 |
return sview; |
| 385 |
|
} |
| 386 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 387 |
3 |
public JalviewStructureDisplayI viewStructures(PDBEntry pdb,... |
| 388 |
|
SequenceI[] seqsForPdb, AlignmentPanel ap) |
| 389 |
|
{ |
| 390 |
3 |
return viewStructures(pdb, seqsForPdb, ap, null); |
| 391 |
|
} |
| 392 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 393 |
51 |
public JalviewStructureDisplayI viewStructures(PDBEntry pdb,... |
| 394 |
|
SequenceI[] seqsForPdb, AlignmentPanel ap, ViewerType viewerType) |
| 395 |
|
{ |
| 396 |
51 |
return viewStructures(pdb, seqsForPdb, ap, viewerType, superposeAdded); |
| 397 |
|
} |
| 398 |
|
|
| |
|
| 58.8% |
Uncovered Elements: 14 (34) |
Complexity: 8 |
Complexity Density: 0.4 |
|
| 399 |
56 |
public JalviewStructureDisplayI viewStructures(PDBEntry pdb,... |
| 400 |
|
SequenceI[] seqsForPdb, AlignmentPanel ap, ViewerType viewerType, |
| 401 |
|
boolean thisSuperpose) |
| 402 |
|
{ |
| 403 |
56 |
if (sview != null) |
| 404 |
|
{ |
| 405 |
6 |
sview.setAlignAddedStructures(thisSuperpose); |
| 406 |
6 |
String pdbId = pdb.getId(); |
| 407 |
6 |
if (!sview.addAlreadyLoadedFile(seqsForPdb, null, ap, pdbId)) |
| 408 |
|
{ |
| 409 |
5 |
sview.addToExistingViewer(pdb, seqsForPdb, null, ap, pdbId); |
| 410 |
|
} |
| 411 |
6 |
sview.updateTitleAndMenus(); |
| 412 |
6 |
sview.raiseViewer(); |
| 413 |
6 |
return sview; |
| 414 |
|
} |
| 415 |
50 |
if (viewerType == null) |
| 416 |
2 |
viewerType = getViewerType(); |
| 417 |
50 |
if (viewerType.equals(ViewerType.JMOL)) |
| 418 |
|
{ |
| 419 |
50 |
sview = new AppJmol(pdb, seqsForPdb, null, ap); |
| 420 |
|
} |
| 421 |
0 |
else if (viewerType.equals(ViewerType.CHIMERA)) |
| 422 |
|
{ |
| 423 |
0 |
sview = new ChimeraViewFrame(pdb, seqsForPdb, null, ap); |
| 424 |
|
} |
| 425 |
0 |
else if (viewerType.equals(ViewerType.CHIMERAX)) |
| 426 |
|
{ |
| 427 |
0 |
sview = new ChimeraXViewFrame(pdb, seqsForPdb, null, ap); |
| 428 |
|
} |
| 429 |
0 |
else if (viewerType.equals(ViewerType.PYMOL)) |
| 430 |
|
{ |
| 431 |
0 |
sview = new PymolViewer(pdb, seqsForPdb, null, ap); |
| 432 |
|
} |
| 433 |
|
else |
| 434 |
|
{ |
| 435 |
0 |
Console.error(UNKNOWN_VIEWER_TYPE + getViewerType().toString()); |
| 436 |
|
} |
| 437 |
|
|
| 438 |
50 |
return sview; |
| 439 |
|
} |
| 440 |
|
|
| |
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 441 |
10 |
public void showAllChains()... |
| 442 |
|
{ |
| 443 |
10 |
if (sview != null) |
| 444 |
|
{ |
| 445 |
10 |
sview.showAllChains(); |
| 446 |
|
} |
| 447 |
|
} |
| 448 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 449 |
0 |
public void setPermanentTitle(String title)... |
| 450 |
|
{ |
| 451 |
0 |
if (sview != null) |
| 452 |
|
{ |
| 453 |
0 |
sview.setPermanentTitle(title); |
| 454 |
0 |
sview.updateTitleAndMenus(); |
| 455 |
|
} |
| 456 |
|
} |
| 457 |
|
|
| 458 |
|
|
| 459 |
|
|
| 460 |
|
|
| 461 |
|
@param |
| 462 |
|
@param |
| 463 |
|
@param |
| 464 |
|
@param |
| 465 |
|
@param |
| 466 |
|
@return |
| 467 |
|
|
| |
|
| 35.3% |
Uncovered Elements: 11 (17) |
Complexity: 5 |
Complexity Density: 0.29 |
|
| 468 |
7 |
public static JalviewStructureDisplayI createView(ViewerType type,... |
| 469 |
|
AlignmentPanel alignPanel, StructureViewerModel viewerData, |
| 470 |
|
String sessionFile, String vid) |
| 471 |
|
{ |
| 472 |
7 |
JalviewStructureDisplayI viewer = null; |
| 473 |
7 |
switch (type) |
| 474 |
|
{ |
| 475 |
7 |
case JMOL: |
| 476 |
7 |
viewer = new AppJmol(viewerData, alignPanel, sessionFile, vid); |
| 477 |
|
|
| 478 |
7 |
break; |
| 479 |
0 |
case CHIMERA: |
| 480 |
0 |
viewer = new ChimeraViewFrame(viewerData, alignPanel, sessionFile, |
| 481 |
|
vid); |
| 482 |
0 |
break; |
| 483 |
0 |
case CHIMERAX: |
| 484 |
0 |
viewer = new ChimeraXViewFrame(viewerData, alignPanel, sessionFile, |
| 485 |
|
vid); |
| 486 |
0 |
break; |
| 487 |
0 |
case PYMOL: |
| 488 |
0 |
viewer = new PymolViewer(viewerData, alignPanel, sessionFile, vid); |
| 489 |
0 |
break; |
| 490 |
0 |
default: |
| 491 |
0 |
Console.error(UNKNOWN_VIEWER_TYPE + type.toString()); |
| 492 |
|
} |
| 493 |
7 |
return viewer; |
| 494 |
|
} |
| 495 |
|
|
| |
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 496 |
897 |
public boolean isBusy()... |
| 497 |
|
{ |
| 498 |
897 |
if (sview != null) |
| 499 |
|
{ |
| 500 |
897 |
if (!sview.hasMapping()) |
| 501 |
|
{ |
| 502 |
796 |
return true; |
| 503 |
|
} |
| 504 |
|
} |
| 505 |
101 |
return false; |
| 506 |
|
} |
| 507 |
|
|
| 508 |
|
|
| 509 |
|
|
| 510 |
|
@param |
| 511 |
|
@return |
| 512 |
|
|
| |
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 513 |
0 |
public boolean hasPdbId(String pDBid)... |
| 514 |
|
{ |
| 515 |
0 |
if (sview == null) |
| 516 |
|
{ |
| 517 |
0 |
return false; |
| 518 |
|
} |
| 519 |
|
|
| 520 |
0 |
return sview.getBinding().hasPdbId(pDBid); |
| 521 |
|
} |
| 522 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 523 |
1 |
public boolean isVisible()... |
| 524 |
|
{ |
| 525 |
1 |
return sview != null && sview.isVisible(); |
| 526 |
|
} |
| 527 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 528 |
53 |
public void setSuperpose(boolean alignAddedStructures)... |
| 529 |
|
{ |
| 530 |
53 |
superposeAdded = alignAddedStructures; |
| 531 |
|
} |
| 532 |
|
|
| 533 |
|
} |