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 |
310493 |
@Override... |
75 |
|
public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i) |
76 |
|
{ |
77 |
310529 |
Color resBoxColour = residueColour; |
78 |
310542 |
char currentChar = seq.getCharAt(i); |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
310554 |
if (shader.getColourScheme() != null) |
84 |
|
{ |
85 |
111812 |
if (Comparison.isGap(currentChar) |
86 |
|
&& (!shader.getColourScheme().hasGapColour())) |
87 |
|
{ |
88 |
8647 |
resBoxColour = gapColour; |
89 |
|
} |
90 |
|
else |
91 |
|
{ |
92 |
103165 |
resBoxColour = shader.findColour(currentChar, i, seq); |
93 |
|
} |
94 |
|
} |
95 |
198739 |
else if (Comparison.isGap(currentChar)) |
96 |
|
{ |
97 |
32211 |
resBoxColour = gapColour; |
98 |
|
} |
99 |
|
|
100 |
310383 |
return resBoxColour; |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
@inheritDoc |
105 |
|
|
106 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
107 |
310509 |
@Override... |
108 |
|
protected Color getResidueBoxColour(boolean showBoxes, |
109 |
|
ResidueShaderI shader, SequenceGroup[] allGroups, SequenceI seq, |
110 |
|
int i) |
111 |
|
{ |
112 |
310516 |
ResidueShaderI currentShader; |
113 |
310544 |
SequenceGroup currentSequenceGroup = getCurrentSequenceGroup(allGroups, |
114 |
|
i); |
115 |
310459 |
if (currentSequenceGroup != null) |
116 |
|
{ |
117 |
97436 |
currentShader = currentSequenceGroup.getGroupColourScheme(); |
118 |
|
} |
119 |
|
else |
120 |
|
{ |
121 |
213080 |
currentShader = shader; |
122 |
|
} |
123 |
|
|
124 |
310495 |
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 |
|
} |