Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / appletgui / AnnotationColumnChooser.js
index 44e2386..8c0126c 100644 (file)
-Clazz.declarePackage ("jalview.appletgui");\r
-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 () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.annotations = null;\r
-this.actionPanel = null;\r
-this.thresholdPanel = null;\r
-this.switchableViewsPanel = null;\r
-this.switchableViewsLayout = null;\r
-this.noGraphFilterView = null;\r
-this.graphFilterView = null;\r
-this.annotationComboBoxPanel = null;\r
-this.borderLayout1 = null;\r
-this.gBorderLayout = null;\r
-this.ngBorderLayout = null;\r
-this.threshold = null;\r
-this.gStructureFilterPanel = null;\r
-this.ngStructureFilterPanel = null;\r
-this.currentStructureFilterPanel = null;\r
-this.currentSearchPanel = null;\r
-this.gSearchPanel = null;\r
-this.ngSearchPanel = null;\r
-this.currentFurtherActionPanel = null;\r
-this.gFurtherActionPanel = null;\r
-this.ngFurtherActionPanel = null;\r
-this.actionOption = 1;\r
-this.oldColumnSelection = null;\r
-if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel")) {\r
-jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$FurtherActionPanel$ ();\r
-}\r
-if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel")) {\r
-jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$StructureFilterPanel$ ();\r
-}\r
-if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.SearchPanel")) {\r
-jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$SearchPanel$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.appletgui, "AnnotationColumnChooser", jalview.appletgui.AnnotationRowFilter, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);\r
-Clazz.prepareFields (c$, function () {\r
-this.annotations =  new awt2swing.Choice ();\r
-this.actionPanel =  new awt2swing.Panel ();\r
-this.thresholdPanel =  new jalview.appletgui.TitledPanel ();\r
-this.switchableViewsPanel =  new awt2swing.Panel ( new java.awt.CardLayout ());\r
-this.switchableViewsLayout = (this.switchableViewsPanel.getLayout ());\r
-this.noGraphFilterView =  new awt2swing.Panel ();\r
-this.graphFilterView =  new awt2swing.Panel ();\r
-this.annotationComboBoxPanel =  new awt2swing.Panel ();\r
-this.borderLayout1 =  new java.awt.BorderLayout ();\r
-this.gBorderLayout =  new java.awt.BorderLayout ();\r
-this.ngBorderLayout =  new java.awt.BorderLayout ();\r
-this.threshold =  new awt2swing.Choice ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser, []);\r
-try {\r
-this.jbInit ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, Exception)) {\r
-ex.printStackTrace ();\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (av, ap) {\r
-Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser, [av, ap]);\r
-this.frame =  new awt2swing.Frame ();\r
-this.frame.add (this);\r
-jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.select_by_annotation"), 520, 215);\r
-this.slider.addAdjustmentListener (this);\r
-this.slider.addMouseListener (this);\r
-if (av.getAlignment ().getAlignmentAnnotation () == null) {\r
-return;\r
-}this.setOldColumnSelection (av.getColumnSelection ());\r
-this.adjusting = true;\r
-var list =  new java.util.Vector ();\r
-var index = 1;\r
-for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {\r
-var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;\r
-if (!list.contains (label)) {\r
-list.addElement (label);\r
-} else {\r
-list.addElement (label + "_" + (index++));\r
-}}\r
-for (var i = 0; i < list.size (); i++) {\r
-this.annotations.addItem (list.elementAt (i).toString ());\r
-}\r
-this.populateThresholdComboBox (this.threshold);\r
-if (av.getAnnotationColumnSelectionState () != null) {\r
-this.currentSearchPanel = av.getAnnotationColumnSelectionState ().getCurrentSearchPanel ();\r
-this.currentStructureFilterPanel = av.getAnnotationColumnSelectionState ().getCurrentStructureFilterPanel ();\r
-this.annotations.select (new Integer (av.getAnnotationColumnSelectionState ().getAnnotations ().getSelectedIndex ()));\r
-this.threshold.select (new Integer (av.getAnnotationColumnSelectionState ().getThreshold ().getSelectedIndex ()));\r
-this.actionOption = av.getAnnotationColumnSelectionState ().getActionOption ();\r
-}try {\r
-this.jbInit ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, Exception)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-this.adjusting = false;\r
-this.updateView ();\r
-this.frame.invalidate ();\r
-this.frame.pack ();\r
-}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");\r
-Clazz.defineMethod (c$, "jbInit", \r
- function () {\r
-this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));\r
-this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));\r
-this.thresholdValue.setEnabled (false);\r
-this.thresholdValue.setColumns (7);\r
-this.ok.addActionListener (this);\r
-this.cancel.addActionListener (this);\r
-this.annotations.addItemListener (this);\r
-this.thresholdValue.addActionListener (this);\r
-this.threshold.addItemListener (this);\r
-this.slider.setBackground (java.awt.Color.white);\r
-this.slider.setEnabled (false);\r
-this.slider.setPreferredSize ( new java.awt.Dimension (100, 32));\r
-this.thresholdPanel.setBackground (java.awt.Color.white);\r
-this.actionPanel.setBackground (java.awt.Color.white);\r
-this.graphFilterView.setLayout (this.gBorderLayout);\r
-this.graphFilterView.setBackground (java.awt.Color.white);\r
-this.noGraphFilterView.setLayout (this.ngBorderLayout);\r
-this.noGraphFilterView.setBackground (java.awt.Color.white);\r
-this.annotationComboBoxPanel.setBackground (java.awt.Color.white);\r
-this.gSearchPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);\r
-this.ngSearchPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);\r
-this.gFurtherActionPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);\r
-this.ngFurtherActionPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);\r
-this.gStructureFilterPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);\r
-this.ngStructureFilterPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);\r
-this.thresholdPanel.setTitle ("Threshold Filter");\r
-this.thresholdPanel.add (this.getThreshold ());\r
-this.thresholdPanel.add (this.slider);\r
-this.thresholdPanel.add (this.thresholdValue);\r
-this.actionPanel.add (this.ok);\r
-this.actionPanel.add (this.cancel);\r
-var staticPanel =  new javax.swing.JPanel ();\r
-staticPanel.setLayout ( new java.awt.BorderLayout ());\r
-staticPanel.setBackground (java.awt.Color.white);\r
-staticPanel.add (this.gSearchPanel, "North");\r
-staticPanel.add (this.gStructureFilterPanel, "South");\r
-this.graphFilterView.add (staticPanel, "North");\r
-this.graphFilterView.add (this.thresholdPanel, "Center");\r
-this.graphFilterView.add (this.gFurtherActionPanel, "South");\r
-this.noGraphFilterView.add (this.ngSearchPanel, "First");\r
-this.noGraphFilterView.add (this.ngStructureFilterPanel, "Center");\r
-this.noGraphFilterView.add (this.ngFurtherActionPanel, "Center");\r
-this.annotationComboBoxPanel.add (this.getAnnotations ());\r
-this.switchableViewsPanel.add (this.noGraphFilterView, jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW);\r
-this.switchableViewsPanel.add (this.graphFilterView, jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW);\r
-this.setLayout (this.borderLayout1);\r
-this.add (this.annotationComboBoxPanel, "First");\r
-this.add (this.switchableViewsPanel, "Center");\r
-this.add (this.actionPanel, "South");\r
-this.selectedAnnotationChanged ();\r
-this.validate ();\r
-});\r
-Clazz.overrideMethod (c$, "reset", \r
-function () {\r
-if (this.getOldColumnSelection () != null) {\r
-this.av.getColumnSelection ().clear ();\r
-if (this.av.getAnnotationColumnSelectionState () != null) {\r
-var oldSelection = this.av.getAnnotationColumnSelectionState ().getOldColumnSelection ();\r
-if (oldSelection != null && oldSelection.getHiddenColumns () != null && !oldSelection.getHiddenColumns ().isEmpty ()) {\r
-for (var itr = oldSelection.getHiddenColumns ().iterator (); itr.hasNext (); ) {\r
-var positions = itr.next ();\r
-this.av.hideColumns (positions[0], positions[1]);\r
-}\r
-}this.av.setColumnSelection (oldSelection);\r
-}this.ap.paintAlignment (true);\r
-}});\r
-Clazz.overrideMethod (c$, "adjustmentValueChanged", \r
-function (evt) {\r
-if (!this.adjusting) {\r
-this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");\r
-this.valueChanged (!this.sliderDragging);\r
-}}, "java.awt.event.AdjustmentEvent");\r
-Clazz.defineMethod (c$, "addSliderMouseListeners", \r
-function () {\r
-this.slider.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$1, this, null)));\r
-});\r
-Clazz.overrideMethod (c$, "valueChanged", \r
-function (updateAllAnnotation) {\r
-if (this.slider.isEnabled ()) {\r
-this.getCurrentAnnotation ().threshold.value = this.slider.getValue () / 1000;\r
-this.updateView ();\r
-this.ap.paintAlignment (false);\r
-}}, "~B");\r
-Clazz.defineMethod (c$, "getThreshold", \r
-function () {\r
-return this.threshold;\r
-});\r
-Clazz.defineMethod (c$, "setThreshold", \r
-function (threshold) {\r
-this.threshold = threshold;\r
-}, "awt2swing.Choice");\r
-Clazz.defineMethod (c$, "getAnnotations", \r
-function () {\r
-return this.annotations;\r
-});\r
-Clazz.defineMethod (c$, "setAnnotations", \r
-function (annotations) {\r
-this.annotations = annotations;\r
-}, "awt2swing.Choice");\r
-Clazz.overrideMethod (c$, "updateView", \r
-function () {\r
-if (this.adjusting) {\r
-return;\r
-}var filterParams =  new jalview.viewmodel.annotationfilter.AnnotationFilterParameter ();\r
-this.setCurrentAnnotation (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()]);\r
-var selectedThresholdItem = this.getSelectedThresholdItem (this.getThreshold ().getSelectedIndex ());\r
-this.slider.setEnabled (true);\r
-this.thresholdValue.setEnabled (true);\r
-if (selectedThresholdItem == -1) {\r
-this.slider.setEnabled (false);\r
-this.thresholdValue.setEnabled (false);\r
-this.thresholdValue.setText ("");\r
-} else if (selectedThresholdItem != -1) {\r
-if (this.getCurrentAnnotation ().threshold == null) {\r
-this.getCurrentAnnotation ().setThreshold ( new jalview.datamodel.GraphLine ((this.getCurrentAnnotation ().graphMax - this.getCurrentAnnotation ().graphMin) / 2, "Threshold", java.awt.Color.black));\r
-}this.adjusting = true;\r
-var range = this.getCurrentAnnotation ().graphMax * 1000 - this.getCurrentAnnotation ().graphMin * 1000;\r
-this.slider.setMinimum (Clazz.floatToInt (this.getCurrentAnnotation ().graphMin * 1000));\r
-this.slider.setMaximum (Clazz.floatToInt (this.getCurrentAnnotation ().graphMax * 1000));\r
-this.slider.setValue (Clazz.floatToInt (this.getCurrentAnnotation ().threshold.value * 1000));\r
-this.thresholdValue.setText (this.getCurrentAnnotation ().threshold.value + "");\r
-this.slider.setEnabled (true);\r
-this.thresholdValue.setEnabled (true);\r
-this.adjusting = false;\r
-filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);\r
-if (this.getCurrentAnnotation ().graph != 0) {\r
-filterParams.setThresholdValue (this.getCurrentAnnotation ().threshold.value);\r
-if (selectedThresholdItem == 1) {\r
-filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD);\r
-} else if (selectedThresholdItem == 0) {\r
-filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD);\r
-}}}if (this.currentStructureFilterPanel != null) {\r
-if (this.currentStructureFilterPanel.alphaHelix.getState ()) {\r
-filterParams.setFilterAlphaHelix (true);\r
-}if (this.currentStructureFilterPanel.betaStrand.getState ()) {\r
-filterParams.setFilterBetaSheet (true);\r
-}if (this.currentStructureFilterPanel.turn.getState ()) {\r
-filterParams.setFilterTurn (true);\r
-}}if (this.currentSearchPanel != null) {\r
-if (!this.currentSearchPanel.searchBox.getText ().isEmpty ()) {\r
-this.currentSearchPanel.description.setEnabled (true);\r
-this.currentSearchPanel.displayName.setEnabled (true);\r
-filterParams.setRegexString (this.currentSearchPanel.searchBox.getText ());\r
-if (this.currentSearchPanel.displayName.getState ()) {\r
-filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING);\r
-}if (this.currentSearchPanel.description.getState ()) {\r
-filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION);\r
-}} else {\r
-this.currentSearchPanel.description.setEnabled (false);\r
-this.currentSearchPanel.displayName.setEnabled (false);\r
-}}this.av.getColumnSelection ().filterAnnotations (this.getCurrentAnnotation ().annotations, filterParams);\r
-this.av.showAllHiddenColumns ();\r
-if (this.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {\r
-this.av.hideSelectedColumns ();\r
-}filterParams = null;\r
-this.av.setAnnotationColumnSelectionState (this);\r
-this.ap.paintAlignment (true);\r
-});\r
-Clazz.defineMethod (c$, "getOldColumnSelection", \r
-function () {\r
-return this.oldColumnSelection;\r
-});\r
-Clazz.defineMethod (c$, "setOldColumnSelection", \r
-function (currentColumnSelection) {\r
-if (currentColumnSelection != null) {\r
-this.oldColumnSelection =  new jalview.datamodel.ColumnSelection (currentColumnSelection);\r
-}}, "jalview.datamodel.ColumnSelection");\r
-Clazz.defineMethod (c$, "getCurrentFutherActionPanel", \r
-function () {\r
-return this.currentFurtherActionPanel;\r
-});\r
-Clazz.defineMethod (c$, "setCurrentFutherActionPanel", \r
-function (currentFutherActionPanel) {\r
-this.currentFurtherActionPanel = currentFutherActionPanel;\r
-}, "jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel");\r
-Clazz.defineMethod (c$, "getCurrentSearchPanel", \r
-function () {\r
-return this.currentSearchPanel;\r
-});\r
-Clazz.defineMethod (c$, "setCurrentSearchPanel", \r
-function (currentSearchPanel) {\r
-this.currentSearchPanel = currentSearchPanel;\r
-}, "jalview.appletgui.AnnotationColumnChooser.SearchPanel");\r
-Clazz.defineMethod (c$, "getActionOption", \r
-function () {\r
-return this.actionOption;\r
-});\r
-Clazz.defineMethod (c$, "setActionOption", \r
-function (actionOption) {\r
-this.actionOption = actionOption;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getCurrentStructureFilterPanel", \r
-function () {\r
-return this.currentStructureFilterPanel;\r
-});\r
-Clazz.defineMethod (c$, "setCurrentStructureFilterPanel", \r
-function (currentStructureFilterPanel) {\r
-this.currentStructureFilterPanel = currentStructureFilterPanel;\r
-}, "jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel");\r
-Clazz.overrideMethod (c$, "itemStateChanged", \r
-function (e) {\r
-if (e.getSource () === this.annotations) {\r
-this.selectedAnnotationChanged ();\r
-} else if (e.getSource () === this.threshold) {\r
-this.threshold_actionPerformed (null);\r
-}}, "java.awt.event.ItemEvent");\r
-Clazz.defineMethod (c$, "selectedAnnotationChanged", \r
-function () {\r
-var currentView = jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW;\r
-if (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()].graph != 0) {\r
-currentView = jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW;\r
-}this.gSearchPanel.syncState ();\r
-this.gFurtherActionPanel.syncState ();\r
-this.gStructureFilterPanel.syncState ();\r
-this.ngSearchPanel.syncState ();\r
-this.ngFurtherActionPanel.syncState ();\r
-this.ngStructureFilterPanel.syncState ();\r
-this.switchableViewsLayout.show (this.switchableViewsPanel, currentView);\r
-this.updateView ();\r
-});\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (evt) {\r
-if (evt.getSource () === this.thresholdValue) {\r
-try {\r
-var f =  new Float (this.thresholdValue.getText ()).floatValue ();\r
-this.slider.setValue (Clazz.floatToInt (f * 1000));\r
-this.adjustmentValueChanged (null);\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, NumberFormatException)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-} else if (evt.getSource () === this.ok) {\r
-this.ok_actionPerformed (null);\r
-} else if (evt.getSource () === this.cancel) {\r
-this.cancel_actionPerformed (null);\r
-} else if (evt.getSource () === this.thresholdValue) {\r
-this.thresholdValue_actionPerformed (null);\r
-} else {\r
-this.updateView ();\r
-}}, "java.awt.event.ActionEvent");\r
-Clazz.overrideMethod (c$, "mouseClicked", \r
-function (e) {\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mousePressed", \r
-function (e) {\r
-if (e.getSource () === this.slider) {\r
-this.updateView ();\r
-}}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseReleased", \r
-function (e) {\r
-if (e.getSource () === this.slider) {\r
-this.updateView ();\r
-}}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseEntered", \r
-function (e) {\r
-if (e.getSource () === this.slider) {\r
-this.updateView ();\r
-}}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseExited", \r
-function (e) {\r
-if (e.getSource () === this.slider) {\r
-this.updateView ();\r
-}}, "java.awt.event.MouseEvent");\r
-c$.$AnnotationColumnChooser$FurtherActionPanel$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.aColChooser = null;\r
-this.furtherAction = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.appletgui.AnnotationColumnChooser, "FurtherActionPanel", awt2swing.Panel, java.awt.event.ItemListener);\r
-Clazz.prepareFields (c$, function () {\r
-this.furtherAction =  new awt2swing.Choice ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (a) {\r
-Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, []);\r
-this.aColChooser = a;\r
-this.furtherAction.addItem ("Select");\r
-this.furtherAction.addItem ("Hide");\r
-this.furtherAction.addItemListener (this);\r
-this.syncState ();\r
-this.add (this.furtherAction);\r
-}, "jalview.appletgui.AnnotationColumnChooser");\r
-Clazz.defineMethod (c$, "syncState", \r
-function () {\r
-if (this.aColChooser.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {\r
-this.furtherAction.select ("Hide");\r
-} else {\r
-this.furtherAction.select ("Select");\r
-}});\r
-Clazz.overrideMethod (c$, "itemStateChanged", \r
-function (a) {\r
-this.aColChooser.setCurrentFutherActionPanel (this);\r
-if (this.furtherAction.getSelectedItem ().toString ().equalsIgnoreCase ("Select")) {\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (1);\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();\r
-} else {\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE);\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();\r
-}}, "java.awt.event.ItemEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$AnnotationColumnChooser$StructureFilterPanel$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.aColChooser = null;\r
-this.alphaHelix = null;\r
-this.betaStrand = null;\r
-this.turn = null;\r
-this.all = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.appletgui.AnnotationColumnChooser, "StructureFilterPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);\r
-Clazz.prepareFields (c$, function () {\r
-this.alphaHelix =  new awt2swing.Checkbox ();\r
-this.betaStrand =  new awt2swing.Checkbox ();\r
-this.turn =  new awt2swing.Checkbox ();\r
-this.all =  new awt2swing.Checkbox ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (a) {\r
-Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, []);\r
-this.aColChooser = a;\r
-this.alphaHelix.setLabel (jalview.util.MessageManager.getString ("label.alpha_helix"));\r
-this.alphaHelix.setBackground (java.awt.Color.white);\r
-this.alphaHelix.addItemListener (this);\r
-this.betaStrand.setLabel (jalview.util.MessageManager.getString ("label.beta_strand"));\r
-this.betaStrand.setBackground (java.awt.Color.white);\r
-this.betaStrand.addItemListener (this);\r
-this.turn.setLabel (jalview.util.MessageManager.getString ("label.turn"));\r
-this.turn.setBackground (java.awt.Color.white);\r
-this.turn.addItemListener (this);\r
-this.all.setLabel (jalview.util.MessageManager.getString ("label.select_all"));\r
-this.all.setBackground (java.awt.Color.white);\r
-this.all.addItemListener (this);\r
-this.setBackground (java.awt.Color.white);\r
-this.setTitle ("Structure Filter");\r
-this.add (this.all);\r
-this.add (this.alphaHelix);\r
-this.add (this.betaStrand);\r
-this.add (this.turn);\r
-}, "jalview.appletgui.AnnotationColumnChooser");\r
-Clazz.defineMethod (c$, "alphaHelix_actionPerformed", \r
-function () {\r
-this.updateSelectAllState ();\r
-this.aColChooser.setCurrentStructureFilterPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "betaStrand_actionPerformed", \r
-function () {\r
-this.updateSelectAllState ();\r
-this.aColChooser.setCurrentStructureFilterPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "turn_actionPerformed", \r
-function () {\r
-this.updateSelectAllState ();\r
-this.aColChooser.setCurrentStructureFilterPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "all_actionPerformed", \r
-function () {\r
-if (this.all.getState ()) {\r
-this.alphaHelix.setState (true);\r
-this.betaStrand.setState (true);\r
-this.turn.setState (true);\r
-} else {\r
-this.alphaHelix.setState (false);\r
-this.betaStrand.setState (false);\r
-this.turn.setState (false);\r
-}this.aColChooser.setCurrentStructureFilterPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "updateSelectAllState", \r
-function () {\r
-if (this.alphaHelix.getState () && this.betaStrand.getState () && this.turn.getState ()) {\r
-this.all.setState (true);\r
-} else {\r
-this.all.setState (false);\r
-}});\r
-Clazz.defineMethod (c$, "syncState", \r
-function () {\r
-var a = this.aColChooser.getCurrentStructureFilterPanel ();\r
-if (a != null) {\r
-this.alphaHelix.setState (a.alphaHelix.getState ());\r
-this.betaStrand.setState (a.betaStrand.getState ());\r
-this.turn.setState (a.turn.getState ());\r
-if (a.all.getState ()) {\r
-this.all.setState (true);\r
-this.alphaHelix.setState (true);\r
-this.betaStrand.setState (true);\r
-this.turn.setState (true);\r
-}}});\r
-Clazz.overrideMethod (c$, "itemStateChanged", \r
-function (a) {\r
-if (a.getSource () === this.alphaHelix) {\r
-this.alphaHelix_actionPerformed ();\r
-} else if (a.getSource () === this.betaStrand) {\r
-this.betaStrand_actionPerformed ();\r
-} else if (a.getSource () === this.turn) {\r
-this.turn_actionPerformed ();\r
-} else if (a.getSource () === this.all) {\r
-this.all_actionPerformed ();\r
-}}, "java.awt.event.ItemEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$AnnotationColumnChooser$SearchPanel$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.aColChooser = null;\r
-this.displayName = null;\r
-this.description = null;\r
-this.searchBox = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.appletgui.AnnotationColumnChooser, "SearchPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);\r
-Clazz.prepareFields (c$, function () {\r
-this.displayName =  new awt2swing.Checkbox ();\r
-this.description =  new awt2swing.Checkbox ();\r
-this.searchBox =  new awt2swing.TextField (10);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (a) {\r
-Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.SearchPanel, []);\r
-this.aColChooser = a;\r
-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)));\r
-this.displayName.setLabel (jalview.util.MessageManager.getString ("label.display_name"));\r
-this.displayName.setEnabled (false);\r
-this.displayName.addItemListener (this);\r
-this.description.setLabel (jalview.util.MessageManager.getString ("label.description"));\r
-this.description.setEnabled (false);\r
-this.description.addItemListener (this);\r
-this.setTitle ("Search Filter");\r
-this.syncState ();\r
-this.add (this.searchBox);\r
-this.add (this.displayName);\r
-this.add (this.description);\r
-}, "jalview.appletgui.AnnotationColumnChooser");\r
-Clazz.defineMethod (c$, "displayNameCheckboxAction", \r
-function () {\r
-this.aColChooser.setCurrentSearchPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "discriptionCheckboxAction", \r
-function () {\r
-this.aColChooser.setCurrentSearchPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "searchStringAction", \r
-function () {\r
-this.aColChooser.setCurrentSearchPanel (this);\r
-this.aColChooser.updateView ();\r
-});\r
-Clazz.defineMethod (c$, "syncState", \r
-function () {\r
-var a = this.aColChooser.getCurrentSearchPanel ();\r
-if (a != null) {\r
-this.description.setEnabled (a.description.isEnabled ());\r
-this.description.setState (a.description.getState ());\r
-this.displayName.setEnabled (a.displayName.isEnabled ());\r
-this.displayName.setState (a.displayName.getState ());\r
-this.searchBox.setText (a.searchBox.getText ());\r
-}});\r
-Clazz.overrideMethod (c$, "itemStateChanged", \r
-function (a) {\r
-if (a.getSource () === this.displayName) {\r
-this.displayNameCheckboxAction ();\r
-} else if (a.getSource () === this.description) {\r
-this.discriptionCheckboxAction ();\r
-}}, "java.awt.event.ItemEvent");\r
-c$.$AnnotationColumnChooser$SearchPanel$1$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$SearchPanel$1", null, java.awt.event.TextListener);\r
-Clazz.overrideMethod (c$, "textValueChanged", \r
-function (a) {\r
-this.b$["jalview.appletgui.AnnotationColumnChooser.SearchPanel"].searchStringAction ();\r
-}, "java.awt.event.TextEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$AnnotationColumnChooser$1$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$1", java.awt.event.MouseAdapter);\r
-Clazz.defineMethod (c$, "mousePressed", \r
-function (e) {\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;\r
-Clazz.superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mousePressed", [e]);\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.defineMethod (c$, "mouseDragged", \r
-function (e) {\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;\r
-Clazz.superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mouseDragged", [e]);\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseReleased", \r
-function (evt) {\r
-if (this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging) {\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = false;\r
-this.b$["jalview.appletgui.AnnotationColumnChooser"].valueChanged (true);\r
-}this.b$["jalview.appletgui.AnnotationColumnChooser"].ap.paintAlignment (true);\r
-}, "java.awt.event.MouseEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.defineStatics (c$,\r
-"ACTION_OPTION_SELECT", 1,\r
-"ACTION_OPTION_HIDE", 2,\r
-"NO_GRAPH_VIEW", "0",\r
-"GRAPH_VIEW", "1");\r
-});\r
+Clazz.declarePackage ("jalview.appletgui");
+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 () {
+c$ = Clazz.decorateAsClass (function () {
+this.annotations = null;
+this.actionPanel = null;
+this.thresholdPanel = null;
+this.switchableViewsPanel = null;
+this.switchableViewsLayout = null;
+this.noGraphFilterView = null;
+this.graphFilterView = null;
+this.annotationComboBoxPanel = null;
+this.borderLayout1 = null;
+this.gBorderLayout = null;
+this.ngBorderLayout = null;
+this.threshold = null;
+this.gStructureFilterPanel = null;
+this.ngStructureFilterPanel = null;
+this.currentStructureFilterPanel = null;
+this.currentSearchPanel = null;
+this.gSearchPanel = null;
+this.ngSearchPanel = null;
+this.currentFurtherActionPanel = null;
+this.gFurtherActionPanel = null;
+this.ngFurtherActionPanel = null;
+this.actionOption = 1;
+this.oldColumnSelection = null;
+if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel")) {
+jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$FurtherActionPanel$ ();
+}
+if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel")) {
+jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$StructureFilterPanel$ ();
+}
+if (!Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser.SearchPanel")) {
+jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$SearchPanel$ ();
+}
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui, "AnnotationColumnChooser", jalview.appletgui.AnnotationRowFilter, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
+Clazz.prepareFields (c$, function () {
+this.annotations =  new awt2swing.Choice ();
+this.actionPanel =  new awt2swing.Panel ();
+this.thresholdPanel =  new jalview.appletgui.TitledPanel ();
+this.switchableViewsPanel =  new awt2swing.Panel ( new java.awt.CardLayout ());
+this.switchableViewsLayout = (this.switchableViewsPanel.getLayout ());
+this.noGraphFilterView =  new awt2swing.Panel ();
+this.graphFilterView =  new awt2swing.Panel ();
+this.annotationComboBoxPanel =  new awt2swing.Panel ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.gBorderLayout =  new java.awt.BorderLayout ();
+this.ngBorderLayout =  new java.awt.BorderLayout ();
+this.threshold =  new awt2swing.Choice ();
+});
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser, []);
+try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+Clazz.makeConstructor (c$, 
+function (av, ap) {
+Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser, [av, ap]);
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.select_by_annotation"), 520, 215);
+this.slider.addAdjustmentListener (this);
+this.slider.addMouseListener (this);
+if (av.getAlignment ().getAlignmentAnnotation () == null) {
+return;
+}this.setOldColumnSelection (av.getColumnSelection ());
+this.adjusting = true;
+var list =  new java.util.Vector ();
+var index = 1;
+for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
+var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
+if (!list.contains (label)) {
+list.addElement (label);
+} else {
+list.addElement (label + "_" + (index++));
+}}
+for (var i = 0; i < list.size (); i++) {
+this.annotations.addItem (list.elementAt (i).toString ());
+}
+this.populateThresholdComboBox (this.threshold);
+if (av.getAnnotationColumnSelectionState () != null) {
+this.currentSearchPanel = av.getAnnotationColumnSelectionState ().getCurrentSearchPanel ();
+this.currentStructureFilterPanel = av.getAnnotationColumnSelectionState ().getCurrentStructureFilterPanel ();
+this.annotations.select (new Integer (av.getAnnotationColumnSelectionState ().getAnnotations ().getSelectedIndex ()));
+this.threshold.select (new Integer (av.getAnnotationColumnSelectionState ().getThreshold ().getSelectedIndex ()));
+this.actionOption = av.getAnnotationColumnSelectionState ().getActionOption ();
+}try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+this.adjusting = false;
+this.updateView ();
+this.frame.invalidate ();
+this.frame.pack ();
+}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz.defineMethod (c$, "jbInit", 
+ function () {
+this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
+this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setColumns (7);
+this.ok.addActionListener (this);
+this.cancel.addActionListener (this);
+this.annotations.addItemListener (this);
+this.thresholdValue.addActionListener (this);
+this.threshold.addItemListener (this);
+this.slider.setBackground (java.awt.Color.white);
+this.slider.setEnabled (false);
+this.slider.setPreferredSize ( new java.awt.Dimension (100, 32));
+this.thresholdPanel.setBackground (java.awt.Color.white);
+this.actionPanel.setBackground (java.awt.Color.white);
+this.graphFilterView.setLayout (this.gBorderLayout);
+this.graphFilterView.setBackground (java.awt.Color.white);
+this.noGraphFilterView.setLayout (this.ngBorderLayout);
+this.noGraphFilterView.setBackground (java.awt.Color.white);
+this.annotationComboBoxPanel.setBackground (java.awt.Color.white);
+this.gSearchPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
+this.ngSearchPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
+this.gFurtherActionPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
+this.ngFurtherActionPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
+this.gStructureFilterPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
+this.ngStructureFilterPanel = Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
+this.thresholdPanel.setTitle ("Threshold Filter");
+this.thresholdPanel.add (this.getThreshold ());
+this.thresholdPanel.add (this.slider);
+this.thresholdPanel.add (this.thresholdValue);
+this.actionPanel.add (this.ok);
+this.actionPanel.add (this.cancel);
+var staticPanel =  new javax.swing.JPanel ();
+staticPanel.setLayout ( new java.awt.BorderLayout ());
+staticPanel.setBackground (java.awt.Color.white);
+staticPanel.add (this.gSearchPanel, "North");
+staticPanel.add (this.gStructureFilterPanel, "South");
+this.graphFilterView.add (staticPanel, "North");
+this.graphFilterView.add (this.thresholdPanel, "Center");
+this.graphFilterView.add (this.gFurtherActionPanel, "South");
+this.noGraphFilterView.add (this.ngSearchPanel, "First");
+this.noGraphFilterView.add (this.ngStructureFilterPanel, "Center");
+this.noGraphFilterView.add (this.ngFurtherActionPanel, "Center");
+this.annotationComboBoxPanel.add (this.getAnnotations ());
+this.switchableViewsPanel.add (this.noGraphFilterView, jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW);
+this.switchableViewsPanel.add (this.graphFilterView, jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW);
+this.setLayout (this.borderLayout1);
+this.add (this.annotationComboBoxPanel, "First");
+this.add (this.switchableViewsPanel, "Center");
+this.add (this.actionPanel, "South");
+this.selectedAnnotationChanged ();
+this.validate ();
+});
+Clazz.overrideMethod (c$, "reset", 
+function () {
+if (this.getOldColumnSelection () != null) {
+this.av.getColumnSelection ().clear ();
+if (this.av.getAnnotationColumnSelectionState () != null) {
+var oldSelection = this.av.getAnnotationColumnSelectionState ().getOldColumnSelection ();
+if (oldSelection != null && oldSelection.getHiddenColumns () != null && !oldSelection.getHiddenColumns ().isEmpty ()) {
+for (var itr = oldSelection.getHiddenColumns ().iterator (); itr.hasNext (); ) {
+var positions = itr.next ();
+this.av.hideColumns (positions[0], positions[1]);
+}
+}this.av.setColumnSelection (oldSelection);
+}this.ap.paintAlignment (true);
+}});
+Clazz.overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+if (!this.adjusting) {
+this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
+this.valueChanged (!this.sliderDragging);
+}}, "java.awt.event.AdjustmentEvent");
+Clazz.defineMethod (c$, "addSliderMouseListeners", 
+function () {
+this.slider.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.AnnotationColumnChooser$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$1, this, null)));
+});
+Clazz.overrideMethod (c$, "valueChanged", 
+function (updateAllAnnotation) {
+if (this.slider.isEnabled ()) {
+this.getCurrentAnnotation ().threshold.value = this.slider.getValue () / 1000;
+this.updateView ();
+this.ap.paintAlignment (false);
+}}, "~B");
+Clazz.defineMethod (c$, "getThreshold", 
+function () {
+return this.threshold;
+});
+Clazz.defineMethod (c$, "setThreshold", 
+function (threshold) {
+this.threshold = threshold;
+}, "awt2swing.Choice");
+Clazz.defineMethod (c$, "getAnnotations", 
+function () {
+return this.annotations;
+});
+Clazz.defineMethod (c$, "setAnnotations", 
+function (annotations) {
+this.annotations = annotations;
+}, "awt2swing.Choice");
+Clazz.overrideMethod (c$, "updateView", 
+function () {
+if (this.adjusting) {
+return;
+}var filterParams =  new jalview.viewmodel.annotationfilter.AnnotationFilterParameter ();
+this.setCurrentAnnotation (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()]);
+var selectedThresholdItem = this.getSelectedThresholdItem (this.getThreshold ().getSelectedIndex ());
+this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+if (selectedThresholdItem == -1) {
+this.slider.setEnabled (false);
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setText ("");
+} else if (selectedThresholdItem != -1) {
+if (this.getCurrentAnnotation ().threshold == null) {
+this.getCurrentAnnotation ().setThreshold ( new jalview.datamodel.GraphLine ((this.getCurrentAnnotation ().graphMax - this.getCurrentAnnotation ().graphMin) / 2, "Threshold", java.awt.Color.black));
+}this.adjusting = true;
+var range = this.getCurrentAnnotation ().graphMax * 1000 - this.getCurrentAnnotation ().graphMin * 1000;
+this.slider.setMinimum (Clazz.floatToInt (this.getCurrentAnnotation ().graphMin * 1000));
+this.slider.setMaximum (Clazz.floatToInt (this.getCurrentAnnotation ().graphMax * 1000));
+this.slider.setValue (Clazz.floatToInt (this.getCurrentAnnotation ().threshold.value * 1000));
+this.thresholdValue.setText (this.getCurrentAnnotation ().threshold.value + "");
+this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+this.adjusting = false;
+filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
+if (this.getCurrentAnnotation ().graph != 0) {
+filterParams.setThresholdValue (this.getCurrentAnnotation ().threshold.value);
+if (selectedThresholdItem == 1) {
+filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD);
+} else if (selectedThresholdItem == 0) {
+filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD);
+}}}if (this.currentStructureFilterPanel != null) {
+if (this.currentStructureFilterPanel.alphaHelix.getState ()) {
+filterParams.setFilterAlphaHelix (true);
+}if (this.currentStructureFilterPanel.betaStrand.getState ()) {
+filterParams.setFilterBetaSheet (true);
+}if (this.currentStructureFilterPanel.turn.getState ()) {
+filterParams.setFilterTurn (true);
+}}if (this.currentSearchPanel != null) {
+if (!this.currentSearchPanel.searchBox.getText ().isEmpty ()) {
+this.currentSearchPanel.description.setEnabled (true);
+this.currentSearchPanel.displayName.setEnabled (true);
+filterParams.setRegexString (this.currentSearchPanel.searchBox.getText ());
+if (this.currentSearchPanel.displayName.getState ()) {
+filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING);
+}if (this.currentSearchPanel.description.getState ()) {
+filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION);
+}} else {
+this.currentSearchPanel.description.setEnabled (false);
+this.currentSearchPanel.displayName.setEnabled (false);
+}}this.av.getColumnSelection ().filterAnnotations (this.getCurrentAnnotation ().annotations, filterParams);
+this.av.showAllHiddenColumns ();
+if (this.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
+this.av.hideSelectedColumns ();
+}filterParams = null;
+this.av.setAnnotationColumnSelectionState (this);
+this.ap.paintAlignment (true);
+});
+Clazz.defineMethod (c$, "getOldColumnSelection", 
+function () {
+return this.oldColumnSelection;
+});
+Clazz.defineMethod (c$, "setOldColumnSelection", 
+function (currentColumnSelection) {
+if (currentColumnSelection != null) {
+this.oldColumnSelection =  new jalview.datamodel.ColumnSelection (currentColumnSelection);
+}}, "jalview.datamodel.ColumnSelection");
+Clazz.defineMethod (c$, "getCurrentFutherActionPanel", 
+function () {
+return this.currentFurtherActionPanel;
+});
+Clazz.defineMethod (c$, "setCurrentFutherActionPanel", 
+function (currentFutherActionPanel) {
+this.currentFurtherActionPanel = currentFutherActionPanel;
+}, "jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel");
+Clazz.defineMethod (c$, "getCurrentSearchPanel", 
+function () {
+return this.currentSearchPanel;
+});
+Clazz.defineMethod (c$, "setCurrentSearchPanel", 
+function (currentSearchPanel) {
+this.currentSearchPanel = currentSearchPanel;
+}, "jalview.appletgui.AnnotationColumnChooser.SearchPanel");
+Clazz.defineMethod (c$, "getActionOption", 
+function () {
+return this.actionOption;
+});
+Clazz.defineMethod (c$, "setActionOption", 
+function (actionOption) {
+this.actionOption = actionOption;
+}, "~N");
+Clazz.defineMethod (c$, "getCurrentStructureFilterPanel", 
+function () {
+return this.currentStructureFilterPanel;
+});
+Clazz.defineMethod (c$, "setCurrentStructureFilterPanel", 
+function (currentStructureFilterPanel) {
+this.currentStructureFilterPanel = currentStructureFilterPanel;
+}, "jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel");
+Clazz.overrideMethod (c$, "itemStateChanged", 
+function (e) {
+if (e.getSource () === this.annotations) {
+this.selectedAnnotationChanged ();
+} else if (e.getSource () === this.threshold) {
+this.threshold_actionPerformed (null);
+}}, "java.awt.event.ItemEvent");
+Clazz.defineMethod (c$, "selectedAnnotationChanged", 
+function () {
+var currentView = jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW;
+if (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()].graph != 0) {
+currentView = jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW;
+}this.gSearchPanel.syncState ();
+this.gFurtherActionPanel.syncState ();
+this.gStructureFilterPanel.syncState ();
+this.ngSearchPanel.syncState ();
+this.ngFurtherActionPanel.syncState ();
+this.ngStructureFilterPanel.syncState ();
+this.switchableViewsLayout.show (this.switchableViewsPanel, currentView);
+this.updateView ();
+});
+Clazz.overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.thresholdValue) {
+try {
+var f =  new Float (this.thresholdValue.getText ()).floatValue ();
+this.slider.setValue (Clazz.floatToInt (f * 1000));
+this.adjustmentValueChanged (null);
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+} else if (evt.getSource () === this.ok) {
+this.ok_actionPerformed (null);
+} else if (evt.getSource () === this.cancel) {
+this.cancel_actionPerformed (null);
+} else if (evt.getSource () === this.thresholdValue) {
+this.thresholdValue_actionPerformed (null);
+} else {
+this.updateView ();
+}}, "java.awt.event.ActionEvent");
+Clazz.overrideMethod (c$, "mouseClicked", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mousePressed", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseReleased", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseEntered", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseExited", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+c$.$AnnotationColumnChooser$FurtherActionPanel$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.aColChooser = null;
+this.furtherAction = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui.AnnotationColumnChooser, "FurtherActionPanel", awt2swing.Panel, java.awt.event.ItemListener);
+Clazz.prepareFields (c$, function () {
+this.furtherAction =  new awt2swing.Choice ();
+});
+Clazz.makeConstructor (c$, 
+function (a) {
+Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, []);
+this.aColChooser = a;
+this.furtherAction.addItem ("Select");
+this.furtherAction.addItem ("Hide");
+this.furtherAction.addItemListener (this);
+this.syncState ();
+this.add (this.furtherAction);
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz.defineMethod (c$, "syncState", 
+function () {
+if (this.aColChooser.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
+this.furtherAction.select ("Hide");
+} else {
+this.furtherAction.select ("Select");
+}});
+Clazz.overrideMethod (c$, "itemStateChanged", 
+function (a) {
+this.aColChooser.setCurrentFutherActionPanel (this);
+if (this.furtherAction.getSelectedItem ().toString ().equalsIgnoreCase ("Select")) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (1);
+this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
+} else {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE);
+this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
+}}, "java.awt.event.ItemEvent");
+c$ = Clazz.p0p ();
+};
+c$.$AnnotationColumnChooser$StructureFilterPanel$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.aColChooser = null;
+this.alphaHelix = null;
+this.betaStrand = null;
+this.turn = null;
+this.all = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui.AnnotationColumnChooser, "StructureFilterPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
+Clazz.prepareFields (c$, function () {
+this.alphaHelix =  new awt2swing.Checkbox ();
+this.betaStrand =  new awt2swing.Checkbox ();
+this.turn =  new awt2swing.Checkbox ();
+this.all =  new awt2swing.Checkbox ();
+});
+Clazz.makeConstructor (c$, 
+function (a) {
+Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, []);
+this.aColChooser = a;
+this.alphaHelix.setLabel (jalview.util.MessageManager.getString ("label.alpha_helix"));
+this.alphaHelix.setBackground (java.awt.Color.white);
+this.alphaHelix.addItemListener (this);
+this.betaStrand.setLabel (jalview.util.MessageManager.getString ("label.beta_strand"));
+this.betaStrand.setBackground (java.awt.Color.white);
+this.betaStrand.addItemListener (this);
+this.turn.setLabel (jalview.util.MessageManager.getString ("label.turn"));
+this.turn.setBackground (java.awt.Color.white);
+this.turn.addItemListener (this);
+this.all.setLabel (jalview.util.MessageManager.getString ("label.select_all"));
+this.all.setBackground (java.awt.Color.white);
+this.all.addItemListener (this);
+this.setBackground (java.awt.Color.white);
+this.setTitle ("Structure Filter");
+this.add (this.all);
+this.add (this.alphaHelix);
+this.add (this.betaStrand);
+this.add (this.turn);
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz.defineMethod (c$, "alphaHelix_actionPerformed", 
+function () {
+this.updateSelectAllState ();
+this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "betaStrand_actionPerformed", 
+function () {
+this.updateSelectAllState ();
+this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "turn_actionPerformed", 
+function () {
+this.updateSelectAllState ();
+this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "all_actionPerformed", 
+function () {
+if (this.all.getState ()) {
+this.alphaHelix.setState (true);
+this.betaStrand.setState (true);
+this.turn.setState (true);
+} else {
+this.alphaHelix.setState (false);
+this.betaStrand.setState (false);
+this.turn.setState (false);
+}this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "updateSelectAllState", 
+function () {
+if (this.alphaHelix.getState () && this.betaStrand.getState () && this.turn.getState ()) {
+this.all.setState (true);
+} else {
+this.all.setState (false);
+}});
+Clazz.defineMethod (c$, "syncState", 
+function () {
+var a = this.aColChooser.getCurrentStructureFilterPanel ();
+if (a != null) {
+this.alphaHelix.setState (a.alphaHelix.getState ());
+this.betaStrand.setState (a.betaStrand.getState ());
+this.turn.setState (a.turn.getState ());
+if (a.all.getState ()) {
+this.all.setState (true);
+this.alphaHelix.setState (true);
+this.betaStrand.setState (true);
+this.turn.setState (true);
+}}});
+Clazz.overrideMethod (c$, "itemStateChanged", 
+function (a) {
+if (a.getSource () === this.alphaHelix) {
+this.alphaHelix_actionPerformed ();
+} else if (a.getSource () === this.betaStrand) {
+this.betaStrand_actionPerformed ();
+} else if (a.getSource () === this.turn) {
+this.turn_actionPerformed ();
+} else if (a.getSource () === this.all) {
+this.all_actionPerformed ();
+}}, "java.awt.event.ItemEvent");
+c$ = Clazz.p0p ();
+};
+c$.$AnnotationColumnChooser$SearchPanel$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.aColChooser = null;
+this.displayName = null;
+this.description = null;
+this.searchBox = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui.AnnotationColumnChooser, "SearchPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
+Clazz.prepareFields (c$, function () {
+this.displayName =  new awt2swing.Checkbox ();
+this.description =  new awt2swing.Checkbox ();
+this.searchBox =  new awt2swing.TextField (10);
+});
+Clazz.makeConstructor (c$, 
+function (a) {
+Clazz.superConstructor (this, jalview.appletgui.AnnotationColumnChooser.SearchPanel, []);
+this.aColChooser = a;
+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)));
+this.displayName.setLabel (jalview.util.MessageManager.getString ("label.display_name"));
+this.displayName.setEnabled (false);
+this.displayName.addItemListener (this);
+this.description.setLabel (jalview.util.MessageManager.getString ("label.description"));
+this.description.setEnabled (false);
+this.description.addItemListener (this);
+this.setTitle ("Search Filter");
+this.syncState ();
+this.add (this.searchBox);
+this.add (this.displayName);
+this.add (this.description);
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz.defineMethod (c$, "displayNameCheckboxAction", 
+function () {
+this.aColChooser.setCurrentSearchPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "discriptionCheckboxAction", 
+function () {
+this.aColChooser.setCurrentSearchPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "searchStringAction", 
+function () {
+this.aColChooser.setCurrentSearchPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz.defineMethod (c$, "syncState", 
+function () {
+var a = this.aColChooser.getCurrentSearchPanel ();
+if (a != null) {
+this.description.setEnabled (a.description.isEnabled ());
+this.description.setState (a.description.getState ());
+this.displayName.setEnabled (a.displayName.isEnabled ());
+this.displayName.setState (a.displayName.getState ());
+this.searchBox.setText (a.searchBox.getText ());
+}});
+Clazz.overrideMethod (c$, "itemStateChanged", 
+function (a) {
+if (a.getSource () === this.displayName) {
+this.displayNameCheckboxAction ();
+} else if (a.getSource () === this.description) {
+this.discriptionCheckboxAction ();
+}}, "java.awt.event.ItemEvent");
+c$.$AnnotationColumnChooser$SearchPanel$1$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$SearchPanel$1", null, java.awt.event.TextListener);
+Clazz.overrideMethod (c$, "textValueChanged", 
+function (a) {
+this.b$["jalview.appletgui.AnnotationColumnChooser.SearchPanel"].searchStringAction ();
+}, "java.awt.event.TextEvent");
+c$ = Clazz.p0p ();
+};
+c$ = Clazz.p0p ();
+};
+c$.$AnnotationColumnChooser$1$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$1", java.awt.event.MouseAdapter);
+Clazz.defineMethod (c$, "mousePressed", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
+Clazz.superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mousePressed", [e]);
+}, "java.awt.event.MouseEvent");
+Clazz.defineMethod (c$, "mouseDragged", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
+Clazz.superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mouseDragged", [e]);
+}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseReleased", 
+function (evt) {
+if (this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = false;
+this.b$["jalview.appletgui.AnnotationColumnChooser"].valueChanged (true);
+}this.b$["jalview.appletgui.AnnotationColumnChooser"].ap.paintAlignment (true);
+}, "java.awt.event.MouseEvent");
+c$ = Clazz.p0p ();
+};
+Clazz.defineStatics (c$,
+"ACTION_OPTION_SELECT", 1,
+"ACTION_OPTION_HIDE", 2,
+"NO_GRAPH_VIEW", "0",
+"GRAPH_VIEW", "1");
+});