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