1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.schemes; |
22 |
|
|
23 |
|
import jalview.api.AlignViewportI; |
24 |
|
import jalview.api.AlignmentViewPanel; |
25 |
|
import jalview.datamodel.AlignmentAnnotation; |
26 |
|
import jalview.datamodel.SequenceGroup; |
27 |
|
|
28 |
|
import java.util.Hashtable; |
29 |
|
import java.util.Map; |
30 |
|
import java.util.Vector; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
@deprecated |
38 |
|
|
39 |
|
@Deprecated |
|
|
| 0% |
Uncovered Elements: 39 (39) |
Complexity: 8 |
Complexity Density: 0.32 |
|
40 |
|
public class RNAHelicesColourChooser |
41 |
|
{ |
42 |
|
|
43 |
|
AlignViewportI av; |
44 |
|
|
45 |
|
AlignmentViewPanel ap; |
46 |
|
|
47 |
|
ColourSchemeI oldcs; |
48 |
|
|
49 |
|
Map<SequenceGroup, ColourSchemeI> oldgroupColours; |
50 |
|
|
51 |
|
AlignmentAnnotation currentAnnotation; |
52 |
|
|
53 |
|
boolean adjusting = false; |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 6 |
Complexity Density: 0.3 |
|
55 |
0 |
public RNAHelicesColourChooser(AlignViewportI av,... |
56 |
|
final AlignmentViewPanel ap) |
57 |
|
{ |
58 |
0 |
oldcs = av.getGlobalColourScheme(); |
59 |
0 |
if (av.getAlignment().getGroups() != null) |
60 |
|
{ |
61 |
0 |
oldgroupColours = new Hashtable<>(); |
62 |
0 |
for (SequenceGroup sg : ap.getAlignment().getGroups()) |
63 |
|
{ |
64 |
0 |
if (sg.getColourScheme() != null) |
65 |
|
{ |
66 |
0 |
oldgroupColours.put(sg, sg.getColourScheme()); |
67 |
|
} |
68 |
|
} |
69 |
|
} |
70 |
0 |
this.av = av; |
71 |
0 |
this.ap = ap; |
72 |
|
|
73 |
0 |
adjusting = true; |
74 |
0 |
Vector<String> list = new Vector<>(); |
75 |
0 |
int index = 1; |
76 |
0 |
AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation(); |
77 |
0 |
if (anns != null) |
78 |
|
{ |
79 |
0 |
for (int i = 0; i < anns.length; i++) |
80 |
|
{ |
81 |
0 |
String label = anns[i].label; |
82 |
0 |
if (!list.contains(label)) |
83 |
|
{ |
84 |
0 |
list.addElement(label); |
85 |
|
} |
86 |
|
else |
87 |
|
{ |
88 |
0 |
list.addElement(label + "_" + (index++)); |
89 |
|
} |
90 |
|
} |
91 |
|
} |
92 |
|
|
93 |
0 |
adjusting = false; |
94 |
0 |
changeColour(); |
95 |
|
} |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
97 |
0 |
void changeColour()... |
98 |
|
{ |
99 |
|
|
100 |
0 |
if (adjusting) |
101 |
|
{ |
102 |
0 |
return; |
103 |
|
} |
104 |
0 |
RNAHelicesColour rhc = new RNAHelicesColour(av.getAlignment()); |
105 |
|
|
106 |
0 |
av.setGlobalColourScheme(rhc); |
107 |
|
|
108 |
0 |
ap.paintAlignment(true, true); |
109 |
|
} |
110 |
|
} |