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.AlignCalcManagerI; |
24 |
|
import jalview.api.AlignCalcWorkerI; |
25 |
|
import jalview.api.AlignViewportI; |
26 |
|
import jalview.api.AlignmentViewPanel; |
27 |
|
import jalview.datamodel.AlignmentAnnotation; |
28 |
|
import jalview.datamodel.AlignmentI; |
29 |
|
import jalview.datamodel.Annotation; |
30 |
|
|
31 |
|
import java.util.List; |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
|
38 |
|
|
|
|
| 47.6% |
Uncovered Elements: 22 (42) |
Complexity: 11 |
Complexity Density: 0.39 |
|
39 |
|
public abstract class AlignCalcWorker implements AlignCalcWorkerI |
40 |
|
{ |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
protected AlignViewportI alignViewport; |
45 |
|
|
46 |
|
protected AlignCalcManagerI calcMan; |
47 |
|
|
48 |
|
protected AlignmentViewPanel ap; |
49 |
|
|
50 |
|
protected List<AlignmentAnnotation> ourAnnots; |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
52 |
380 |
public AlignCalcWorker(AlignViewportI alignViewport,... |
53 |
|
AlignmentViewPanel alignPanel) |
54 |
|
{ |
55 |
380 |
this.alignViewport = alignViewport; |
56 |
380 |
calcMan = alignViewport.getCalcManager(); |
57 |
380 |
ap = alignPanel; |
58 |
|
} |
59 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
60 |
1 |
protected void abortAndDestroy()... |
61 |
|
{ |
62 |
1 |
if (calcMan != null) |
63 |
|
{ |
64 |
1 |
calcMan.workerComplete(this); |
65 |
|
} |
66 |
1 |
alignViewport = null; |
67 |
1 |
calcMan = null; |
68 |
1 |
ap = null; |
69 |
|
|
70 |
|
} |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
274 |
@Override... |
73 |
|
public boolean involves(AlignmentAnnotation i) |
74 |
|
{ |
75 |
274 |
return ourAnnots != null && ourAnnots.contains(i); |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
82 |
0 |
@Override... |
83 |
|
public void removeAnnotation() |
84 |
|
{ |
85 |
0 |
if (ourAnnots != null && alignViewport != null) |
86 |
|
{ |
87 |
0 |
AlignmentI alignment = alignViewport.getAlignment(); |
88 |
0 |
synchronized (ourAnnots) |
89 |
|
{ |
90 |
0 |
for (AlignmentAnnotation aa : ourAnnots) |
91 |
|
{ |
92 |
0 |
alignment.deleteAnnotation(aa, true); |
93 |
|
} |
94 |
|
} |
95 |
0 |
ourAnnots.clear(); |
96 |
|
} |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0 |
@Override... |
103 |
|
public boolean isDeletable() |
104 |
|
{ |
105 |
0 |
return false; |
106 |
|
} |
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
@param |
114 |
|
@param |
115 |
|
|
|
|
| 37.5% |
Uncovered Elements: 10 (16) |
Complexity: 3 |
Complexity Density: 0.25 |
|
116 |
2 |
protected void setGraphMinMax(AlignmentAnnotation ann, Annotation[] anns)... |
117 |
|
{ |
118 |
|
|
119 |
2 |
float max = Float.MIN_VALUE; |
120 |
2 |
float min = Float.MAX_VALUE; |
121 |
2 |
boolean set = false; |
122 |
2 |
for (Annotation a : anns) |
123 |
|
{ |
124 |
0 |
if (a != null) |
125 |
|
{ |
126 |
0 |
set = true; |
127 |
0 |
float val = a.value; |
128 |
0 |
max = Math.max(max, val); |
129 |
0 |
min = Math.min(min, val); |
130 |
|
} |
131 |
|
} |
132 |
2 |
if (set) |
133 |
|
{ |
134 |
0 |
ann.graphMin = min; |
135 |
0 |
ann.graphMax = max; |
136 |
|
} |
137 |
|
} |
138 |
|
|
139 |
|
} |