JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / jalview / appletgui / FeatureSettings.js
1 Clazz.declarePackage ("jalview.appletgui");\r
2 Clazz.load (["awt2swing.Checkbox", "$.Panel", "jalview.api.FeatureSettingsControllerI", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.FeatureSettings", ["awt2swing.Button", "$.Frame", "$.Label", "$.MenuItem", "$.PopupMenu", "$.ScrollPane", "$.Scrollbar", "jalview.appletgui.FeatureColourChooser", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.Font", "$.GridLayout", "$.Toolkit", "java.awt.event.WindowAdapter", "java.lang.Boolean", "$.Error", "java.util.Vector"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.fr = null;\r
5 this.ap = null;\r
6 this.av = null;\r
7 this.frame = null;\r
8 this.groupPanel = null;\r
9 this.featurePanel = null;\r
10 this.scrollPane = null;\r
11 this.linkImage = null;\r
12 this.transparency = null;\r
13 this.groupItemListener = null;\r
14 this.selectedCheck = null;\r
15 this.dragging = false;\r
16 if (!Clazz.isClassDefined ("jalview.appletgui.FeatureSettings.MyCheckbox")) {\r
17 jalview.appletgui.FeatureSettings.$FeatureSettings$MyCheckbox$ ();\r
18 }\r
19 Clazz.instantialize (this, arguments);\r
20 }, jalview.appletgui, "FeatureSettings", awt2swing.Panel, [java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, jalview.api.FeatureSettingsControllerI]);\r
21 Clazz.prepareFields (c$, function () {\r
22 this.featurePanel =  new awt2swing.Panel ();\r
23 this.groupItemListener = ((Clazz.isClassDefined ("jalview.appletgui.FeatureSettings$1") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings$1, this, null));\r
24 });\r
25 Clazz.makeConstructor (c$, \r
26 function (ap) {\r
27 Clazz.superConstructor (this, jalview.appletgui.FeatureSettings, []);\r
28 this.ap = ap;\r
29 this.av = ap.av;\r
30 ap.av.featureSettings = this;\r
31 this.fr = ap.seqPanel.seqCanvas.getFeatureRenderer ();\r
32 this.transparency =  new awt2swing.Scrollbar (0, 100 - Clazz.floatToInt (this.fr.getTransparency () * 100), 1, 1, 100);\r
33 if (this.fr.isTransparencyAvailable ()) {\r
34 this.transparency.addAdjustmentListener (this);\r
35 } else {\r
36 this.transparency.setEnabled (false);\r
37 }var url = this.getClass ().getResource ("/images/link.gif");\r
38 if (url != null) {\r
39 this.linkImage = java.awt.Toolkit.getDefaultToolkit ().getImage (url);\r
40 }if (this.av.isShowSequenceFeatures () || !this.fr.hasRenderOrder ()) {\r
41 this.fr.findAllFeatures (true);\r
42 }this.discoverAllFeatureData ();\r
43 this.setLayout ( new java.awt.BorderLayout ());\r
44 this.scrollPane =  new awt2swing.ScrollPane ();\r
45 this.scrollPane.add (this.featurePanel);\r
46 if (this.fr.getAllFeatureColours () != null && this.fr.getAllFeatureColours ().size () > 0) {\r
47 this.add (this.scrollPane, "Center");\r
48 }var invert =  new awt2swing.Button ("Invert Selection");\r
49 invert.addActionListener (this);\r
50 var lowerPanel =  new awt2swing.Panel ( new java.awt.GridLayout (2, 1, 5, 10));\r
51 lowerPanel.add (invert);\r
52 var tPanel =  new awt2swing.Panel ( new java.awt.BorderLayout ());\r
53 if (this.fr.isTransparencyAvailable ()) {\r
54 tPanel.add (this.transparency, "Center");\r
55 tPanel.add ( new awt2swing.Label ("Transparency"), "East");\r
56 } else {\r
57 tPanel.add ( new awt2swing.Label ("Transparency not available in this web browser"), "Center");\r
58 }lowerPanel.add (tPanel, "South");\r
59 this.add (lowerPanel, "South");\r
60 if (this.groupPanel != null) {\r
61 this.groupPanel.setLayout ( new java.awt.GridLayout (Clazz.doubleToInt ((this.fr.getFeatureGroupsSize ()) / 4) + 1, 4));\r
62 this.groupPanel.validate ();\r
63 this.add (this.groupPanel, "North");\r
64 }this.frame =  new awt2swing.Frame ();\r
65 this.frame.add (this);\r
66 var me = this;\r
67 this.frame.addWindowListener (((Clazz.isClassDefined ("jalview.appletgui.FeatureSettings$2") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$2$ ()), Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings$2, this, Clazz.cloneFinals ("me", me))));\r
68 var height = this.featurePanel.getComponentCount () * 50 + 60;\r
69 height = Math.max (200, height);\r
70 height = Math.min (400, height);\r
71 var width = 300;\r
72 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.feature_settings"), width, height);\r
73 }, "jalview.appletgui.AlignmentPanel");\r
74 Clazz.defineMethod (c$, "PaintComponent", \r
75 function (g) {\r
76 g.setColor (java.awt.Color.black);\r
77 g.drawString (jalview.util.MessageManager.getString ("label.no_features_added_to_this_alignment"), 10, 20);\r
78 g.drawString (jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_1"), 10, 40);\r
79 g.drawString (jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_2"), 10, 60);\r
80 }, "java.awt.Graphics");\r
81 Clazz.defineMethod (c$, "popupSort", \r
82 function (check, minmax, x, y) {\r
83 var type = check.type;\r
84 var typeCol = this.fr.getFeatureStyle (type);\r
85 var men =  new awt2swing.PopupMenu (jalview.util.MessageManager.formatMessage ("label.settings_for_type",  Clazz.newArray (-1, [type])));\r
86 var scr =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sort_by_score"));\r
87 men.add (scr);\r
88 var me = this;\r
89 scr.addActionListener (((Clazz.isClassDefined ("jalview.appletgui.FeatureSettings$3") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$3$ ()), Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings$3, this, Clazz.cloneFinals ("me", me, "type", type))));\r
90 var dens =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sort_by_density"));\r
91 dens.addActionListener (((Clazz.isClassDefined ("jalview.appletgui.FeatureSettings$4") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$4$ ()), Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings$4, this, Clazz.cloneFinals ("me", me, "type", type))));\r
92 men.add (dens);\r
93 if (minmax != null) {\r
94 var typeMinMax = minmax.get (type);\r
95 if (typeMinMax != null && (typeMinMax)[0] != null) {\r
96 var mxcol =  new awt2swing.MenuItem ((Clazz.instanceOf (typeCol, java.awt.Color)) ? "Graduated Colour" : "Single Colour");\r
97 men.add (mxcol);\r
98 mxcol.addActionListener (((Clazz.isClassDefined ("jalview.appletgui.FeatureSettings$5") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$5$ ()), Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings$5, this, Clazz.cloneFinals ("typeCol", typeCol, "me", me, "type", type, "check", check))));\r
99 }}this.featurePanel.add (men);\r
100 men.show (this.featurePanel, x, y);\r
101 }, "jalview.appletgui.FeatureSettings.MyCheckbox,java.util.Hashtable,~N,~N");\r
102 Clazz.overrideMethod (c$, "discoverAllFeatureData", \r
103 function () {\r
104 if (this.fr.getAllFeatureColours () != null && this.fr.getAllFeatureColours ().size () > 0) {\r
105 this.rebuildGroups ();\r
106 }this.resetTable (false);\r
107 });\r
108 Clazz.defineMethod (c$, "rebuildGroups", \r
109 function () {\r
110 var rdrw = false;\r
111 if (this.groupPanel == null) {\r
112 this.groupPanel =  new awt2swing.Panel ();\r
113 } else {\r
114 rdrw = true;\r
115 this.groupPanel.removeAll ();\r
116 }for (var group, $group = this.fr.getFeatureGroups ().iterator (); $group.hasNext () && ((group = $group.next ()) || true);) {\r
117 var vis = this.fr.checkGroupVisibility (group, false);\r
118 var check = Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings.MyCheckbox, this, null, group, vis, (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (group)));\r
119 check.addMouseListener (this);\r
120 check.setFont ( new java.awt.Font ("Serif", 1, 12));\r
121 check.addItemListener (this.groupItemListener);\r
122 check.setVisible (vis);\r
123 this.groupPanel.add (check);\r
124 }\r
125 if (rdrw) {\r
126 this.groupPanel.validate ();\r
127 }});\r
128 Clazz.defineMethod (c$, "resetTable", \r
129 function (groupsChanged) {\r
130 var tmpfeatures;\r
131 var group = null;\r
132 var type;\r
133 var visibleChecks =  new java.util.Vector ();\r
134 var alignment = this.av.getAlignment ();\r
135 for (var i = 0; i < alignment.getHeight (); i++) {\r
136 if (alignment.getSequenceAt (i).getSequenceFeatures () == null) {\r
137 continue;\r
138 }tmpfeatures = alignment.getSequenceAt (i).getSequenceFeatures ();\r
139 var index = 0;\r
140 while (index < tmpfeatures.length) {\r
141 group = tmpfeatures[index].featureGroup;\r
142 if (group == null || this.fr.checkGroupVisibility (group, true)) {\r
143 type = tmpfeatures[index].getType ();\r
144 if (!visibleChecks.contains (type)) {\r
145 visibleChecks.addElement (type);\r
146 }}index++;\r
147 }\r
148 }\r
149 var comps;\r
150 var cSize = this.featurePanel.getComponentCount ();\r
151 var check;\r
152 for (var i = 0; i < cSize; i++) {\r
153 comps = this.featurePanel.getComponents ();\r
154 check = comps[i];\r
155 if (!visibleChecks.contains (check.type)) {\r
156 this.featurePanel.remove (i);\r
157 cSize--;\r
158 i--;\r
159 }}\r
160 if (this.fr.getRenderOrder () != null) {\r
161 var rol = this.fr.getRenderOrder ();\r
162 for (var ro = rol.size () - 1; ro > -1; ro--) {\r
163 var item = rol.get (ro);\r
164 if (!visibleChecks.contains (item)) {\r
165 continue;\r
166 }visibleChecks.removeElement (item);\r
167 this.addCheck (false, item);\r
168 }\r
169 }var en = visibleChecks.elements ();\r
170 while (en.hasMoreElements ()) {\r
171 this.addCheck (groupsChanged, en.nextElement ().toString ());\r
172 }\r
173 this.featurePanel.setLayout ( new java.awt.GridLayout (this.featurePanel.getComponentCount (), 1, 10, 5));\r
174 this.featurePanel.validate ();\r
175 if (this.scrollPane != null) {\r
176 this.scrollPane.validate ();\r
177 }this.itemStateChanged (null);\r
178 }, "~B");\r
179 Clazz.defineMethod (c$, "addCheck", \r
180 function (groupsChanged, type) {\r
181 var addCheck;\r
182 var comps = this.featurePanel.getComponents ();\r
183 var check;\r
184 addCheck = true;\r
185 for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {\r
186 check = comps[i];\r
187 if (check.type.equals (type)) {\r
188 addCheck = false;\r
189 break;\r
190 }}\r
191 if (addCheck) {\r
192 var selected = false;\r
193 if (groupsChanged || this.av.getFeaturesDisplayed ().isVisible (type)) {\r
194 selected = true;\r
195 }check = Clazz.innerTypeInstance (jalview.appletgui.FeatureSettings.MyCheckbox, this, null, type, selected, (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (type)), this.fr.getFeatureStyle (type));\r
196 check.addMouseListener (this);\r
197 check.addMouseMotionListener (this);\r
198 check.addItemListener (this);\r
199 if (groupsChanged) {\r
200 this.featurePanel.add (check, 0);\r
201 } else {\r
202 this.featurePanel.add (check);\r
203 }}}, "~B,~S");\r
204 Clazz.overrideMethod (c$, "actionPerformed", \r
205 function (evt) {\r
206 for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {\r
207 var check = this.featurePanel.getComponent (i);\r
208 check.setState (!check.getState ());\r
209 }\r
210 this.selectionChanged ();\r
211 }, "java.awt.event.ActionEvent");\r
212 Clazz.overrideMethod (c$, "itemStateChanged", \r
213 function (evt) {\r
214 this.selectionChanged ();\r
215 }, "java.awt.event.ItemEvent");\r
216 Clazz.defineMethod (c$, "selectionChanged", \r
217 function () {\r
218 var comps = this.featurePanel.getComponents ();\r
219 var cSize = comps.length;\r
220 var tmp =  Clazz.newArray (cSize, 3, null);\r
221 var tmpSize = 0;\r
222 for (var i = 0; i < cSize; i++) {\r
223 var check = comps[i];\r
224 tmp[tmpSize][0] = check.type;\r
225 tmp[tmpSize][1] = this.fr.getFeatureStyle (check.type);\r
226 tmp[tmpSize][2] =  new Boolean (check.getState ());\r
227 tmpSize++;\r
228 }\r
229 var data =  Clazz.newArray (tmpSize, 3, null);\r
230 System.arraycopy (tmp, 0, data, 0, tmpSize);\r
231 this.fr.setFeaturePriority (data);\r
232 this.ap.paintAlignment (true);\r
233 });\r
234 Clazz.overrideMethod (c$, "mousePressed", \r
235 function (evt) {\r
236 this.selectedCheck = evt.getSource ();\r
237 if (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (this.selectedCheck.type)) {\r
238 if (evt.getX () > this.selectedCheck.stringWidth + 20) {\r
239 evt.consume ();\r
240 }}}, "java.awt.event.MouseEvent");\r
241 Clazz.overrideMethod (c$, "mouseDragged", \r
242 function (evt) {\r
243 if ((evt.getSource ()).getParent () !== this.featurePanel) {\r
244 return;\r
245 }this.dragging = true;\r
246 }, "java.awt.event.MouseEvent");\r
247 Clazz.overrideMethod (c$, "mouseReleased", \r
248 function (evt) {\r
249 if ((evt.getSource ()).getParent () !== this.featurePanel) {\r
250 return;\r
251 }var comp = null;\r
252 var target = null;\r
253 var height = evt.getY () + evt.getComponent ().getLocation ().y;\r
254 if (height > this.featurePanel.getSize ().height) {\r
255 comp = this.featurePanel.getComponent (this.featurePanel.getComponentCount () - 1);\r
256 } else if (height < 0) {\r
257 comp = this.featurePanel.getComponent (0);\r
258 } else {\r
259 comp = this.featurePanel.getComponentAt (evt.getX (), evt.getY () + evt.getComponent ().getLocation ().y);\r
260 }if (comp != null && Clazz.instanceOf (comp, awt2swing.Checkbox)) {\r
261 target = comp;\r
262 }if (this.selectedCheck != null && target != null && this.selectedCheck !== target) {\r
263 var targetIndex = -1;\r
264 for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {\r
265 if (target === this.featurePanel.getComponent (i)) {\r
266 targetIndex = i;\r
267 break;\r
268 }}\r
269 this.featurePanel.remove (this.selectedCheck);\r
270 this.featurePanel.add (this.selectedCheck, targetIndex);\r
271 this.featurePanel.validate ();\r
272 this.itemStateChanged (null);\r
273 }}, "java.awt.event.MouseEvent");\r
274 Clazz.defineMethod (c$, "setUserColour", \r
275 function (feature, originalColour) {\r
276 if (Clazz.instanceOf (originalColour, java.awt.Color) || Clazz.instanceOf (originalColour, jalview.schemes.GraduatedColor)) {\r
277 this.fr.setColour (feature, originalColour);\r
278 } else {\r
279 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_unsupported_feature_colour_object"));\r
280 }this.refreshTable ();\r
281 }, "~S,~O");\r
282 Clazz.defineMethod (c$, "refreshTable", \r
283 function () {\r
284 this.featurePanel.removeAll ();\r
285 this.resetTable (false);\r
286 this.ap.paintAlignment (true);\r
287 });\r
288 Clazz.overrideMethod (c$, "mouseEntered", \r
289 function (evt) {\r
290 }, "java.awt.event.MouseEvent");\r
291 Clazz.overrideMethod (c$, "mouseExited", \r
292 function (evt) {\r
293 }, "java.awt.event.MouseEvent");\r
294 Clazz.overrideMethod (c$, "mouseClicked", \r
295 function (evt) {\r
296 var check = evt.getSource ();\r
297 if ((evt.getModifiers () & 4) != 0) {\r
298 this.popupSort (check, this.fr.getMinMax (), evt.getX (), evt.getY ());\r
299 }if (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (check.type)) {\r
300 if (evt.getX () > check.stringWidth + 20) {\r
301 evt.consume ();\r
302 var link = this.fr.featureLinks.get (check.type).toString ();\r
303 this.ap.alignFrame.showURL (link.substring (link.indexOf ("|") + 1), link.substring (0, link.indexOf ("|")));\r
304 }}if (check.getParent () !== this.featurePanel) {\r
305 return;\r
306 }if (evt.getClickCount () > 1) {\r
307 var fcol = this.fr.getFeatureStyle (check.type);\r
308 if (Clazz.instanceOf (fcol, java.awt.Color)) {\r
309  new jalview.appletgui.UserDefinedColours (this, check.type, fcol);\r
310 } else {\r
311  new jalview.appletgui.FeatureColourChooser (this, check.type);\r
312 check.updateColor (this.fr.getFeatureStyle (check.type));\r
313 }}}, "java.awt.event.MouseEvent");\r
314 Clazz.overrideMethod (c$, "mouseMoved", \r
315 function (evt) {\r
316 }, "java.awt.event.MouseEvent");\r
317 Clazz.overrideMethod (c$, "adjustmentValueChanged", \r
318 function (evt) {\r
319 this.fr.setTransparency ((100 - this.transparency.getValue ()) / 100);\r
320 this.ap.seqPanel.seqCanvas.repaint ();\r
321 }, "java.awt.event.AdjustmentEvent");\r
322 c$.$FeatureSettings$MyCheckbox$ = function () {\r
323 Clazz.pu$h(self.c$);\r
324 c$ = Clazz.decorateAsClass (function () {\r
325 Clazz.prepareCallback (this, arguments);\r
326 this.type = null;\r
327 this.stringWidth = 0;\r
328 this.hasLink = false;\r
329 this.gcol = null;\r
330 this.col = null;\r
331 Clazz.instantialize (this, arguments);\r
332 }, jalview.appletgui.FeatureSettings, "MyCheckbox", awt2swing.Checkbox);\r
333 Clazz.defineMethod (c$, "updateColor", \r
334 function (a) {\r
335 if (Clazz.instanceOf (a, java.awt.Color)) {\r
336 this.col = a;\r
337 this.gcol = null;\r
338 } else if (Clazz.instanceOf (a, jalview.schemes.GraduatedColor)) {\r
339 this.gcol = a;\r
340 this.col = null;\r
341 } else {\r
342 throw  new Error (jalview.util.MessageManager.getString ("error.invalid_colour_for_mycheckbox"));\r
343 }if (this.col != null) {\r
344 this.setBackground (this.col);\r
345 } else {\r
346 var b = this.type;\r
347 if (this.gcol.getThreshType () != -1) {\r
348 b += " " + ((this.gcol.getThreshType () == 1) ? "(>)" : "(<)");\r
349 }if (this.gcol.isColourByLabel ()) {\r
350 this.setBackground (java.awt.Color.white);\r
351 b += " (by Label)";\r
352 } else {\r
353 this.setBackground (this.gcol.getMinColor ());\r
354 }this.setLabel (b);\r
355 }this.repaint ();\r
356 }, "~O");\r
357 Clazz.makeConstructor (c$, \r
358 function (a, b, c) {\r
359 Clazz.superConstructor (this, jalview.appletgui.FeatureSettings.MyCheckbox, [a, b]);\r
360 this.type = a;\r
361 var d = this.b$["jalview.appletgui.FeatureSettings"].av.nullFrame.getFontMetrics (this.b$["jalview.appletgui.FeatureSettings"].av.nullFrame.getFont ());\r
362 this.stringWidth = d.stringWidth (a);\r
363 this.hasLink = c;\r
364 }, "~S,~B,~B");\r
365 Clazz.makeConstructor (c$, \r
366 function (a, b, c, d) {\r
367 this.construct (a, b, c);\r
368 this.updateColor (d);\r
369 }, "~S,~B,~B,~O");\r
370 Clazz.defineMethod (c$, "PaintComponent", \r
371 function (a) {\r
372 var b = this.getSize ();\r
373 if (this.gcol != null) {\r
374 if (this.gcol.isColourByLabel ()) {\r
375 a.setColor (java.awt.Color.white);\r
376 a.fillRect (Clazz.doubleToInt (b.width / 2), 0, Clazz.doubleToInt (b.width / 2), b.height);\r
377 } else {\r
378 var c = this.gcol.getMaxColor ();\r
379 a.setColor (c);\r
380 a.fillRect (Clazz.doubleToInt (b.width / 2), 0, Clazz.doubleToInt (b.width / 2), b.height);\r
381 }}if (this.hasLink) {\r
382 a.drawImage (this.b$["jalview.appletgui.FeatureSettings"].linkImage, this.stringWidth + 25, Clazz.doubleToInt ((this.getSize ().height - this.b$["jalview.appletgui.FeatureSettings"].linkImage.getHeight (this)) / 2), this);\r
383 }}, "java.awt.Graphics");\r
384 c$ = Clazz.p0p ();\r
385 };\r
386 c$.$FeatureSettings$1$ = function () {\r
387 Clazz.pu$h(self.c$);\r
388 c$ = Clazz.declareAnonymous (jalview.appletgui, "FeatureSettings$1", null, java.awt.event.ItemListener);\r
389 Clazz.overrideMethod (c$, "itemStateChanged", \r
390 function (evt) {\r
391 var source = evt.getSource ();\r
392 this.b$["jalview.appletgui.FeatureSettings"].fr.setGroupVisibility (source.getLabel (), source.getState ());\r
393 this.b$["jalview.appletgui.FeatureSettings"].ap.seqPanel.seqCanvas.repaint ();\r
394 if (this.b$["jalview.appletgui.FeatureSettings"].ap.overviewPanel != null) {\r
395 this.b$["jalview.appletgui.FeatureSettings"].ap.overviewPanel.updateOverviewImage ();\r
396 }this.b$["jalview.appletgui.FeatureSettings"].resetTable (true);\r
397 return;\r
398 }, "java.awt.event.ItemEvent");\r
399 c$ = Clazz.p0p ();\r
400 };\r
401 c$.$FeatureSettings$2$ = function () {\r
402 Clazz.pu$h(self.c$);\r
403 c$ = Clazz.declareAnonymous (jalview.appletgui, "FeatureSettings$2", java.awt.event.WindowAdapter);\r
404 Clazz.overrideMethod (c$, "windowClosing", \r
405 function (e) {\r
406 if (this.f$.me.av.featureSettings === this.f$.me) {\r
407 this.f$.me.av.featureSettings = null;\r
408 this.f$.me.ap = null;\r
409 this.f$.me.av = null;\r
410 }}, "java.awt.event.WindowEvent");\r
411 c$ = Clazz.p0p ();\r
412 };\r
413 c$.$FeatureSettings$3$ = function () {\r
414 Clazz.pu$h(self.c$);\r
415 c$ = Clazz.declareAnonymous (jalview.appletgui, "FeatureSettings$3", null, java.awt.event.ActionListener);\r
416 Clazz.overrideMethod (c$, "actionPerformed", \r
417 function (e) {\r
418 this.f$.me.ap.alignFrame.avc.sortAlignmentByFeatureScore ( Clazz.newArray (-1, [this.f$.type]));\r
419 }, "java.awt.event.ActionEvent");\r
420 c$ = Clazz.p0p ();\r
421 };\r
422 c$.$FeatureSettings$4$ = function () {\r
423 Clazz.pu$h(self.c$);\r
424 c$ = Clazz.declareAnonymous (jalview.appletgui, "FeatureSettings$4", null, java.awt.event.ActionListener);\r
425 Clazz.overrideMethod (c$, "actionPerformed", \r
426 function (e) {\r
427 this.f$.me.ap.alignFrame.avc.sortAlignmentByFeatureDensity ( Clazz.newArray (-1, [this.f$.type]));\r
428 }, "java.awt.event.ActionEvent");\r
429 c$ = Clazz.p0p ();\r
430 };\r
431 c$.$FeatureSettings$5$ = function () {\r
432 Clazz.pu$h(self.c$);\r
433 c$ = Clazz.declareAnonymous (jalview.appletgui, "FeatureSettings$5", null, java.awt.event.ActionListener);\r
434 Clazz.overrideMethod (c$, "actionPerformed", \r
435 function (e) {\r
436 if (Clazz.instanceOf (this.f$.typeCol, java.awt.Color)) {\r
437  new jalview.appletgui.FeatureColourChooser (this.f$.me, this.f$.type);\r
438 this.f$.check.updateColor (this.b$["jalview.appletgui.FeatureSettings"].fr.getFeatureStyle (this.f$.type));\r
439 } else {\r
440  new jalview.appletgui.UserDefinedColours (this.f$.me, this.f$.check.type, (this.f$.typeCol));\r
441 }}, "java.awt.event.ActionEvent");\r
442 c$ = Clazz.p0p ();\r
443 };\r
444 });\r