X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fappletgui%2FAnnotationRowFilter.js;h=aafbcad4ae6c4942fffd6b2a33744e586991bb66;hp=8b9fe703ea6c1a68698937ebcb10418cf2b525fd;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/jalview/appletgui/AnnotationRowFilter.js b/site/j2s/jalview/appletgui/AnnotationRowFilter.js index 8b9fe70..aafbcad 100644 --- a/site/j2s/jalview/appletgui/AnnotationRowFilter.js +++ b/site/j2s/jalview/appletgui/AnnotationRowFilter.js @@ -1,131 +1,131 @@ -Clazz.declarePackage ("jalview.appletgui"); -Clazz.load (["awt2swing.Panel", "$.Button", "$.Checkbox", "$.Scrollbar", "$.TextField"], "jalview.appletgui.AnnotationRowFilter", ["jalview.util.MessageManager", "java.lang.Float", "java.util.Vector"], function () { -c$ = Clazz.decorateAsClass (function () { -this.av = null; -this.ap = null; -this.annmap = null; -this.enableSeqAss = false; -this.currentAnnotation = null; -this.adjusting = false; -this.currentColours = null; -this.minColour = null; -this.maxColour = null; -this.seqAssociated = null; -this.thresholdIsMin = null; -this.slider = null; -this.thresholdValue = null; -this.frame = null; -this.ok = null; -this.cancel = null; -this.sliderDragging = false; -Clazz.instantialize (this, arguments); -}, jalview.appletgui, "AnnotationRowFilter", awt2swing.Panel); -Clazz.prepareFields (c$, function () { -this.currentColours = new awt2swing.Checkbox (); -this.minColour = new awt2swing.Panel (); -this.maxColour = new awt2swing.Panel (); -this.seqAssociated = new awt2swing.Checkbox (); -this.thresholdIsMin = new awt2swing.Checkbox (); -this.slider = new awt2swing.Scrollbar (0); -this.thresholdValue = new awt2swing.TextField (20); -this.ok = new awt2swing.Button (); -this.cancel = new awt2swing.Button (); -}); -Clazz.makeConstructor (c$, -function (av, ap) { -Clazz.superConstructor (this, jalview.appletgui.AnnotationRowFilter, []); -this.av = av; -this.ap = ap; -}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel"); -Clazz.makeConstructor (c$, -function () { -Clazz.superConstructor (this, jalview.appletgui.AnnotationRowFilter, []); -}); -Clazz.defineMethod (c$, "getAnnotationItems", -function (isSeqAssociated) { -var list = new java.util.Vector (); -var index = 1; -var anmap = Clazz.newIntArray (this.av.getAlignment ().getAlignmentAnnotation ().length, 0); -for (var i = 0; i < this.av.getAlignment ().getAlignmentAnnotation ().length; i++) { -if (this.av.getAlignment ().getAlignmentAnnotation ()[i].sequenceRef == null) { -if (isSeqAssociated) { -continue; -}} else { -this.enableSeqAss = true; -}var label = this.av.getAlignment ().getAlignmentAnnotation ()[i].label; -if (!list.contains (label)) { -anmap[list.size ()] = i; -list.add (label); -} else { -if (!isSeqAssociated) { -anmap[list.size ()] = i; -list.add (label + "_" + (index++)); -}}} -this.annmap = Clazz.newIntArray (list.size (), 0); -System.arraycopy (anmap, 0, this.annmap, 0, this.annmap.length); -return list; -}, "~B"); -Clazz.defineMethod (c$, "getSelectedThresholdItem", -function (indexValue) { -var selectedThresholdItem = -1; -if (indexValue == 1) { -selectedThresholdItem = 1; -} else if (indexValue == 2) { -selectedThresholdItem = 0; -}return selectedThresholdItem; -}, "~N"); -Clazz.defineMethod (c$, "modelChanged", -function () { -this.seqAssociated.setEnabled (this.enableSeqAss); -}); -Clazz.defineMethod (c$, "ok_actionPerformed", -function (e) { -this.updateView (); -this.frame.setVisible (false); -}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "cancel_actionPerformed", -function (e) { -this.reset (); -this.ap.paintAlignment (true); -this.frame.setVisible (false); -}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "thresholdCheck_actionPerformed", -function (e) { -this.updateView (); -}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "annotations_actionPerformed", -function (e) { -this.updateView (); -}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "threshold_actionPerformed", -function (e) { -this.updateView (); -}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "thresholdValue_actionPerformed", -function (e) { -try { -var f = Float.parseFloat (this.thresholdValue.getText ()); -this.slider.setValue (Clazz.floatToInt (f * 1000)); -this.updateView (); -} catch (ex) { -if (Clazz.exceptionOf (ex, NumberFormatException)) { -} else { -throw ex; -} -} -}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "populateThresholdComboBox", -function (threshold) { -threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold")); -threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold")); -threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold")); -}, "awt2swing.Choice"); -Clazz.defineMethod (c$, "getCurrentAnnotation", -function () { -return this.currentAnnotation; -}); -Clazz.defineMethod (c$, "setCurrentAnnotation", -function (currentAnnotation) { -this.currentAnnotation = currentAnnotation; -}, "jalview.datamodel.AlignmentAnnotation"); -}); +Clazz.declarePackage ("jalview.appletgui"); +Clazz.load (["awt2swing.Panel", "$.Button", "$.Checkbox", "$.Scrollbar", "$.TextField"], "jalview.appletgui.AnnotationRowFilter", ["jalview.util.MessageManager", "java.lang.Float", "java.util.Vector"], function () { +c$ = Clazz.decorateAsClass (function () { +this.av = null; +this.ap = null; +this.annmap = null; +this.enableSeqAss = false; +this.currentAnnotation = null; +this.adjusting = false; +this.currentColours = null; +this.minColour = null; +this.maxColour = null; +this.seqAssociated = null; +this.thresholdIsMin = null; +this.slider = null; +this.thresholdValue = null; +this.frame = null; +this.ok = null; +this.cancel = null; +this.sliderDragging = false; +Clazz.instantialize (this, arguments); +}, jalview.appletgui, "AnnotationRowFilter", awt2swing.Panel); +Clazz.prepareFields (c$, function () { +this.currentColours = new awt2swing.Checkbox (); +this.minColour = new awt2swing.Panel (); +this.maxColour = new awt2swing.Panel (); +this.seqAssociated = new awt2swing.Checkbox (); +this.thresholdIsMin = new awt2swing.Checkbox (); +this.slider = new awt2swing.Scrollbar (0); +this.thresholdValue = new awt2swing.TextField (20); +this.ok = new awt2swing.Button (); +this.cancel = new awt2swing.Button (); +}); +Clazz.makeConstructor (c$, +function (av, ap) { +Clazz.superConstructor (this, jalview.appletgui.AnnotationRowFilter, []); +this.av = av; +this.ap = ap; +}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel"); +Clazz.makeConstructor (c$, +function () { +Clazz.superConstructor (this, jalview.appletgui.AnnotationRowFilter, []); +}); +Clazz.defineMethod (c$, "getAnnotationItems", +function (isSeqAssociated) { +var list = new java.util.Vector (); +var index = 1; +var anmap = Clazz.newIntArray (this.av.getAlignment ().getAlignmentAnnotation ().length, 0); +for (var i = 0; i < this.av.getAlignment ().getAlignmentAnnotation ().length; i++) { +if (this.av.getAlignment ().getAlignmentAnnotation ()[i].sequenceRef == null) { +if (isSeqAssociated) { +continue; +}} else { +this.enableSeqAss = true; +}var label = this.av.getAlignment ().getAlignmentAnnotation ()[i].label; +if (!list.contains (label)) { +anmap[list.size ()] = i; +list.add (label); +} else { +if (!isSeqAssociated) { +anmap[list.size ()] = i; +list.add (label + "_" + (index++)); +}}} +this.annmap = Clazz.newIntArray (list.size (), 0); +System.arraycopy (anmap, 0, this.annmap, 0, this.annmap.length); +return list; +}, "~B"); +Clazz.defineMethod (c$, "getSelectedThresholdItem", +function (indexValue) { +var selectedThresholdItem = -1; +if (indexValue == 1) { +selectedThresholdItem = 1; +} else if (indexValue == 2) { +selectedThresholdItem = 0; +}return selectedThresholdItem; +}, "~N"); +Clazz.defineMethod (c$, "modelChanged", +function () { +this.seqAssociated.setEnabled (this.enableSeqAss); +}); +Clazz.defineMethod (c$, "ok_actionPerformed", +function (e) { +this.updateView (); +this.frame.setVisible (false); +}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "cancel_actionPerformed", +function (e) { +this.reset (); +this.ap.paintAlignment (true); +this.frame.setVisible (false); +}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "thresholdCheck_actionPerformed", +function (e) { +this.updateView (); +}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "annotations_actionPerformed", +function (e) { +this.updateView (); +}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "threshold_actionPerformed", +function (e) { +this.updateView (); +}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "thresholdValue_actionPerformed", +function (e) { +try { +var f = Float.parseFloat (this.thresholdValue.getText ()); +this.slider.setValue (Clazz.floatToInt (f * 1000)); +this.updateView (); +} catch (ex) { +if (Clazz.exceptionOf (ex, NumberFormatException)) { +} else { +throw ex; +} +} +}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "populateThresholdComboBox", +function (threshold) { +threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold")); +threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold")); +threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold")); +}, "awt2swing.Choice"); +Clazz.defineMethod (c$, "getCurrentAnnotation", +function () { +return this.currentAnnotation; +}); +Clazz.defineMethod (c$, "setCurrentAnnotation", +function (currentAnnotation) { +this.currentAnnotation = currentAnnotation; +}, "jalview.datamodel.AlignmentAnnotation"); +});