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 |
66 |
public FeatureRendererSettings(... |
77 |
|
jalview.viewmodel.seqfeatures.FeatureRendererModel fr) |
78 |
|
{ |
79 |
66 |
renderOrder = null; |
80 |
66 |
featureGroups = new ConcurrentHashMap<String, Boolean>(); |
81 |
66 |
featureColours = new ConcurrentHashMap<String, FeatureColourI>(); |
82 |
66 |
featureFilters = new HashMap<>(); |
83 |
66 |
featureOrder = new ConcurrentHashMap<String, Float>(); |
84 |
|
|
85 |
66 |
if (fr.renderOrder != null) |
86 |
|
{ |
87 |
57 |
this.renderOrder = new String[fr.renderOrder.length]; |
88 |
57 |
System.arraycopy(fr.renderOrder, 0, renderOrder, 0, |
89 |
|
fr.renderOrder.length); |
90 |
|
} |
91 |
66 |
if (fr.featureGroups != null) |
92 |
|
{ |
93 |
66 |
this.featureGroups = new ConcurrentHashMap<String, Boolean>( |
94 |
|
fr.featureGroups); |
95 |
|
} |
96 |
66 |
if (fr.featureColours != null) |
97 |
|
{ |
98 |
66 |
this.featureColours = new ConcurrentHashMap<String, FeatureColourI>( |
99 |
|
fr.featureColours); |
100 |
|
} |
101 |
66 |
Iterator<String> en = fr.featureColours.keySet().iterator(); |
102 |
1398 |
while (en.hasNext()) |
103 |
|
{ |
104 |
1332 |
String next = en.next(); |
105 |
1332 |
FeatureColourI val = featureColours.get(next); |
106 |
|
|
107 |
1332 |
if (val.isGraduatedColour() || val.isColourByLabel()) |
108 |
|
{ |
109 |
4 |
featureColours.put(next, new FeatureColour((FeatureColour) val)); |
110 |
|
} |
111 |
|
} |
112 |
|
|
113 |
66 |
if (fr.featureFilters != null) |
114 |
|
{ |
115 |
66 |
this.featureFilters.putAll(fr.featureFilters); |
116 |
|
} |
117 |
|
|
118 |
66 |
this.transparency = fr.transparency; |
119 |
66 |
if (fr.featureOrder != null) |
120 |
|
{ |
121 |
57 |
this.featureOrder = new ConcurrentHashMap<String, Float>( |
122 |
|
fr.featureOrder); |
123 |
|
} |
124 |
|
} |
125 |
|
} |