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