1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.viewmodel.seqfeatures; |
22 |
|
|
23 |
|
import jalview.api.FeatureColourI; |
24 |
|
import jalview.datamodel.features.FeatureMatcherSetI; |
25 |
|
import jalview.schemes.FeatureColour; |
26 |
|
|
27 |
|
import java.util.Arrays; |
28 |
|
import java.util.HashMap; |
29 |
|
import java.util.Iterator; |
30 |
|
import java.util.Map; |
31 |
|
import java.util.concurrent.ConcurrentHashMap; |
32 |
|
|
|
|
| 93.3% |
Uncovered Elements: 3 (45) |
Complexity: 10 |
Complexity Density: 0.34 |
|
33 |
|
public class FeatureRendererSettings implements Cloneable |
34 |
|
{ |
35 |
|
String[] renderOrder; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
Map<String, Boolean> featureGroups; |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
Map<String, FeatureColourI> featureColours; |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
Map<String, FeatureMatcherSetI> featureFilters; |
51 |
|
|
52 |
|
float transparency; |
53 |
|
|
54 |
|
Map<String, Float> featureOrder; |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
56 |
36 |
public FeatureRendererSettings(String[] renderOrder,... |
57 |
|
Map<String, Boolean> featureGroups, |
58 |
|
Map<String, FeatureColourI> featureColours, float transparency, |
59 |
|
Map<String, Float> featureOrder) |
60 |
|
{ |
61 |
36 |
super(); |
62 |
36 |
this.renderOrder = Arrays.copyOf(renderOrder, renderOrder.length); |
63 |
36 |
this.featureGroups = new ConcurrentHashMap<String, Boolean>( |
64 |
|
featureGroups); |
65 |
36 |
this.featureColours = new ConcurrentHashMap<String, FeatureColourI>( |
66 |
|
featureColours); |
67 |
36 |
this.transparency = transparency; |
68 |
36 |
this.featureOrder = new ConcurrentHashMap<String, Float>(featureOrder); |
69 |
|
} |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
@param |
75 |
|
|
|
|
| 91.9% |
Uncovered Elements: 3 (37) |
Complexity: 9 |
Complexity Density: 0.39 |
|
76 |
70 |
public FeatureRendererSettings(... |
77 |
|
jalview.viewmodel.seqfeatures.FeatureRendererModel fr) |
78 |
|
{ |
79 |
70 |
renderOrder = null; |
80 |
70 |
featureGroups = new ConcurrentHashMap<String, Boolean>(); |
81 |
70 |
featureColours = new ConcurrentHashMap<String, FeatureColourI>(); |
82 |
70 |
featureFilters = new HashMap<>(); |
83 |
70 |
featureOrder = new ConcurrentHashMap<String, Float>(); |
84 |
|
|
85 |
70 |
if (fr.renderOrder != null) |
86 |
|
{ |
87 |
61 |
this.renderOrder = new String[fr.renderOrder.length]; |
88 |
61 |
System.arraycopy(fr.renderOrder, 0, renderOrder, 0, |
89 |
|
fr.renderOrder.length); |
90 |
|
} |
91 |
70 |
if (fr.featureGroups != null) |
92 |
|
{ |
93 |
70 |
this.featureGroups = new ConcurrentHashMap<String, Boolean>( |
94 |
|
fr.featureGroups); |
95 |
|
} |
96 |
70 |
if (fr.featureColours != null) |
97 |
|
{ |
98 |
70 |
this.featureColours = new ConcurrentHashMap<String, FeatureColourI>( |
99 |
|
fr.featureColours); |
100 |
|
} |
101 |
70 |
Iterator<String> en = fr.featureColours.keySet().iterator(); |
102 |
1510 |
while (en.hasNext()) |
103 |
|
{ |
104 |
1440 |
String next = en.next(); |
105 |
1440 |
FeatureColourI val = featureColours.get(next); |
106 |
|
|
107 |
1440 |
if (val.isGraduatedColour() || val.isColourByLabel()) |
108 |
|
{ |
109 |
4 |
featureColours.put(next, new FeatureColour((FeatureColour) val)); |
110 |
|
} |
111 |
|
} |
112 |
|
|
113 |
70 |
if (fr.featureFilters != null) |
114 |
|
{ |
115 |
70 |
this.featureFilters.putAll(fr.featureFilters); |
116 |
|
} |
117 |
|
|
118 |
70 |
this.transparency = fr.transparency; |
119 |
70 |
if (fr.featureOrder != null) |
120 |
|
{ |
121 |
61 |
this.featureOrder = new ConcurrentHashMap<String, Float>( |
122 |
|
fr.featureOrder); |
123 |
|
} |
124 |
|
} |
125 |
|
} |