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