1 Clazz.declarePackage ("jalview.appletgui");
2 Clazz.load (["awt2swing.Panel", "jalview.appletgui.AnnotationRowFilter", "$.TitledPanel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.TextField", "java.awt.BorderLayout", "$.CardLayout"], "jalview.appletgui.AnnotationColumnChooser", ["awt2swing.Frame", "jalview.bin.JalviewLite", "jalview.datamodel.ColumnSelection", "$.GraphLine", "jalview.util.MessageManager", "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", "java.awt.Color", "$.Dimension", "java.awt.event.MouseAdapter", "$.TextListener", "java.lang.Float", "java.util.Vector", "javax.swing.JPanel"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.annotations = null;
5 this.actionPanel = null;
6 this.thresholdPanel = null;
7 this.switchableViewsPanel = null;
8 this.switchableViewsLayout = null;
9 this.noGraphFilterView = null;
10 this.graphFilterView = null;
11 this.annotationComboBoxPanel = null;
12 this.borderLayout1 = null;
13 this.gBorderLayout = null;
14 this.ngBorderLayout = null;
15 this.threshold = null;
16 this.gStructureFilterPanel = null;
17 this.ngStructureFilterPanel = null;
18 this.currentStructureFilterPanel = null;
19 this.currentSearchPanel = null;
20 this.gSearchPanel = null;
21 this.ngSearchPanel = null;
22 this.currentFurtherActionPanel = null;
23 this.gFurtherActionPanel = null;
24 this.ngFurtherActionPanel = null;
25 this.actionOption = 1;
26 this.oldColumnSelection = null;
27 if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel")) {
28 jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$FurtherActionPanel$ ();
30 if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel")) {
31 jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$StructureFilterPanel$ ();
33 if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.SearchPanel")) {
34 jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$SearchPanel$ ();
36 Clazz.instantialize (this, arguments);
37 }, jalview.appletgui, "AnnotationColumnChooser", jalview.appletgui.AnnotationRowFilter, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
38 Clazz.prepareFields (c$, function () {
39 this.annotations = new awt2swing.Choice ();
40 this.actionPanel = new awt2swing.Panel ();
41 this.thresholdPanel = new jalview.appletgui.TitledPanel ();
42 this.switchableViewsPanel = new awt2swing.Panel ( new java.awt.CardLayout ());
43 this.switchableViewsLayout = (this.switchableViewsPanel.getLayout ());
44 this.noGraphFilterView = new awt2swing.Panel ();
45 this.graphFilterView = new awt2swing.Panel ();
46 this.annotationComboBoxPanel = new awt2swing.Panel ();
47 this.borderLayout1 = new java.awt.BorderLayout ();
48 this.gBorderLayout = new java.awt.BorderLayout ();
49 this.ngBorderLayout = new java.awt.BorderLayout ();
50 this.threshold = new awt2swing.Choice ();
52 Clazz.makeConstructor (c$,
54 Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser, []);
58 if (Clazz.exceptionOf (ex, Exception)) {
59 ex.printStackTrace ();
65 Clazz.makeConstructor (c$,
67 Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser, [av, ap]);
68 this.frame = new awt2swing.Frame ();
69 this.frame.add (this);
70 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.select_by_annotation"), 520, 215);
71 this.slider.addAdjustmentListener (this);
72 this.slider.addMouseListener (this);
73 if (av.getAlignment ().getAlignmentAnnotation () == null) {
75 }this.setOldColumnSelection (av.getColumnSelection ());
76 this.adjusting = true;
77 var list = new java.util.Vector ();
79 for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
80 var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
81 if (!list.contains (label)) {
82 list.addElement (label);
84 list.addElement (label + "_" + (index++));
86 for (var i = 0; i < list.size (); i++) {
87 this.annotations.addItem (list.elementAt (i).toString ());
89 this.populateThresholdComboBox (this.threshold);
90 if (av.getAnnotationColumnSelectionState () != null) {
91 this.currentSearchPanel = av.getAnnotationColumnSelectionState ().getCurrentSearchPanel ();
92 this.currentStructureFilterPanel = av.getAnnotationColumnSelectionState ().getCurrentStructureFilterPanel ();
93 this.annotations.select (new Integer (av.getAnnotationColumnSelectionState ().getAnnotations ().getSelectedIndex ()));
94 this.threshold.select (new Integer (av.getAnnotationColumnSelectionState ().getThreshold ().getSelectedIndex ()));
95 this.actionOption = av.getAnnotationColumnSelectionState ().getActionOption ();
99 if (Clazz.exceptionOf (ex, Exception)) {
104 this.adjusting = false;
106 this.frame.invalidate ();
108 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
109 Clazz.defineMethod (c$, "jbInit",
111 this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
112 this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
113 this.thresholdValue.setEnabled (false);
114 this.thresholdValue.setColumns (7);
115 this.ok.addActionListener (this);
116 this.cancel.addActionListener (this);
117 this.annotations.addItemListener (this);
118 this.thresholdValue.addActionListener (this);
119 this.threshold.addItemListener (this);
120 this.slider.setBackground (java.awt.Color.white);
121 this.slider.setEnabled (false);
122 this.slider.setPreferredSize ( new java.awt.Dimension (100, 32));
123 this.thresholdPanel.setBackground (java.awt.Color.white);
124 this.actionPanel.setBackground (java.awt.Color.white);
125 this.graphFilterView.setLayout (this.gBorderLayout);
126 this.graphFilterView.setBackground (java.awt.Color.white);
127 this.noGraphFilterView.setLayout (this.ngBorderLayout);
128 this.noGraphFilterView.setBackground (java.awt.Color.white);
129 this.annotationComboBoxPanel.setBackground (java.awt.Color.white);
130 this.gSearchPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
131 this.ngSearchPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
132 this.gFurtherActionPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
133 this.ngFurtherActionPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
134 this.gStructureFilterPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
135 this.ngStructureFilterPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
136 this.thresholdPanel.setTitle ("Threshold Filter");
137 this.thresholdPanel.add (this.getThreshold ());
138 this.thresholdPanel.add (this.slider);
139 this.thresholdPanel.add (this.thresholdValue);
140 this.actionPanel.add (this.ok);
141 this.actionPanel.add (this.cancel);
142 var staticPanel = new javax.swing.JPanel ();
143 staticPanel.setLayout ( new java.awt.BorderLayout ());
144 staticPanel.setBackground (java.awt.Color.white);
145 staticPanel.add (this.gSearchPanel, "North");
146 staticPanel.add (this.gStructureFilterPanel, "South");
147 this.graphFilterView.add (staticPanel, "North");
148 this.graphFilterView.add (this.thresholdPanel, "Center");
149 this.graphFilterView.add (this.gFurtherActionPanel, "South");
150 this.noGraphFilterView.add (this.ngSearchPanel, "First");
151 this.noGraphFilterView.add (this.ngStructureFilterPanel, "Center");
152 this.noGraphFilterView.add (this.ngFurtherActionPanel, "Center");
153 this.annotationComboBoxPanel.add (this.getAnnotations ());
154 this.switchableViewsPanel.add (this.noGraphFilterView, jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW);
155 this.switchableViewsPanel.add (this.graphFilterView, jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW);
156 this.setLayout (this.borderLayout1);
157 this.add (this.annotationComboBoxPanel, "First");
158 this.add (this.switchableViewsPanel, "Center");
159 this.add (this.actionPanel, "South");
160 this.selectedAnnotationChanged ();
162 }, $fz.isPrivate = true, $fz));
163 Clazz.overrideMethod (c$, "reset",
165 if (this.getOldColumnSelection () != null) {
166 this.av.getColumnSelection ().clear ();
167 if (this.av.getAnnotationColumnSelectionState () != null) {
168 var oldSelection = this.av.getAnnotationColumnSelectionState ().getOldColumnSelection ();
169 if (oldSelection != null && oldSelection.getHiddenColumns () != null && !oldSelection.getHiddenColumns ().isEmpty ()) {
170 for (var itr = oldSelection.getHiddenColumns ().iterator (); itr.hasNext (); ) {
171 var positions = itr.next ();
172 this.av.hideColumns (positions[0], positions[1]);
174 }this.av.setColumnSelection (oldSelection);
175 }this.ap.paintAlignment (true);
177 Clazz.overrideMethod (c$, "adjustmentValueChanged",
179 if (!this.adjusting) {
180 this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
181 this.valueChanged (!this.sliderDragging);
182 }}, "java.awt.event.AdjustmentEvent");
183 Clazz.defineMethod (c$, "addSliderMouseListeners",
185 this.slider.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$1, this, null)));
187 Clazz.overrideMethod (c$, "valueChanged",
188 function (updateAllAnnotation) {
189 if (this.slider.isEnabled ()) {
190 this.getCurrentAnnotation ().threshold.value = this.slider.getValue () / 1000;
192 this.ap.paintAlignment (false);
194 Clazz.defineMethod (c$, "getThreshold",
196 return this.threshold;
198 Clazz.defineMethod (c$, "setThreshold",
199 function (threshold) {
200 this.threshold = threshold;
201 }, "awt2swing.Choice");
202 Clazz.defineMethod (c$, "getAnnotations",
204 return this.annotations;
206 Clazz.defineMethod (c$, "setAnnotations",
207 function (annotations) {
208 this.annotations = annotations;
209 }, "awt2swing.Choice");
210 Clazz.overrideMethod (c$, "updateView",
212 if (this.adjusting) {
214 }var filterParams = new jalview.viewmodel.annotationfilter.AnnotationFilterParameter ();
215 this.setCurrentAnnotation (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()]);
216 var selectedThresholdItem = this.getSelectedThresholdItem (this.getThreshold ().getSelectedIndex ());
217 this.slider.setEnabled (true);
218 this.thresholdValue.setEnabled (true);
219 if (selectedThresholdItem == -1) {
220 this.slider.setEnabled (false);
221 this.thresholdValue.setEnabled (false);
222 this.thresholdValue.setText ("");
223 } else if (selectedThresholdItem != -1) {
224 if (this.getCurrentAnnotation ().threshold == null) {
225 this.getCurrentAnnotation ().setThreshold ( new jalview.datamodel.GraphLine ((this.getCurrentAnnotation ().graphMax - this.getCurrentAnnotation ().graphMin) / 2, "Threshold", java.awt.Color.black));
226 }this.adjusting = true;
227 var range = this.getCurrentAnnotation ().graphMax * 1000 - this.getCurrentAnnotation ().graphMin * 1000;
228 this.slider.setMinimum (Clazz.floatToInt (this.getCurrentAnnotation ().graphMin * 1000));
229 this.slider.setMaximum (Clazz.floatToInt (this.getCurrentAnnotation ().graphMax * 1000));
230 this.slider.setValue (Clazz.floatToInt (this.getCurrentAnnotation ().threshold.value * 1000));
231 this.thresholdValue.setText (this.getCurrentAnnotation ().threshold.value + "");
232 this.slider.setEnabled (true);
233 this.thresholdValue.setEnabled (true);
234 this.adjusting = false;
235 filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
236 if (this.getCurrentAnnotation ().graph != 0) {
237 filterParams.setThresholdValue (this.getCurrentAnnotation ().threshold.value);
238 if (selectedThresholdItem == 1) {
239 filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD);
240 } else if (selectedThresholdItem == 0) {
241 filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD);
242 }}}if (this.currentStructureFilterPanel != null) {
243 if (this.currentStructureFilterPanel.alphaHelix.getState ()) {
244 filterParams.setFilterAlphaHelix (true);
245 }if (this.currentStructureFilterPanel.betaStrand.getState ()) {
246 filterParams.setFilterBetaSheet (true);
247 }if (this.currentStructureFilterPanel.turn.getState ()) {
248 filterParams.setFilterTurn (true);
249 }}if (this.currentSearchPanel != null) {
250 if (!this.currentSearchPanel.searchBox.getText ().isEmpty ()) {
251 this.currentSearchPanel.description.setEnabled (true);
252 this.currentSearchPanel.displayName.setEnabled (true);
253 filterParams.setRegexString (this.currentSearchPanel.searchBox.getText ());
254 if (this.currentSearchPanel.displayName.getState ()) {
255 filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING);
256 }if (this.currentSearchPanel.description.getState ()) {
257 filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION);
259 this.currentSearchPanel.description.setEnabled (false);
260 this.currentSearchPanel.displayName.setEnabled (false);
261 }}this.av.getColumnSelection ().filterAnnotations (this.getCurrentAnnotation ().annotations, filterParams);
262 this.av.showAllHiddenColumns ();
263 if (this.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
264 this.av.hideSelectedColumns ();
265 }filterParams = null;
266 this.av.setAnnotationColumnSelectionState (this);
267 this.ap.paintAlignment (true);
269 Clazz.defineMethod (c$, "getOldColumnSelection",
271 return this.oldColumnSelection;
273 Clazz.defineMethod (c$, "setOldColumnSelection",
274 function (currentColumnSelection) {
275 if (currentColumnSelection != null) {
276 this.oldColumnSelection = new jalview.datamodel.ColumnSelection (currentColumnSelection);
277 }}, "jalview.datamodel.ColumnSelection");
278 Clazz.defineMethod (c$, "getCurrentFutherActionPanel",
280 return this.currentFurtherActionPanel;
282 Clazz.defineMethod (c$, "setCurrentFutherActionPanel",
283 function (currentFutherActionPanel) {
284 this.currentFurtherActionPanel = currentFutherActionPanel;
285 }, "jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel");
286 Clazz.defineMethod (c$, "getCurrentSearchPanel",
288 return this.currentSearchPanel;
290 Clazz.defineMethod (c$, "setCurrentSearchPanel",
291 function (currentSearchPanel) {
292 this.currentSearchPanel = currentSearchPanel;
293 }, "jalview.appletgui.AnnotationColumnChooser.SearchPanel");
294 Clazz.defineMethod (c$, "getActionOption",
296 return this.actionOption;
298 Clazz.defineMethod (c$, "setActionOption",
299 function (actionOption) {
300 this.actionOption = actionOption;
302 Clazz.defineMethod (c$, "getCurrentStructureFilterPanel",
304 return this.currentStructureFilterPanel;
306 Clazz.defineMethod (c$, "setCurrentStructureFilterPanel",
307 function (currentStructureFilterPanel) {
308 this.currentStructureFilterPanel = currentStructureFilterPanel;
309 }, "jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel");
310 Clazz.overrideMethod (c$, "itemStateChanged",
312 if (e.getSource () === this.annotations) {
313 this.selectedAnnotationChanged ();
314 } else if (e.getSource () === this.threshold) {
315 this.threshold_actionPerformed (null);
316 }}, "java.awt.event.ItemEvent");
317 Clazz.defineMethod (c$, "selectedAnnotationChanged",
319 var currentView = jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW;
320 if (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()].graph != 0) {
321 currentView = jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW;
322 }this.gSearchPanel.syncState ();
323 this.gFurtherActionPanel.syncState ();
324 this.gStructureFilterPanel.syncState ();
325 this.ngSearchPanel.syncState ();
326 this.ngFurtherActionPanel.syncState ();
327 this.ngStructureFilterPanel.syncState ();
328 this.switchableViewsLayout.show (this.switchableViewsPanel, currentView);
331 Clazz.overrideMethod (c$, "actionPerformed",
333 if (evt.getSource () === this.thresholdValue) {
335 var f = new Float (this.thresholdValue.getText ()).floatValue ();
336 this.slider.setValue (Clazz.floatToInt (f * 1000));
337 this.adjustmentValueChanged (null);
339 if (Clazz.exceptionOf (ex, NumberFormatException)) {
344 } else if (evt.getSource () === this.ok) {
345 this.ok_actionPerformed (null);
346 } else if (evt.getSource () === this.cancel) {
347 this.cancel_actionPerformed (null);
348 } else if (evt.getSource () === this.thresholdValue) {
349 this.thresholdValue_actionPerformed (null);
352 }}, "java.awt.event.ActionEvent");
353 Clazz.overrideMethod (c$, "mouseClicked",
355 }, "java.awt.event.MouseEvent");
356 Clazz.overrideMethod (c$, "mousePressed",
358 if (e.getSource () === this.slider) {
360 }}, "java.awt.event.MouseEvent");
361 Clazz.overrideMethod (c$, "mouseReleased",
363 if (e.getSource () === this.slider) {
365 }}, "java.awt.event.MouseEvent");
366 Clazz.overrideMethod (c$, "mouseEntered",
368 if (e.getSource () === this.slider) {
370 }}, "java.awt.event.MouseEvent");
371 Clazz.overrideMethod (c$, "mouseExited",
373 if (e.getSource () === this.slider) {
375 }}, "java.awt.event.MouseEvent");
376 c$.$AnnotationColumnChooser$FurtherActionPanel$ = function () {
378 c$ = Clazz.decorateAsClass (function () {
379 Clazz.prepareCallback (this, arguments);
380 this.aColChooser = null;
381 this.furtherAction = null;
382 Clazz.instantialize (this, arguments);
383 }, jalview.appletgui.AnnotationColumnChooser, "FurtherActionPanel", awt2swing.Panel, java.awt.event.ItemListener);
384 Clazz.prepareFields (c$, function () {
385 this.furtherAction = new awt2swing.Choice ();
387 Clazz.makeConstructor (c$,
389 Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, []);
390 this.aColChooser = a;
391 this.furtherAction.addItem ("Select");
392 this.furtherAction.addItem ("Hide");
393 this.furtherAction.addItemListener (this);
395 this.add (this.furtherAction);
396 }, "jalview.appletgui.AnnotationColumnChooser");
397 Clazz.defineMethod (c$, "syncState",
399 if (this.aColChooser.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
400 this.furtherAction.select ("Hide");
402 this.furtherAction.select ("Select");
404 Clazz.overrideMethod (c$, "itemStateChanged",
406 this.aColChooser.setCurrentFutherActionPanel (this);
407 if (this.furtherAction.getSelectedItem ().toString ().equalsIgnoreCase ("Select")) {
408 this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (1);
409 this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
411 this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE);
412 this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
413 }}, "java.awt.event.ItemEvent");
416 c$.$AnnotationColumnChooser$StructureFilterPanel$ = function () {
418 c$ = Clazz.decorateAsClass (function () {
419 Clazz.prepareCallback (this, arguments);
420 this.aColChooser = null;
421 this.alphaHelix = null;
422 this.betaStrand = null;
425 Clazz.instantialize (this, arguments);
426 }, jalview.appletgui.AnnotationColumnChooser, "StructureFilterPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
427 Clazz.prepareFields (c$, function () {
428 this.alphaHelix = new awt2swing.Checkbox ();
429 this.betaStrand = new awt2swing.Checkbox ();
430 this.turn = new awt2swing.Checkbox ();
431 this.all = new awt2swing.Checkbox ();
433 Clazz.makeConstructor (c$,
435 Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, []);
436 this.aColChooser = a;
437 this.alphaHelix.setLabel (jalview.util.MessageManager.getString ("label.alpha_helix"));
438 this.alphaHelix.setBackground (java.awt.Color.white);
439 this.alphaHelix.addItemListener (this);
440 this.betaStrand.setLabel (jalview.util.MessageManager.getString ("label.beta_strand"));
441 this.betaStrand.setBackground (java.awt.Color.white);
442 this.betaStrand.addItemListener (this);
443 this.turn.setLabel (jalview.util.MessageManager.getString ("label.turn"));
444 this.turn.setBackground (java.awt.Color.white);
445 this.turn.addItemListener (this);
446 this.all.setLabel (jalview.util.MessageManager.getString ("label.select_all"));
447 this.all.setBackground (java.awt.Color.white);
448 this.all.addItemListener (this);
449 this.setBackground (java.awt.Color.white);
450 this.setTitle ("Structure Filter");
452 this.add (this.alphaHelix);
453 this.add (this.betaStrand);
454 this.add (this.turn);
455 }, "jalview.appletgui.AnnotationColumnChooser");
456 Clazz.defineMethod (c$, "alphaHelix_actionPerformed",
458 this.updateSelectAllState ();
459 this.aColChooser.setCurrentStructureFilterPanel (this);
460 this.aColChooser.updateView ();
462 Clazz.defineMethod (c$, "betaStrand_actionPerformed",
464 this.updateSelectAllState ();
465 this.aColChooser.setCurrentStructureFilterPanel (this);
466 this.aColChooser.updateView ();
468 Clazz.defineMethod (c$, "turn_actionPerformed",
470 this.updateSelectAllState ();
471 this.aColChooser.setCurrentStructureFilterPanel (this);
472 this.aColChooser.updateView ();
474 Clazz.defineMethod (c$, "all_actionPerformed",
476 if (this.all.getState ()) {
477 this.alphaHelix.setState (true);
478 this.betaStrand.setState (true);
479 this.turn.setState (true);
481 this.alphaHelix.setState (false);
482 this.betaStrand.setState (false);
483 this.turn.setState (false);
484 }this.aColChooser.setCurrentStructureFilterPanel (this);
485 this.aColChooser.updateView ();
487 Clazz.defineMethod (c$, "updateSelectAllState",
489 if (this.alphaHelix.getState () && this.betaStrand.getState () && this.turn.getState ()) {
490 this.all.setState (true);
492 this.all.setState (false);
494 Clazz.defineMethod (c$, "syncState",
496 var a = this.aColChooser.getCurrentStructureFilterPanel ();
498 this.alphaHelix.setState (a.alphaHelix.getState ());
499 this.betaStrand.setState (a.betaStrand.getState ());
500 this.turn.setState (a.turn.getState ());
501 if (a.all.getState ()) {
502 this.all.setState (true);
503 this.alphaHelix.setState (true);
504 this.betaStrand.setState (true);
505 this.turn.setState (true);
507 Clazz.overrideMethod (c$, "itemStateChanged",
509 if (a.getSource () === this.alphaHelix) {
510 this.alphaHelix_actionPerformed ();
511 } else if (a.getSource () === this.betaStrand) {
512 this.betaStrand_actionPerformed ();
513 } else if (a.getSource () === this.turn) {
514 this.turn_actionPerformed ();
515 } else if (a.getSource () === this.all) {
516 this.all_actionPerformed ();
517 }}, "java.awt.event.ItemEvent");
520 c$.$AnnotationColumnChooser$SearchPanel$ = function () {
522 c$ = Clazz.decorateAsClass (function () {
523 Clazz.prepareCallback (this, arguments);
524 this.aColChooser = null;
525 this.displayName = null;
526 this.description = null;
527 this.searchBox = null;
528 Clazz.instantialize (this, arguments);
529 }, jalview.appletgui.AnnotationColumnChooser, "SearchPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
530 Clazz.prepareFields (c$, function () {
531 this.displayName = new awt2swing.Checkbox ();
532 this.description = new awt2swing.Checkbox ();
533 this.searchBox = new awt2swing.TextField (10);
535 Clazz.makeConstructor (c$,
537 Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.SearchPanel, []);
538 this.aColChooser = a;
539 this.searchBox.addTextListener (((Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser$SearchPanel$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.SearchPanel.$AnnotationColumnChooser$SearchPanel$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$SearchPanel$1, this, null)));
540 this.displayName.setLabel (jalview.util.MessageManager.getString ("label.display_name"));
541 this.displayName.setEnabled (false);
542 this.displayName.addItemListener (this);
543 this.description.setLabel (jalview.util.MessageManager.getString ("label.description"));
544 this.description.setEnabled (false);
545 this.description.addItemListener (this);
546 this.setTitle ("Search Filter");
548 this.add (this.searchBox);
549 this.add (this.displayName);
550 this.add (this.description);
551 }, "jalview.appletgui.AnnotationColumnChooser");
552 Clazz.defineMethod (c$, "displayNameCheckboxAction",
554 this.aColChooser.setCurrentSearchPanel (this);
555 this.aColChooser.updateView ();
557 Clazz.defineMethod (c$, "discriptionCheckboxAction",
559 this.aColChooser.setCurrentSearchPanel (this);
560 this.aColChooser.updateView ();
562 Clazz.defineMethod (c$, "searchStringAction",
564 this.aColChooser.setCurrentSearchPanel (this);
565 this.aColChooser.updateView ();
567 Clazz.defineMethod (c$, "syncState",
569 var a = this.aColChooser.getCurrentSearchPanel ();
571 this.description.setEnabled (a.description.isEnabled ());
572 this.description.setState (a.description.getState ());
573 this.displayName.setEnabled (a.displayName.isEnabled ());
574 this.displayName.setState (a.displayName.getState ());
575 this.searchBox.setText (a.searchBox.getText ());
577 Clazz.overrideMethod (c$, "itemStateChanged",
579 if (a.getSource () === this.displayName) {
580 this.displayNameCheckboxAction ();
581 } else if (a.getSource () === this.description) {
582 this.discriptionCheckboxAction ();
583 }}, "java.awt.event.ItemEvent");
584 c$.$AnnotationColumnChooser$SearchPanel$1$ = function () {
586 c$ = Clazz.declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$SearchPanel$1", null, java.awt.event.TextListener);
587 Clazz.overrideMethod (c$, "textValueChanged",
589 this.b$["jalview.appletgui.AnnotationColumnChooser.SearchPanel"].searchStringAction ();
590 }, "java.awt.event.TextEvent");
595 c$.$AnnotationColumnChooser$1$ = function () {
597 c$ = Clazz.declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$1", java.awt.event.MouseAdapter);
598 Clazz.defineMethod (c$, "mousePressed",
600 this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
601 Clazz.superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mousePressed", [e]);
602 }, "java.awt.event.MouseEvent");
603 Clazz.defineMethod (c$, "mouseDragged",
605 this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
606 Clazz.superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mouseDragged", [e]);
607 }, "java.awt.event.MouseEvent");
608 Clazz.overrideMethod (c$, "mouseReleased",
610 if (this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging) {
611 this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = false;
612 this.b$["jalview.appletgui.AnnotationColumnChooser"].valueChanged (true);
613 }this.b$["jalview.appletgui.AnnotationColumnChooser"].ap.paintAlignment (true);
614 }, "java.awt.event.MouseEvent");
617 Clazz.defineStatics (c$,
618 "ACTION_OPTION_SELECT", 1,
619 "ACTION_OPTION_HIDE", 2,
620 "NO_GRAPH_VIEW", "0",