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