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 |
50 |
public OverviewResColourFinder(Color gaps, Color residues, Color hidden)... |
68 |
|
{ |
69 |
50 |
gapColour = gaps; |
70 |
50 |
residueColour = residues; |
71 |
50 |
hiddenColour = hidden; |
72 |
|
} |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
74 |
263956 |
@Override... |
75 |
|
public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i) |
76 |
|
{ |
77 |
263964 |
Color resBoxColour = residueColour; |
78 |
263969 |
char currentChar = seq.getCharAt(i); |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
263962 |
if (shader.getColourScheme() != null) |
84 |
|
{ |
85 |
96681 |
if (Comparison.isGap(currentChar) |
86 |
|
&& (!shader.getColourScheme().hasGapColour())) |
87 |
|
{ |
88 |
7150 |
resBoxColour = gapColour; |
89 |
|
} |
90 |
|
else |
91 |
|
{ |
92 |
89532 |
resBoxColour = shader.findColour(currentChar, i, seq); |
93 |
|
} |
94 |
|
} |
95 |
167284 |
else if (Comparison.isGap(currentChar)) |
96 |
|
{ |
97 |
27734 |
resBoxColour = gapColour; |
98 |
|
} |
99 |
|
|
100 |
263853 |
return resBoxColour; |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
@inheritDoc |
105 |
|
|
106 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
107 |
263936 |
@Override... |
108 |
|
protected Color getResidueBoxColour(boolean showBoxes, |
109 |
|
ResidueShaderI shader, SequenceGroup[] allGroups, SequenceI seq, |
110 |
|
int i) |
111 |
|
{ |
112 |
263940 |
ResidueShaderI currentShader; |
113 |
263945 |
SequenceGroup currentSequenceGroup = getCurrentSequenceGroup(allGroups, |
114 |
|
i); |
115 |
263982 |
if (currentSequenceGroup != null) |
116 |
|
{ |
117 |
88321 |
currentShader = currentSequenceGroup.getGroupColourScheme(); |
118 |
|
} |
119 |
|
else |
120 |
|
{ |
121 |
175667 |
currentShader = shader; |
122 |
|
} |
123 |
|
|
124 |
263965 |
return getBoxColour(currentShader, seq, i); |
125 |
|
} |
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
@return |
131 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
14 |
public Color getHiddenColour()... |
133 |
|
{ |
134 |
14 |
return hiddenColour; |
135 |
|
} |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
@return |
142 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
143 |
14 |
public Color getGapColour()... |
144 |
|
{ |
145 |
14 |
return gapColour; |
146 |
|
} |
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
@return |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
154 |
14 |
public Color getResidueColour()... |
155 |
|
{ |
156 |
14 |
return residueColour; |
157 |
|
} |
158 |
|
} |