1 Clazz.declarePackage ("jalview.appletgui");
2 Clazz.load (["awt2swing.Panel", "$.Button", "$.Checkbox", "$.Scrollbar", "$.TextField"], "jalview.appletgui.AnnotationRowFilter", ["jalview.util.MessageManager", "java.lang.Float", "java.util.Vector"], function () {
3 c$ = Clazz.decorateAsClass (function () {
7 this.enableSeqAss = false;
8 this.currentAnnotation = null;
9 this.adjusting = false;
10 this.currentColours = null;
11 this.minColour = null;
12 this.maxColour = null;
13 this.seqAssociated = null;
14 this.thresholdIsMin = null;
16 this.thresholdValue = null;
20 this.sliderDragging = false;
21 Clazz.instantialize (this, arguments);
22 }, jalview.appletgui, "AnnotationRowFilter", awt2swing.Panel);
23 Clazz.prepareFields (c$, function () {
24 this.currentColours = new awt2swing.Checkbox ();
25 this.minColour = new awt2swing.Panel ();
26 this.maxColour = new awt2swing.Panel ();
27 this.seqAssociated = new awt2swing.Checkbox ();
28 this.thresholdIsMin = new awt2swing.Checkbox ();
29 this.slider = new awt2swing.Scrollbar (0);
30 this.thresholdValue = new awt2swing.TextField (20);
31 this.ok = new awt2swing.Button ();
32 this.cancel = new awt2swing.Button ();
34 Clazz.makeConstructor (c$,
36 Clazz.superConstructor (this, jalview.appletgui.AnnotationRowFilter, []);
39 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
40 Clazz.makeConstructor (c$,
42 Clazz.superConstructor (this, jalview.appletgui.AnnotationRowFilter, []);
44 Clazz.defineMethod (c$, "getAnnotationItems",
45 function (isSeqAssociated) {
46 var list = new java.util.Vector ();
48 var anmap = Clazz.newIntArray (this.av.getAlignment ().getAlignmentAnnotation ().length, 0);
49 for (var i = 0; i < this.av.getAlignment ().getAlignmentAnnotation ().length; i++) {
50 if (this.av.getAlignment ().getAlignmentAnnotation ()[i].sequenceRef == null) {
51 if (isSeqAssociated) {
54 this.enableSeqAss = true;
55 }var label = this.av.getAlignment ().getAlignmentAnnotation ()[i].label;
56 if (!list.contains (label)) {
57 anmap[list.size ()] = i;
60 if (!isSeqAssociated) {
61 anmap[list.size ()] = i;
62 list.add (label + "_" + (index++));
64 this.annmap = Clazz.newIntArray (list.size (), 0);
65 System.arraycopy (anmap, 0, this.annmap, 0, this.annmap.length);
68 Clazz.defineMethod (c$, "getSelectedThresholdItem",
69 function (indexValue) {
70 var selectedThresholdItem = -1;
71 if (indexValue == 1) {
72 selectedThresholdItem = 1;
73 } else if (indexValue == 2) {
74 selectedThresholdItem = 0;
75 }return selectedThresholdItem;
77 Clazz.defineMethod (c$, "modelChanged",
79 this.seqAssociated.setEnabled (this.enableSeqAss);
81 Clazz.defineMethod (c$, "ok_actionPerformed",
84 this.frame.setVisible (false);
85 }, "java.awt.event.ActionEvent");
86 Clazz.defineMethod (c$, "cancel_actionPerformed",
89 this.ap.paintAlignment (true);
90 this.frame.setVisible (false);
91 }, "java.awt.event.ActionEvent");
92 Clazz.defineMethod (c$, "thresholdCheck_actionPerformed",
95 }, "java.awt.event.ActionEvent");
96 Clazz.defineMethod (c$, "annotations_actionPerformed",
99 }, "java.awt.event.ActionEvent");
100 Clazz.defineMethod (c$, "threshold_actionPerformed",
103 }, "java.awt.event.ActionEvent");
104 Clazz.defineMethod (c$, "thresholdValue_actionPerformed",
107 var f = Float.parseFloat (this.thresholdValue.getText ());
108 this.slider.setValue (Clazz.floatToInt (f * 1000));
111 if (Clazz.exceptionOf (ex, NumberFormatException)) {
116 }, "java.awt.event.ActionEvent");
117 Clazz.defineMethod (c$, "populateThresholdComboBox",
118 function (threshold) {
119 threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));
120 threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));
121 threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));
122 }, "awt2swing.Choice");
123 Clazz.defineMethod (c$, "getCurrentAnnotation",
125 return this.currentAnnotation;
127 Clazz.defineMethod (c$, "setCurrentAnnotation",
128 function (currentAnnotation) {
129 this.currentAnnotation = currentAnnotation;
130 }, "jalview.datamodel.AlignmentAnnotation");