X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fappletgui%2FAnnotationColumnChooser.js;h=8c0126c682cbbfca522aadc1dce7f14f883a2ba8;hp=44e2386f9e6740217d84c894a898f8a6e0dd2dbb;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/jalview/appletgui/AnnotationColumnChooser.js b/site/j2s/jalview/appletgui/AnnotationColumnChooser.js index 44e2386..8c0126c 100644 --- a/site/j2s/jalview/appletgui/AnnotationColumnChooser.js +++ b/site/j2s/jalview/appletgui/AnnotationColumnChooser.js @@ -1,622 +1,622 @@ -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"); -}); +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"); +});