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