1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.renderer; |
22 |
|
|
23 |
|
import java.awt.Color; |
24 |
|
|
25 |
|
import jalview.datamodel.SequenceGroup; |
26 |
|
import jalview.datamodel.SequenceI; |
27 |
|
import jalview.util.Comparison; |
28 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 12 |
Complexity Density: 0.55 |
|
29 |
|
public class OverviewResColourFinder extends ResidueColourFinder |
30 |
|
{ |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
Color gapColour; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
Color residueColour; |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
Color hiddenColour; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
@deprecated |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
3 |
@Deprecated... |
55 |
|
public OverviewResColourFinder() |
56 |
|
{ |
57 |
3 |
this(Color.lightGray, Color.white, Color.darkGray.darker()); |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@param |
64 |
|
@param |
65 |
|
@param |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
67 |
57 |
public OverviewResColourFinder(Color gaps, Color residues, Color hidden)... |
68 |
|
{ |
69 |
57 |
gapColour = gaps; |
70 |
57 |
residueColour = residues; |
71 |
57 |
hiddenColour = hidden; |
72 |
|
} |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
74 |
355631 |
@Override... |
75 |
|
public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i) |
76 |
|
{ |
77 |
355673 |
Color resBoxColour = residueColour; |
78 |
355697 |
char currentChar = seq.getCharAt(i); |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
355691 |
if (shader.getColourScheme() != null) |
84 |
|
{ |
85 |
130524 |
if (Comparison.isGap(currentChar) |
86 |
|
&& (!shader.getColourScheme().hasGapColour())) |
87 |
|
{ |
88 |
8153 |
resBoxColour = gapColour; |
89 |
|
} |
90 |
|
else |
91 |
|
{ |
92 |
122374 |
resBoxColour = shader.findColour(currentChar, i, seq); |
93 |
|
} |
94 |
|
} |
95 |
225132 |
else if (Comparison.isGap(currentChar)) |
96 |
|
{ |
97 |
39302 |
resBoxColour = gapColour; |
98 |
|
} |
99 |
|
|
100 |
355447 |
return resBoxColour; |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
@inheritDoc |
105 |
|
|
106 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
107 |
355646 |
@Override... |
108 |
|
protected Color getResidueBoxColour(boolean showBoxes, |
109 |
|
ResidueShaderI shader, SequenceGroup[] allGroups, SequenceI seq, |
110 |
|
int i) |
111 |
|
{ |
112 |
355666 |
ResidueShaderI currentShader; |
113 |
355695 |
SequenceGroup currentSequenceGroup = getCurrentSequenceGroup(allGroups, |
114 |
|
i); |
115 |
355672 |
if (currentSequenceGroup != null) |
116 |
|
{ |
117 |
114041 |
currentShader = currentSequenceGroup.getGroupColourScheme(); |
118 |
|
} |
119 |
|
else |
120 |
|
{ |
121 |
241627 |
currentShader = shader; |
122 |
|
} |
123 |
|
|
124 |
355662 |
return getBoxColour(currentShader, seq, i); |
125 |
|
} |
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
@return |
131 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
16 |
public Color getHiddenColour()... |
133 |
|
{ |
134 |
16 |
return hiddenColour; |
135 |
|
} |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
@return |
142 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
143 |
16 |
public Color getGapColour()... |
144 |
|
{ |
145 |
16 |
return gapColour; |
146 |
|
} |
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
@return |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
154 |
16 |
public Color getResidueColour()... |
155 |
|
{ |
156 |
16 |
return residueColour; |
157 |
|
} |
158 |
|
} |