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 jalview.datamodel.SequenceGroup; |
24 |
|
import jalview.datamodel.SequenceI; |
25 |
|
import jalview.util.Comparison; |
26 |
|
|
27 |
|
import java.awt.Color; |
28 |
|
|
|
|
| 79.5% |
Uncovered Elements: 8 (39) |
Complexity: 11 |
Complexity Density: 0.46 |
|
29 |
|
public class OverviewResColourFinder extends ResidueColourFinder |
30 |
|
{ |
31 |
|
final Color GAP_COLOUR; |
32 |
|
|
33 |
|
final Color RESIDUE_COLOUR; |
34 |
|
|
35 |
|
final Color HIDDEN_COLOUR; |
36 |
|
|
37 |
|
boolean useLegacy = false; |
38 |
|
|
39 |
|
public static final Color OVERVIEW_DEFAULT_GAP = Color.lightGray; |
40 |
|
|
41 |
|
public static final Color OVERVIEW_DEFAULT_LEGACY_GAP = Color.white; |
42 |
|
|
43 |
|
public static final Color OVERVIEW_DEFAULT_HIDDEN = Color.darkGray |
44 |
|
.darker(); |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
3 |
public OverviewResColourFinder()... |
50 |
|
{ |
51 |
3 |
this(false, OVERVIEW_DEFAULT_GAP, OVERVIEW_DEFAULT_HIDDEN); |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
@param |
58 |
|
|
59 |
|
@param |
60 |
|
|
61 |
|
@param |
62 |
|
|
63 |
|
|
|
|
| 55.6% |
Uncovered Elements: 4 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
64 |
3 |
public OverviewResColourFinder(boolean useLegacyColouring, Color gapCol,... |
65 |
|
Color hiddenCol) |
66 |
|
{ |
67 |
3 |
if (useLegacyColouring) |
68 |
|
{ |
69 |
0 |
GAP_COLOUR = Color.white; |
70 |
0 |
RESIDUE_COLOUR = Color.lightGray; |
71 |
0 |
HIDDEN_COLOUR = hiddenCol; |
72 |
|
} |
73 |
|
else |
74 |
|
{ |
75 |
3 |
GAP_COLOUR = gapCol; |
76 |
3 |
RESIDUE_COLOUR = Color.white; |
77 |
3 |
HIDDEN_COLOUR = hiddenCol; |
78 |
|
} |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
81 |
18 |
@Override... |
82 |
|
public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i) |
83 |
|
{ |
84 |
18 |
Color resBoxColour = RESIDUE_COLOUR; |
85 |
18 |
char currentChar = seq.getCharAt(i); |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
18 |
if (shader.getColourScheme() != null) |
91 |
|
{ |
92 |
14 |
if (Comparison.isGap(currentChar) |
93 |
|
&& (!shader.getColourScheme().hasGapColour())) |
94 |
|
{ |
95 |
4 |
resBoxColour = GAP_COLOUR; |
96 |
|
} |
97 |
|
else |
98 |
|
{ |
99 |
10 |
resBoxColour = shader.findColour(currentChar, i, seq); |
100 |
|
} |
101 |
|
} |
102 |
4 |
else if (Comparison.isGap(currentChar)) |
103 |
|
{ |
104 |
2 |
resBoxColour = GAP_COLOUR; |
105 |
|
} |
106 |
|
|
107 |
18 |
return resBoxColour; |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
@inheritDoc |
112 |
|
|
113 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
114 |
18 |
@Override... |
115 |
|
protected Color getResidueBoxColour(boolean showBoxes, |
116 |
|
ResidueShaderI shader, |
117 |
|
SequenceGroup[] allGroups, SequenceI seq, int i) |
118 |
|
{ |
119 |
18 |
ResidueShaderI currentShader; |
120 |
18 |
SequenceGroup currentSequenceGroup = getCurrentSequenceGroup(allGroups, |
121 |
|
i); |
122 |
18 |
if (currentSequenceGroup != null) |
123 |
|
{ |
124 |
0 |
currentShader = currentSequenceGroup.getGroupColourScheme(); |
125 |
|
} |
126 |
|
else |
127 |
|
{ |
128 |
18 |
currentShader = shader; |
129 |
|
} |
130 |
|
|
131 |
18 |
return getBoxColour(currentShader, seq, i); |
132 |
|
} |
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
@return |
138 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
139 |
0 |
protected Color getHiddenColour()... |
140 |
|
{ |
141 |
0 |
return HIDDEN_COLOUR; |
142 |
|
} |
143 |
|
} |