1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.appletgui; |
22 |
|
|
23 |
|
import java.awt.BorderLayout; |
24 |
|
import java.awt.CardLayout; |
25 |
|
import java.awt.Checkbox; |
26 |
|
import java.awt.Choice; |
27 |
|
import java.awt.Color; |
28 |
|
import java.awt.Dimension; |
29 |
|
import java.awt.Frame; |
30 |
|
import java.awt.Panel; |
31 |
|
import java.awt.TextField; |
32 |
|
import java.awt.event.ActionEvent; |
33 |
|
import java.awt.event.ActionListener; |
34 |
|
import java.awt.event.AdjustmentEvent; |
35 |
|
import java.awt.event.AdjustmentListener; |
36 |
|
import java.awt.event.ItemEvent; |
37 |
|
import java.awt.event.ItemListener; |
38 |
|
import java.awt.event.MouseAdapter; |
39 |
|
import java.awt.event.MouseEvent; |
40 |
|
import java.awt.event.MouseListener; |
41 |
|
import java.awt.event.TextEvent; |
42 |
|
import java.awt.event.TextListener; |
43 |
|
import java.util.Vector; |
44 |
|
|
45 |
|
import jalview.datamodel.AlignmentAnnotation; |
46 |
|
import jalview.datamodel.HiddenColumns; |
47 |
|
import jalview.schemes.AnnotationColourGradient; |
48 |
|
import jalview.util.MessageManager; |
49 |
|
import jalview.viewmodel.annotationfilter.AnnotationFilterParameter; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
|
|
| 0% |
Uncovered Elements: 336 (336) |
Complexity: 75 |
Complexity Density: 0.34 |
|
55 |
|
public class AnnotationColumnChooser extends AnnotationRowFilter implements |
56 |
|
ActionListener, AdjustmentListener, ItemListener, MouseListener |
57 |
|
{ |
58 |
|
|
59 |
|
private Choice annotations = new Choice(); |
60 |
|
|
61 |
|
private Panel actionPanel = new Panel(); |
62 |
|
|
63 |
|
private TitledPanel thresholdPanel = new TitledPanel(); |
64 |
|
|
65 |
|
private Panel switchableViewsPanel = new Panel(new CardLayout()); |
66 |
|
|
67 |
|
private CardLayout switchableViewsLayout = (CardLayout) (switchableViewsPanel |
68 |
|
.getLayout()); |
69 |
|
|
70 |
|
private Panel noGraphFilterView = new Panel(); |
71 |
|
|
72 |
|
private Panel graphFilterView = new Panel(); |
73 |
|
|
74 |
|
private Panel annotationComboBoxPanel = new Panel(); |
75 |
|
|
76 |
|
private BorderLayout borderLayout1 = new BorderLayout(); |
77 |
|
|
78 |
|
private BorderLayout gBorderLayout = new BorderLayout(); |
79 |
|
|
80 |
|
private BorderLayout ngBorderLayout = new BorderLayout(); |
81 |
|
|
82 |
|
private Choice threshold = new Choice(); |
83 |
|
|
84 |
|
private StructureFilterPanel gStructureFilterPanel; |
85 |
|
|
86 |
|
private StructureFilterPanel ngStructureFilterPanel; |
87 |
|
|
88 |
|
private StructureFilterPanel currentStructureFilterPanel; |
89 |
|
|
90 |
|
private SearchPanel currentSearchPanel; |
91 |
|
|
92 |
|
private SearchPanel gSearchPanel; |
93 |
|
|
94 |
|
private SearchPanel ngSearchPanel; |
95 |
|
|
96 |
|
private FurtherActionPanel currentFurtherActionPanel; |
97 |
|
|
98 |
|
private FurtherActionPanel gFurtherActionPanel; |
99 |
|
|
100 |
|
private FurtherActionPanel ngFurtherActionPanel; |
101 |
|
|
102 |
|
public static final int ACTION_OPTION_SELECT = 1; |
103 |
|
|
104 |
|
public static int ACTION_OPTION_HIDE = 2; |
105 |
|
|
106 |
|
public static String NO_GRAPH_VIEW = "0"; |
107 |
|
|
108 |
|
public static String GRAPH_VIEW = "1"; |
109 |
|
|
110 |
|
private int actionOption = ACTION_OPTION_SELECT; |
111 |
|
|
112 |
|
private HiddenColumns oldHiddenColumns; |
113 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
114 |
0 |
public AnnotationColumnChooser()... |
115 |
|
{ |
116 |
0 |
try |
117 |
|
{ |
118 |
0 |
jbInit(); |
119 |
|
} catch (Exception ex) |
120 |
|
{ |
121 |
0 |
ex.printStackTrace(); |
122 |
|
} |
123 |
|
} |
124 |
|
|
|
|
| 0% |
Uncovered Elements: 49 (49) |
Complexity: 8 |
Complexity Density: 0.22 |
|
125 |
0 |
public AnnotationColumnChooser(AlignViewport av, final AlignmentPanel ap)... |
126 |
|
{ |
127 |
0 |
super(av, ap); |
128 |
0 |
frame = new Frame(); |
129 |
0 |
frame.add(this); |
130 |
0 |
jalview.bin.JalviewLite.addFrame(frame, |
131 |
|
MessageManager.getString("label.select_by_annotation"), 520, |
132 |
|
215); |
133 |
|
|
134 |
0 |
slider.addAdjustmentListener(this); |
135 |
0 |
slider.addMouseListener(this); |
136 |
|
|
137 |
0 |
AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation(); |
138 |
0 |
if (anns == null) |
139 |
|
{ |
140 |
0 |
return; |
141 |
|
} |
142 |
0 |
setOldHiddenColumns(av.getAlignment().getHiddenColumns()); |
143 |
0 |
adjusting = true; |
144 |
0 |
Vector<String> list = new Vector<>(); |
145 |
0 |
int index = 1; |
146 |
0 |
for (int i = 0; i < anns.length; i++) |
147 |
|
{ |
148 |
0 |
String label = anns[i].label; |
149 |
0 |
if (anns[i].sequenceRef != null) |
150 |
|
{ |
151 |
0 |
label = label + "_" + anns[i].sequenceRef.getName(); |
152 |
|
} |
153 |
0 |
if (!list.contains(label)) |
154 |
|
{ |
155 |
0 |
list.addElement(label); |
156 |
|
} |
157 |
|
else |
158 |
|
{ |
159 |
0 |
list.addElement(label + "_" + (index++)); |
160 |
|
} |
161 |
|
} |
162 |
|
|
163 |
0 |
for (int i = 0; i < list.size(); i++) |
164 |
|
{ |
165 |
0 |
annotations.addItem(list.elementAt(i).toString()); |
166 |
|
} |
167 |
|
|
168 |
0 |
populateThresholdComboBox(threshold); |
169 |
0 |
AnnotationColumnChooser lastChooser = av |
170 |
|
.getAnnotationColumnSelectionState(); |
171 |
|
|
172 |
0 |
if (lastChooser != null) |
173 |
|
{ |
174 |
0 |
currentSearchPanel = lastChooser.getCurrentSearchPanel(); |
175 |
0 |
currentStructureFilterPanel = lastChooser |
176 |
|
.getCurrentStructureFilterPanel(); |
177 |
0 |
annotations.select(lastChooser.getAnnotations().getSelectedIndex()); |
178 |
0 |
threshold.select(lastChooser.getThreshold().getSelectedIndex()); |
179 |
0 |
actionOption = lastChooser.getActionOption(); |
180 |
0 |
percentThreshold.setState(lastChooser.percentThreshold.getState()); |
181 |
|
} |
182 |
|
|
183 |
0 |
try |
184 |
|
{ |
185 |
0 |
jbInit(); |
186 |
|
} catch (Exception ex) |
187 |
|
{ |
188 |
|
} |
189 |
0 |
adjusting = false; |
190 |
|
|
191 |
0 |
updateView(); |
192 |
0 |
frame.invalidate(); |
193 |
0 |
frame.pack(); |
194 |
|
} |
195 |
|
|
|
|
| 0% |
Uncovered Elements: 55 (55) |
Complexity: 1 |
Complexity Density: 0.02 |
|
196 |
0 |
private void jbInit() throws Exception... |
197 |
|
{ |
198 |
0 |
ok.setLabel(MessageManager.getString("action.ok")); |
199 |
|
|
200 |
0 |
cancel.setLabel(MessageManager.getString("action.cancel")); |
201 |
|
|
202 |
0 |
thresholdValue.setEnabled(false); |
203 |
0 |
thresholdValue.setColumns(7); |
204 |
0 |
thresholdValue.setCaretPosition(0); |
205 |
|
|
206 |
0 |
ok.addActionListener(this); |
207 |
0 |
cancel.addActionListener(this); |
208 |
0 |
annotations.addItemListener(this); |
209 |
0 |
thresholdValue.addActionListener(this); |
210 |
0 |
threshold.addItemListener(this); |
211 |
|
|
212 |
0 |
slider.setBackground(Color.white); |
213 |
0 |
slider.setEnabled(false); |
214 |
0 |
slider.setPreferredSize(new Dimension(100, 32)); |
215 |
|
|
216 |
0 |
thresholdPanel.setBackground(Color.white); |
217 |
|
|
218 |
|
|
219 |
|
|
220 |
0 |
percentThreshold.setLabel("As percentage"); |
221 |
0 |
percentThreshold.addItemListener(this); |
222 |
|
|
223 |
0 |
actionPanel.setBackground(Color.white); |
224 |
|
|
225 |
|
|
226 |
0 |
graphFilterView.setLayout(gBorderLayout); |
227 |
0 |
graphFilterView.setBackground(Color.white); |
228 |
|
|
229 |
0 |
noGraphFilterView.setLayout(ngBorderLayout); |
230 |
0 |
noGraphFilterView.setBackground(Color.white); |
231 |
|
|
232 |
0 |
annotationComboBoxPanel.setBackground(Color.white); |
233 |
|
|
234 |
|
|
235 |
0 |
gSearchPanel = new SearchPanel(this); |
236 |
0 |
ngSearchPanel = new SearchPanel(this); |
237 |
0 |
gFurtherActionPanel = new FurtherActionPanel(this); |
238 |
0 |
ngFurtherActionPanel = new FurtherActionPanel(this); |
239 |
0 |
gStructureFilterPanel = new StructureFilterPanel(this); |
240 |
0 |
ngStructureFilterPanel = new StructureFilterPanel(this); |
241 |
|
|
242 |
0 |
thresholdPanel.setTitle("Threshold Filter"); |
243 |
0 |
thresholdPanel.add(getThreshold()); |
244 |
0 |
thresholdPanel.add(slider); |
245 |
0 |
thresholdPanel.add(thresholdValue); |
246 |
0 |
thresholdPanel.add(percentThreshold); |
247 |
|
|
248 |
0 |
actionPanel.add(ok); |
249 |
0 |
actionPanel.add(cancel); |
250 |
|
|
251 |
0 |
Panel staticPanel = new Panel(); |
252 |
0 |
staticPanel.setLayout(new BorderLayout()); |
253 |
0 |
staticPanel.setBackground(Color.white); |
254 |
|
|
255 |
0 |
staticPanel.add(gSearchPanel, java.awt.BorderLayout.NORTH); |
256 |
0 |
staticPanel.add(gStructureFilterPanel, java.awt.BorderLayout.SOUTH); |
257 |
|
|
258 |
0 |
graphFilterView.add(staticPanel, java.awt.BorderLayout.NORTH); |
259 |
0 |
graphFilterView.add(thresholdPanel, java.awt.BorderLayout.CENTER); |
260 |
0 |
graphFilterView.add(gFurtherActionPanel, java.awt.BorderLayout.SOUTH); |
261 |
|
|
262 |
0 |
noGraphFilterView.add(ngSearchPanel, java.awt.BorderLayout.PAGE_START); |
263 |
0 |
noGraphFilterView.add(ngStructureFilterPanel, |
264 |
|
java.awt.BorderLayout.CENTER); |
265 |
0 |
noGraphFilterView.add(ngFurtherActionPanel, |
266 |
|
java.awt.BorderLayout.CENTER); |
267 |
|
|
268 |
0 |
annotationComboBoxPanel.add(getAnnotations()); |
269 |
0 |
switchableViewsPanel.add(noGraphFilterView, |
270 |
|
AnnotationColumnChooser.NO_GRAPH_VIEW); |
271 |
0 |
switchableViewsPanel.add(graphFilterView, |
272 |
|
AnnotationColumnChooser.GRAPH_VIEW); |
273 |
|
|
274 |
0 |
this.setLayout(borderLayout1); |
275 |
0 |
this.add(annotationComboBoxPanel, java.awt.BorderLayout.PAGE_START); |
276 |
0 |
this.add(switchableViewsPanel, java.awt.BorderLayout.CENTER); |
277 |
0 |
this.add(actionPanel, java.awt.BorderLayout.SOUTH); |
278 |
|
|
279 |
0 |
selectedAnnotationChanged(); |
280 |
0 |
this.validate(); |
281 |
|
} |
282 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
283 |
0 |
@Override... |
284 |
|
@SuppressWarnings("unchecked") |
285 |
|
public void reset() |
286 |
|
{ |
287 |
0 |
if (this.getOldHiddenColumns() != null) |
288 |
|
{ |
289 |
0 |
av.getColumnSelection().clear(); |
290 |
|
|
291 |
0 |
if (av.getAnnotationColumnSelectionState() != null) |
292 |
|
{ |
293 |
0 |
HiddenColumns oldHidden = av.getAnnotationColumnSelectionState() |
294 |
|
.getOldHiddenColumns(); |
295 |
0 |
av.getAlignment().setHiddenColumns(oldHidden); |
296 |
|
} |
297 |
0 |
av.sendSelection(); |
298 |
0 |
ap.paintAlignment(true, true); |
299 |
|
} |
300 |
|
|
301 |
|
} |
302 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
303 |
0 |
@Override... |
304 |
|
public void adjustmentValueChanged(AdjustmentEvent evt) |
305 |
|
{ |
306 |
0 |
if (!adjusting) |
307 |
|
{ |
308 |
0 |
setThresholdValueText(); |
309 |
0 |
valueChanged(!sliderDragging); |
310 |
|
} |
311 |
|
} |
312 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
313 |
0 |
protected void addSliderMouseListeners()... |
314 |
|
{ |
315 |
|
|
316 |
0 |
slider.addMouseListener(new MouseAdapter() |
317 |
|
{ |
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
318 |
0 |
@Override... |
319 |
|
public void mousePressed(MouseEvent e) |
320 |
|
{ |
321 |
0 |
sliderDragging = true; |
322 |
0 |
super.mousePressed(e); |
323 |
|
} |
324 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
325 |
0 |
@Override... |
326 |
|
public void mouseDragged(MouseEvent e) |
327 |
|
{ |
328 |
0 |
sliderDragging = true; |
329 |
0 |
super.mouseDragged(e); |
330 |
|
} |
331 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
332 |
0 |
@Override... |
333 |
|
public void mouseReleased(MouseEvent evt) |
334 |
|
{ |
335 |
0 |
if (sliderDragging) |
336 |
|
{ |
337 |
0 |
sliderDragging = false; |
338 |
0 |
valueChanged(true); |
339 |
|
} |
340 |
0 |
ap.paintAlignment(true, true); |
341 |
|
} |
342 |
|
}); |
343 |
|
} |
344 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
345 |
0 |
@Override... |
346 |
|
public void valueChanged(boolean updateAllAnnotation) |
347 |
|
{ |
348 |
0 |
if (slider.isEnabled()) |
349 |
|
{ |
350 |
0 |
getCurrentAnnotation().threshold.value = slider.getValue() / 1000f; |
351 |
0 |
updateView(); |
352 |
|
} |
353 |
|
} |
354 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
355 |
0 |
public Choice getThreshold()... |
356 |
|
{ |
357 |
0 |
return threshold; |
358 |
|
} |
359 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
360 |
0 |
public void setThreshold(Choice threshold)... |
361 |
|
{ |
362 |
0 |
this.threshold = threshold; |
363 |
|
} |
364 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
365 |
0 |
public Choice getAnnotations()... |
366 |
|
{ |
367 |
0 |
return annotations; |
368 |
|
} |
369 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
370 |
0 |
public void setAnnotations(Choice annotations)... |
371 |
|
{ |
372 |
0 |
this.annotations = annotations; |
373 |
|
} |
374 |
|
|
|
|
| 0% |
Uncovered Elements: 90 (90) |
Complexity: 17 |
Complexity Density: 0.29 |
|
375 |
0 |
@Override... |
376 |
|
public void updateView() |
377 |
|
{ |
378 |
|
|
379 |
0 |
if (adjusting) |
380 |
|
{ |
381 |
0 |
return; |
382 |
|
} |
383 |
|
|
384 |
0 |
AnnotationFilterParameter filterParams = new AnnotationFilterParameter(); |
385 |
0 |
setCurrentAnnotation(av.getAlignment() |
386 |
|
.getAlignmentAnnotation()[getAnnotations().getSelectedIndex()]); |
387 |
|
|
388 |
0 |
int selectedThresholdItem = getSelectedThresholdItem( |
389 |
|
getThreshold().getSelectedIndex()); |
390 |
|
|
391 |
0 |
slider.setEnabled(true); |
392 |
0 |
thresholdValue.setEnabled(true); |
393 |
0 |
percentThreshold.setEnabled(true); |
394 |
|
|
395 |
0 |
if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD) |
396 |
|
{ |
397 |
0 |
slider.setEnabled(false); |
398 |
0 |
thresholdValue.setEnabled(false); |
399 |
0 |
thresholdValue.setText(""); |
400 |
0 |
percentThreshold.setEnabled(false); |
401 |
|
|
402 |
|
} |
403 |
0 |
else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD) |
404 |
|
{ |
405 |
0 |
if (getCurrentAnnotation().threshold == null) |
406 |
|
{ |
407 |
0 |
getCurrentAnnotation().setThreshold(new jalview.datamodel.GraphLine( |
408 |
|
(getCurrentAnnotation().graphMax |
409 |
|
- getCurrentAnnotation().graphMin) / 2f, |
410 |
|
"Threshold", Color.black)); |
411 |
|
} |
412 |
|
|
413 |
0 |
adjusting = true; |
414 |
|
|
415 |
|
|
416 |
|
|
417 |
0 |
slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000)); |
418 |
0 |
slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000)); |
419 |
0 |
slider.setValue( |
420 |
|
(int) (getCurrentAnnotation().threshold.value * 1000)); |
421 |
0 |
setThresholdValueText(); |
422 |
|
|
423 |
0 |
slider.setEnabled(true); |
424 |
0 |
thresholdValue.setEnabled(true); |
425 |
0 |
percentThreshold.setEnabled(true); |
426 |
0 |
adjusting = false; |
427 |
|
|
428 |
|
|
429 |
0 |
filterParams.setThresholdType( |
430 |
|
AnnotationFilterParameter.ThresholdType.NO_THRESHOLD); |
431 |
0 |
if (getCurrentAnnotation().isQuantitative()) |
432 |
|
{ |
433 |
0 |
filterParams |
434 |
|
.setThresholdValue(getCurrentAnnotation().threshold.value); |
435 |
|
|
436 |
0 |
if (selectedThresholdItem == AnnotationColourGradient.ABOVE_THRESHOLD) |
437 |
|
{ |
438 |
0 |
filterParams.setThresholdType( |
439 |
|
AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD); |
440 |
|
} |
441 |
0 |
else if (selectedThresholdItem == AnnotationColourGradient.BELOW_THRESHOLD) |
442 |
|
{ |
443 |
0 |
filterParams.setThresholdType( |
444 |
|
AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD); |
445 |
|
} |
446 |
|
} |
447 |
|
} |
448 |
|
|
449 |
0 |
if (currentStructureFilterPanel != null) |
450 |
|
{ |
451 |
0 |
if (currentStructureFilterPanel.alphaHelix.getState()) |
452 |
|
{ |
453 |
0 |
filterParams.setFilterAlphaHelix(true); |
454 |
|
} |
455 |
0 |
if (currentStructureFilterPanel.betaStrand.getState()) |
456 |
|
{ |
457 |
0 |
filterParams.setFilterBetaSheet(true); |
458 |
|
} |
459 |
0 |
if (currentStructureFilterPanel.turn.getState()) |
460 |
|
{ |
461 |
0 |
filterParams.setFilterTurn(true); |
462 |
|
} |
463 |
|
} |
464 |
|
|
465 |
0 |
if (currentSearchPanel != null) |
466 |
|
{ |
467 |
|
|
468 |
0 |
if (!currentSearchPanel.searchBox.getText().isEmpty()) |
469 |
|
{ |
470 |
0 |
currentSearchPanel.description.setEnabled(true); |
471 |
0 |
currentSearchPanel.displayName.setEnabled(true); |
472 |
0 |
filterParams.setRegexString(currentSearchPanel.searchBox.getText()); |
473 |
0 |
if (currentSearchPanel.displayName.getState()) |
474 |
|
{ |
475 |
0 |
filterParams.addRegexSearchField( |
476 |
|
AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING); |
477 |
|
} |
478 |
0 |
if (currentSearchPanel.description.getState()) |
479 |
|
{ |
480 |
0 |
filterParams.addRegexSearchField( |
481 |
|
AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION); |
482 |
|
} |
483 |
|
} |
484 |
|
else |
485 |
|
{ |
486 |
0 |
currentSearchPanel.description.setEnabled(false); |
487 |
0 |
currentSearchPanel.displayName.setEnabled(false); |
488 |
|
} |
489 |
|
} |
490 |
|
|
491 |
|
|
492 |
|
|
493 |
|
|
494 |
0 |
av.showAllHiddenColumns(); |
495 |
0 |
av.getColumnSelection().filterAnnotations(getCurrentAnnotation(), |
496 |
|
filterParams); |
497 |
|
|
498 |
0 |
if (getActionOption() == ACTION_OPTION_HIDE) |
499 |
|
{ |
500 |
0 |
av.hideSelectedColumns(); |
501 |
|
} |
502 |
|
|
503 |
0 |
filterParams = null; |
504 |
0 |
av.setAnnotationColumnSelectionState(this); |
505 |
0 |
av.sendSelection(); |
506 |
0 |
ap.paintAlignment(true, true); |
507 |
|
} |
508 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
509 |
0 |
public HiddenColumns getOldHiddenColumns()... |
510 |
|
{ |
511 |
0 |
return oldHiddenColumns; |
512 |
|
} |
513 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
514 |
0 |
public void setOldHiddenColumns(HiddenColumns currentHiddenColumns)... |
515 |
|
{ |
516 |
0 |
if (currentHiddenColumns != null) |
517 |
|
{ |
518 |
0 |
this.oldHiddenColumns = new HiddenColumns(currentHiddenColumns); |
519 |
|
} |
520 |
|
} |
521 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
522 |
0 |
public FurtherActionPanel getCurrentFutherActionPanel()... |
523 |
|
{ |
524 |
0 |
return currentFurtherActionPanel; |
525 |
|
} |
526 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
527 |
0 |
public void setCurrentFutherActionPanel(... |
528 |
|
FurtherActionPanel currentFutherActionPanel) |
529 |
|
{ |
530 |
0 |
this.currentFurtherActionPanel = currentFutherActionPanel; |
531 |
|
} |
532 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
533 |
0 |
public SearchPanel getCurrentSearchPanel()... |
534 |
|
{ |
535 |
0 |
return currentSearchPanel; |
536 |
|
} |
537 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
538 |
0 |
public void setCurrentSearchPanel(SearchPanel currentSearchPanel)... |
539 |
|
{ |
540 |
0 |
this.currentSearchPanel = currentSearchPanel; |
541 |
|
} |
542 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
543 |
0 |
public int getActionOption()... |
544 |
|
{ |
545 |
0 |
return actionOption; |
546 |
|
} |
547 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
548 |
0 |
public void setActionOption(int actionOption)... |
549 |
|
{ |
550 |
0 |
this.actionOption = actionOption; |
551 |
|
} |
552 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
553 |
0 |
public StructureFilterPanel getCurrentStructureFilterPanel()... |
554 |
|
{ |
555 |
0 |
return currentStructureFilterPanel; |
556 |
|
} |
557 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
558 |
0 |
public void setCurrentStructureFilterPanel(... |
559 |
|
StructureFilterPanel currentStructureFilterPanel) |
560 |
|
{ |
561 |
0 |
this.currentStructureFilterPanel = currentStructureFilterPanel; |
562 |
|
} |
563 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.71 |
|
564 |
0 |
@Override... |
565 |
|
public void itemStateChanged(ItemEvent e) |
566 |
|
{ |
567 |
0 |
if (e.getSource() == annotations) |
568 |
|
{ |
569 |
0 |
selectedAnnotationChanged(); |
570 |
|
} |
571 |
0 |
else if (e.getSource() == threshold) |
572 |
|
{ |
573 |
0 |
threshold_actionPerformed(null); |
574 |
|
} |
575 |
0 |
else if (e.getSource() == percentThreshold) |
576 |
|
{ |
577 |
0 |
if (!adjusting) |
578 |
|
{ |
579 |
0 |
percentageValue_actionPerformed(); |
580 |
|
} |
581 |
|
|
582 |
|
} |
583 |
|
} |
584 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
|
585 |
0 |
public void selectedAnnotationChanged()... |
586 |
|
{ |
587 |
0 |
String currentView = AnnotationColumnChooser.NO_GRAPH_VIEW; |
588 |
0 |
if (av.getAlignment().getAlignmentAnnotation()[getAnnotations() |
589 |
|
.getSelectedIndex()].isQuantitative()) |
590 |
|
{ |
591 |
0 |
currentView = AnnotationColumnChooser.GRAPH_VIEW; |
592 |
|
} |
593 |
|
|
594 |
0 |
gSearchPanel.syncState(); |
595 |
0 |
gFurtherActionPanel.syncState(); |
596 |
0 |
gStructureFilterPanel.syncState(); |
597 |
|
|
598 |
0 |
ngSearchPanel.syncState(); |
599 |
0 |
ngFurtherActionPanel.syncState(); |
600 |
0 |
ngStructureFilterPanel.syncState(); |
601 |
|
|
602 |
0 |
switchableViewsLayout.show(switchableViewsPanel, currentView); |
603 |
0 |
updateView(); |
604 |
|
} |
605 |
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 5 |
Complexity Density: 0.33 |
|
606 |
|
public class FurtherActionPanel extends Panel implements ItemListener |
607 |
|
{ |
608 |
|
private AnnotationColumnChooser aColChooser; |
609 |
|
|
610 |
|
private Choice furtherAction = new Choice(); |
611 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
612 |
0 |
public FurtherActionPanel(AnnotationColumnChooser aColChooser)... |
613 |
|
{ |
614 |
0 |
this.aColChooser = aColChooser; |
615 |
0 |
furtherAction.addItem("Select"); |
616 |
0 |
furtherAction.addItem("Hide"); |
617 |
0 |
furtherAction.addItemListener(this); |
618 |
0 |
syncState(); |
619 |
|
|
620 |
|
|
621 |
|
|
622 |
|
|
623 |
0 |
this.add(furtherAction); |
624 |
|
} |
625 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
626 |
0 |
public void syncState()... |
627 |
|
{ |
628 |
0 |
if (aColChooser |
629 |
|
.getActionOption() == AnnotationColumnChooser.ACTION_OPTION_HIDE) |
630 |
|
{ |
631 |
0 |
furtherAction.select("Hide"); |
632 |
|
} |
633 |
|
else |
634 |
|
{ |
635 |
0 |
furtherAction.select("Select"); |
636 |
|
} |
637 |
|
} |
638 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
639 |
0 |
@Override... |
640 |
|
public void itemStateChanged(ItemEvent e) |
641 |
|
{ |
642 |
0 |
aColChooser.setCurrentFutherActionPanel(this); |
643 |
0 |
if (furtherAction.getSelectedItem().equalsIgnoreCase("Select")) |
644 |
|
{ |
645 |
0 |
setActionOption(ACTION_OPTION_SELECT); |
646 |
0 |
updateView(); |
647 |
|
} |
648 |
|
else |
649 |
|
{ |
650 |
0 |
setActionOption(ACTION_OPTION_HIDE); |
651 |
0 |
updateView(); |
652 |
|
} |
653 |
|
|
654 |
|
} |
655 |
|
} |
656 |
|
|
|
|
| 0% |
Uncovered Elements: 82 (82) |
Complexity: 18 |
Complexity Density: 0.31 |
|
657 |
|
public class StructureFilterPanel extends TitledPanel |
658 |
|
implements ItemListener |
659 |
|
{ |
660 |
|
private AnnotationColumnChooser aColChooser; |
661 |
|
|
662 |
|
private Checkbox alphaHelix = new Checkbox(); |
663 |
|
|
664 |
|
private Checkbox betaStrand = new Checkbox(); |
665 |
|
|
666 |
|
private Checkbox turn = new Checkbox(); |
667 |
|
|
668 |
|
private Checkbox all = new Checkbox(); |
669 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 1 |
Complexity Density: 0.05 |
|
670 |
0 |
public StructureFilterPanel(AnnotationColumnChooser aColChooser)... |
671 |
|
{ |
672 |
0 |
this.aColChooser = aColChooser; |
673 |
|
|
674 |
0 |
alphaHelix.setLabel(MessageManager.getString("label.alpha_helix")); |
675 |
0 |
alphaHelix.setBackground(Color.white); |
676 |
|
|
677 |
0 |
alphaHelix.addItemListener(this); |
678 |
|
|
679 |
0 |
betaStrand.setLabel(MessageManager.getString("label.beta_strand")); |
680 |
0 |
betaStrand.setBackground(Color.white); |
681 |
0 |
betaStrand.addItemListener(this); |
682 |
|
|
683 |
0 |
turn.setLabel(MessageManager.getString("label.turn")); |
684 |
0 |
turn.setBackground(Color.white); |
685 |
0 |
turn.addItemListener(this); |
686 |
|
|
687 |
0 |
all.setLabel(MessageManager.getString("label.select_all")); |
688 |
0 |
all.setBackground(Color.white); |
689 |
0 |
all.addItemListener(this); |
690 |
|
|
691 |
0 |
this.setBackground(Color.white); |
692 |
0 |
this.setTitle("Structure Filter"); |
693 |
|
|
694 |
|
|
695 |
0 |
this.add(all); |
696 |
0 |
this.add(alphaHelix); |
697 |
0 |
this.add(betaStrand); |
698 |
0 |
this.add(turn); |
699 |
|
} |
700 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
701 |
0 |
public void alphaHelix_actionPerformed()... |
702 |
|
{ |
703 |
0 |
updateSelectAllState(); |
704 |
0 |
aColChooser.setCurrentStructureFilterPanel(this); |
705 |
0 |
aColChooser.updateView(); |
706 |
|
} |
707 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
708 |
0 |
public void betaStrand_actionPerformed()... |
709 |
|
{ |
710 |
0 |
updateSelectAllState(); |
711 |
0 |
aColChooser.setCurrentStructureFilterPanel(this); |
712 |
0 |
aColChooser.updateView(); |
713 |
|
} |
714 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
715 |
0 |
public void turn_actionPerformed()... |
716 |
|
{ |
717 |
0 |
updateSelectAllState(); |
718 |
0 |
aColChooser.setCurrentStructureFilterPanel(this); |
719 |
0 |
aColChooser.updateView(); |
720 |
|
} |
721 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
722 |
0 |
public void all_actionPerformed()... |
723 |
|
{ |
724 |
0 |
if (all.getState()) |
725 |
|
{ |
726 |
0 |
alphaHelix.setState(true); |
727 |
0 |
betaStrand.setState(true); |
728 |
0 |
turn.setState(true); |
729 |
|
} |
730 |
|
else |
731 |
|
{ |
732 |
0 |
alphaHelix.setState(false); |
733 |
0 |
betaStrand.setState(false); |
734 |
0 |
turn.setState(false); |
735 |
|
} |
736 |
0 |
aColChooser.setCurrentStructureFilterPanel(this); |
737 |
0 |
aColChooser.updateView(); |
738 |
|
} |
739 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 4 |
Complexity Density: 1.33 |
|
740 |
0 |
public void updateSelectAllState()... |
741 |
|
{ |
742 |
0 |
if (alphaHelix.getState() && betaStrand.getState() && turn.getState()) |
743 |
|
{ |
744 |
0 |
all.setState(true); |
745 |
|
} |
746 |
|
else |
747 |
|
{ |
748 |
0 |
all.setState(false); |
749 |
|
} |
750 |
|
} |
751 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
752 |
0 |
public void syncState()... |
753 |
|
{ |
754 |
0 |
StructureFilterPanel sfp = aColChooser |
755 |
|
.getCurrentStructureFilterPanel(); |
756 |
0 |
if (sfp != null) |
757 |
|
{ |
758 |
0 |
alphaHelix.setState(sfp.alphaHelix.getState()); |
759 |
0 |
betaStrand.setState(sfp.betaStrand.getState()); |
760 |
0 |
turn.setState(sfp.turn.getState()); |
761 |
0 |
if (sfp.all.getState()) |
762 |
|
{ |
763 |
0 |
all.setState(true); |
764 |
0 |
alphaHelix.setState(true); |
765 |
0 |
betaStrand.setState(true); |
766 |
0 |
turn.setState(true); |
767 |
|
} |
768 |
|
} |
769 |
|
|
770 |
|
} |
771 |
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 5 |
Complexity Density: 0.62 |
|
772 |
0 |
@Override... |
773 |
|
public void itemStateChanged(ItemEvent e) |
774 |
|
{ |
775 |
0 |
if (e.getSource() == alphaHelix) |
776 |
|
{ |
777 |
0 |
alphaHelix_actionPerformed(); |
778 |
|
} |
779 |
0 |
else if (e.getSource() == betaStrand) |
780 |
|
{ |
781 |
0 |
betaStrand_actionPerformed(); |
782 |
|
} |
783 |
0 |
else if (e.getSource() == turn) |
784 |
|
{ |
785 |
0 |
turn_actionPerformed(); |
786 |
|
} |
787 |
0 |
else if (e.getSource() == all) |
788 |
|
{ |
789 |
0 |
all_actionPerformed(); |
790 |
|
} |
791 |
|
} |
792 |
|
} |
793 |
|
|
|
|
| 0% |
Uncovered Elements: 44 (44) |
Complexity: 10 |
Complexity Density: 0.32 |
|
794 |
|
public class SearchPanel extends TitledPanel implements ItemListener |
795 |
|
{ |
796 |
|
private AnnotationColumnChooser aColChooser; |
797 |
|
|
798 |
|
private Checkbox displayName = new Checkbox(); |
799 |
|
|
800 |
|
private Checkbox description = new Checkbox(); |
801 |
|
|
802 |
|
private TextField searchBox = new TextField(10); |
803 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
|
804 |
0 |
public SearchPanel(AnnotationColumnChooser aColChooser)... |
805 |
|
{ |
806 |
|
|
807 |
0 |
this.aColChooser = aColChooser; |
808 |
0 |
searchBox.addTextListener(new TextListener() |
809 |
|
{ |
810 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
811 |
0 |
@Override... |
812 |
|
public void textValueChanged(TextEvent e) |
813 |
|
{ |
814 |
0 |
searchStringAction(); |
815 |
|
|
816 |
|
} |
817 |
|
|
818 |
|
}); |
819 |
|
|
820 |
0 |
displayName.setLabel(MessageManager.getString("label.label")); |
821 |
0 |
displayName.setEnabled(false); |
822 |
0 |
displayName.addItemListener(this); |
823 |
|
|
824 |
0 |
description.setLabel(MessageManager.getString("label.description")); |
825 |
0 |
description.setEnabled(false); |
826 |
0 |
description.addItemListener(this); |
827 |
0 |
this.setTitle("Search Filter"); |
828 |
|
|
829 |
|
|
830 |
0 |
syncState(); |
831 |
0 |
this.add(searchBox); |
832 |
0 |
this.add(displayName); |
833 |
0 |
this.add(description); |
834 |
|
} |
835 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
836 |
0 |
public void displayNameCheckboxAction()... |
837 |
|
{ |
838 |
0 |
aColChooser.setCurrentSearchPanel(this); |
839 |
0 |
aColChooser.updateView(); |
840 |
|
} |
841 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
842 |
0 |
public void discriptionCheckboxAction()... |
843 |
|
{ |
844 |
0 |
aColChooser.setCurrentSearchPanel(this); |
845 |
0 |
aColChooser.updateView(); |
846 |
|
} |
847 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
848 |
0 |
public void searchStringAction()... |
849 |
|
{ |
850 |
0 |
aColChooser.setCurrentSearchPanel(this); |
851 |
0 |
aColChooser.updateView(); |
852 |
|
} |
853 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
854 |
0 |
public void syncState()... |
855 |
|
{ |
856 |
0 |
SearchPanel sp = aColChooser.getCurrentSearchPanel(); |
857 |
0 |
if (sp != null) |
858 |
|
{ |
859 |
0 |
description.setEnabled(sp.description.isEnabled()); |
860 |
0 |
description.setState(sp.description.getState()); |
861 |
|
|
862 |
0 |
displayName.setEnabled(sp.displayName.isEnabled()); |
863 |
0 |
displayName.setState(sp.displayName.getState()); |
864 |
|
|
865 |
0 |
searchBox.setText(sp.searchBox.getText()); |
866 |
|
} |
867 |
|
} |
868 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
869 |
0 |
@Override... |
870 |
|
public void itemStateChanged(ItemEvent e) |
871 |
|
{ |
872 |
0 |
if (e.getSource() == displayName) |
873 |
|
{ |
874 |
0 |
displayNameCheckboxAction(); |
875 |
|
} |
876 |
0 |
else if (e.getSource() == description) |
877 |
|
{ |
878 |
0 |
discriptionCheckboxAction(); |
879 |
|
} |
880 |
|
|
881 |
|
} |
882 |
|
} |
883 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.57 |
|
884 |
0 |
@Override... |
885 |
|
public void actionPerformed(ActionEvent evt) |
886 |
|
{ |
887 |
|
|
888 |
0 |
if (evt.getSource() == ok) |
889 |
|
{ |
890 |
0 |
ok_actionPerformed(null); |
891 |
|
} |
892 |
0 |
else if (evt.getSource() == cancel) |
893 |
|
{ |
894 |
0 |
cancel_actionPerformed(null); |
895 |
|
} |
896 |
0 |
else if (evt.getSource() == thresholdValue) |
897 |
|
{ |
898 |
0 |
thresholdValue_actionPerformed(null); |
899 |
|
} |
900 |
|
else |
901 |
|
{ |
902 |
0 |
updateView(); |
903 |
|
} |
904 |
|
} |
905 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
906 |
0 |
@Override... |
907 |
|
public void mouseClicked(MouseEvent e) |
908 |
|
{ |
909 |
|
|
910 |
|
|
911 |
|
} |
912 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
913 |
0 |
@Override... |
914 |
|
public void mousePressed(MouseEvent e) |
915 |
|
{ |
916 |
0 |
if (e.getSource() == slider) |
917 |
|
{ |
918 |
0 |
updateView(); |
919 |
|
} |
920 |
|
|
921 |
|
} |
922 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
923 |
0 |
@Override... |
924 |
|
public void mouseReleased(MouseEvent e) |
925 |
|
{ |
926 |
0 |
if (e.getSource() == slider) |
927 |
|
{ |
928 |
0 |
updateView(); |
929 |
|
} |
930 |
|
} |
931 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
932 |
0 |
@Override... |
933 |
|
public void mouseEntered(MouseEvent e) |
934 |
|
{ |
935 |
0 |
if (e.getSource() == slider) |
936 |
|
{ |
937 |
0 |
updateView(); |
938 |
|
} |
939 |
|
} |
940 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
941 |
0 |
@Override... |
942 |
|
public void mouseExited(MouseEvent e) |
943 |
|
{ |
944 |
0 |
if (e.getSource() == slider) |
945 |
|
{ |
946 |
0 |
updateView(); |
947 |
|
} |
948 |
|
} |
949 |
|
|
950 |
|
} |