| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.workers; |
| 22 |
|
|
| 23 |
|
import jalview.api.AlignViewportI; |
| 24 |
|
import jalview.api.AlignmentViewPanel; |
| 25 |
|
import jalview.datamodel.AlignmentAnnotation; |
| 26 |
|
import jalview.datamodel.AlignmentI; |
| 27 |
|
import jalview.renderer.seqfeatures.FeatureRenderer; |
| 28 |
|
|
| 29 |
|
import java.util.ArrayList; |
| 30 |
|
import java.util.List; |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| |
|
| 73.7% |
Uncovered Elements: 10 (38) |
Complexity: 9 |
Complexity Density: 0.35 |
|
| 37 |
|
class AnnotationWorker extends AlignCalcWorker |
| 38 |
|
{ |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
AnnotationProviderI counter; |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
@param |
| 48 |
|
@param |
| 49 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 50 |
2 |
public AnnotationWorker(AlignViewportI viewport, AlignmentViewPanel panel,... |
| 51 |
|
AnnotationProviderI counter) |
| 52 |
|
{ |
| 53 |
2 |
super(viewport, panel); |
| 54 |
2 |
ourAnnots = new ArrayList<>(); |
| 55 |
2 |
this.counter = counter; |
| 56 |
2 |
calcMan.registerWorker(this); |
| 57 |
|
} |
| 58 |
|
|
| |
|
| 75.9% |
Uncovered Elements: 7 (29) |
Complexity: 6 |
Complexity Density: 0.29 |
|
| 59 |
2 |
@Override... |
| 60 |
|
public void run() |
| 61 |
|
{ |
| 62 |
2 |
if (alignViewport.isClosed()) |
| 63 |
|
{ |
| 64 |
0 |
abortAndDestroy(); |
| 65 |
0 |
return; |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
|
| 69 |
2 |
AlignmentI alignment = alignViewport.getAlignment(); |
| 70 |
2 |
if (alignment != null) |
| 71 |
|
{ |
| 72 |
2 |
try |
| 73 |
|
{ |
| 74 |
2 |
List<AlignmentAnnotation> anns = counter.calculateAnnotation( |
| 75 |
|
alignment, new FeatureRenderer(alignViewport)); |
| 76 |
2 |
for (AlignmentAnnotation ann : anns) |
| 77 |
|
{ |
| 78 |
2 |
AlignmentAnnotation theAnn = alignment.findOrCreateAnnotation( |
| 79 |
|
ann.label, ann.description, false, null, null); |
| 80 |
2 |
theAnn.showAllColLabels = true; |
| 81 |
2 |
theAnn.graph = AlignmentAnnotation.BAR_GRAPH; |
| 82 |
2 |
theAnn.scaleColLabel = true; |
| 83 |
2 |
theAnn.annotations = ann.annotations; |
| 84 |
2 |
setGraphMinMax(theAnn, theAnn.annotations); |
| 85 |
2 |
theAnn.validateRangeAndDisplay(); |
| 86 |
2 |
if (!ourAnnots.contains(theAnn)) |
| 87 |
|
{ |
| 88 |
2 |
ourAnnots.add(theAnn); |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
} |
| 92 |
|
} catch (IndexOutOfBoundsException x) |
| 93 |
|
{ |
| 94 |
|
|
| 95 |
0 |
return; |
| 96 |
|
} |
| 97 |
|
} |
| 98 |
|
|
| 99 |
2 |
if (ap != null) |
| 100 |
|
{ |
| 101 |
2 |
ap.adjustAnnotationHeight(); |
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
2 |
ap.paintAlignment(true, true); |
| 106 |
|
} |
| 107 |
|
} |
| 108 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 109 |
0 |
@Override... |
| 110 |
|
public void updateAnnotation() |
| 111 |
|
{ |
| 112 |
|
|
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 120 |
0 |
@Override... |
| 121 |
|
public boolean isDeletable() |
| 122 |
|
{ |
| 123 |
0 |
return true; |
| 124 |
|
} |
| 125 |
|
} |