JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / jalview / appletgui / APopupMenu.js
1 Clazz.declarePackage ("jalview.appletgui");\r
2 Clazz.load (["awt2swing.PopupMenu", "java.awt.event.ActionListener", "$.ItemListener", "awt2swing.CheckboxMenuItem", "$.Menu", "$.MenuItem", "jalview.util.MessageManager"], "jalview.appletgui.APopupMenu", ["awt2swing.Frame", "jalview.analysis.AAFrequency", "$.AlignmentAnnotationUtils", "$.AlignmentUtils", "$.Conservation", "jalview.appletgui.AppletJmol", "$.CutAndPasteTransfer", "$.EditNameDialog", "$.SliderPanel", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.commands.ChangeCaseCommand", "$.EditCommand", "jalview.datamodel.SequenceFeature", "jalview.io.AppletFormatAdapter", "$.SequenceAnnotationReport", "jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.ResidueProperties", "$.StrandColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.ZappoColourScheme", "jalview.util.DBRefUtils", "$.UrlLink", "java.lang.StringBuffer", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.LinkedHashMap", "$.TreeMap"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.groupMenu = null;\r
5 this.editGroupName = null;\r
6 this.clustalColour = null;\r
7 this.zappoColour = null;\r
8 this.taylorColour = null;\r
9 this.hydrophobicityColour = null;\r
10 this.helixColour = null;\r
11 this.strandColour = null;\r
12 this.turnColour = null;\r
13 this.buriedColour = null;\r
14 this.abovePIDColour = null;\r
15 this.userDefinedColour = null;\r
16 this.PIDColour = null;\r
17 this.BLOSUM62Colour = null;\r
18 this.noColourmenuItem = null;\r
19 this.conservationMenuItem = null;\r
20 this.ap = null;\r
21 this.unGroupMenuItem = null;\r
22 this.createGroupMenuItem = null;\r
23 this.nucleotideMenuItem = null;\r
24 this.colourMenu = null;\r
25 this.showBoxes = null;\r
26 this.showText = null;\r
27 this.showColourText = null;\r
28 this.displayNonconserved = null;\r
29 this.seqShowAnnotationsMenu = null;\r
30 this.seqHideAnnotationsMenu = null;\r
31 this.seqAddReferenceAnnotations = null;\r
32 this.groupShowAnnotationsMenu = null;\r
33 this.groupHideAnnotationsMenu = null;\r
34 this.groupAddReferenceAnnotations = null;\r
35 this.editMenu = null;\r
36 this.copy = null;\r
37 this.cut = null;\r
38 this.toUpper = null;\r
39 this.toLower = null;\r
40 this.toggleCase = null;\r
41 this.outputmenu = null;\r
42 this.seqMenu = null;\r
43 this.pdb = null;\r
44 this.hideSeqs = null;\r
45 this.repGroup = null;\r
46 this.sequenceName = null;\r
47 this.sequenceFeature = null;\r
48 this.editSequence = null;\r
49 this.sequenceDetails = null;\r
50 this.selSeqDetails = null;\r
51 this.makeReferenceSeq = null;\r
52 this.seq = null;\r
53 this.revealAll = null;\r
54 this.revealSeq = null;\r
55 this.revealSeq_index = -1;\r
56 this.menu1 = null;\r
57 Clazz.instantialize (this, arguments);\r
58 }, jalview.appletgui, "APopupMenu", awt2swing.PopupMenu, [java.awt.event.ActionListener, java.awt.event.ItemListener]);\r
59 Clazz.prepareFields (c$, function () {\r
60 this.groupMenu =  new awt2swing.Menu ();\r
61 this.editGroupName =  new awt2swing.MenuItem ();\r
62 this.clustalColour =  new awt2swing.MenuItem ();\r
63 this.zappoColour =  new awt2swing.MenuItem ();\r
64 this.taylorColour =  new awt2swing.MenuItem ();\r
65 this.hydrophobicityColour =  new awt2swing.MenuItem ();\r
66 this.helixColour =  new awt2swing.MenuItem ();\r
67 this.strandColour =  new awt2swing.MenuItem ();\r
68 this.turnColour =  new awt2swing.MenuItem ();\r
69 this.buriedColour =  new awt2swing.MenuItem ();\r
70 this.abovePIDColour =  new awt2swing.CheckboxMenuItem ();\r
71 this.userDefinedColour =  new awt2swing.MenuItem ();\r
72 this.PIDColour =  new awt2swing.MenuItem ();\r
73 this.BLOSUM62Colour =  new awt2swing.MenuItem ();\r
74 this.noColourmenuItem =  new awt2swing.MenuItem ();\r
75 this.conservationMenuItem =  new awt2swing.CheckboxMenuItem ();\r
76 this.unGroupMenuItem =  new awt2swing.MenuItem ();\r
77 this.createGroupMenuItem =  new awt2swing.MenuItem ();\r
78 this.nucleotideMenuItem =  new awt2swing.MenuItem ();\r
79 this.colourMenu =  new awt2swing.Menu ();\r
80 this.showBoxes =  new awt2swing.CheckboxMenuItem ();\r
81 this.showText =  new awt2swing.CheckboxMenuItem ();\r
82 this.showColourText =  new awt2swing.CheckboxMenuItem ();\r
83 this.displayNonconserved =  new awt2swing.CheckboxMenuItem ();\r
84 this.seqShowAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.show_annotations"));\r
85 this.seqHideAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.hide_annotations"));\r
86 this.seqAddReferenceAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.add_reference_annotations"));\r
87 this.groupShowAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.show_annotations"));\r
88 this.groupHideAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.hide_annotations"));\r
89 this.groupAddReferenceAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.add_reference_annotations"));\r
90 this.editMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.edit"));\r
91 this.copy =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.copy"));\r
92 this.cut =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.cut"));\r
93 this.toUpper =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.to_upper_case"));\r
94 this.toLower =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.to_lower_case"));\r
95 this.toggleCase =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.toggle_case"));\r
96 this.outputmenu =  new awt2swing.Menu ();\r
97 this.seqMenu =  new awt2swing.Menu ();\r
98 this.pdb =  new awt2swing.MenuItem ();\r
99 this.hideSeqs =  new awt2swing.MenuItem ();\r
100 this.repGroup =  new awt2swing.MenuItem ();\r
101 this.sequenceName =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.edit_name_description"));\r
102 this.sequenceFeature =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.create_sequence_feature"));\r
103 this.editSequence =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.edit_sequence"));\r
104 this.sequenceDetails =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sequence_details") + "...");\r
105 this.selSeqDetails =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sequence_details") + "...");\r
106 this.makeReferenceSeq =  new awt2swing.MenuItem ();\r
107 this.revealAll =  new awt2swing.MenuItem ();\r
108 this.revealSeq =  new awt2swing.MenuItem ();\r
109 this.menu1 =  new awt2swing.Menu ();\r
110 });\r
111 Clazz.makeConstructor (c$, \r
112 function (apanel, seq, links) {\r
113 Clazz.superConstructor (this, jalview.appletgui.APopupMenu, []);\r
114 this.ap = apanel;\r
115 this.seq = seq;\r
116 try {\r
117 this.jbInit ();\r
118 } catch (e) {\r
119 if (Clazz.exceptionOf (e, Exception)) {\r
120 e.printStackTrace ();\r
121 } else {\r
122 throw e;\r
123 }\r
124 }\r
125 for (var i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++) {\r
126 var item =  new awt2swing.MenuItem (jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);\r
127 item.addActionListener (this);\r
128 this.outputmenu.add (item);\r
129 }\r
130 this.buildAnnotationSubmenus ();\r
131 var sg = this.ap.av.getSelectionGroup ();\r
132 if (sg != null && sg.getSize () > 0) {\r
133 this.editGroupName.setLabel (jalview.util.MessageManager.formatMessage ("label.name_param",  Clazz.newArray (-1, [sg.getName ()])));\r
134 this.showText.setState (sg.getDisplayText ());\r
135 this.showColourText.setState (sg.getColourText ());\r
136 this.showBoxes.setState (sg.getDisplayBoxes ());\r
137 this.displayNonconserved.setState (sg.getShowNonconserved ());\r
138 if (!this.ap.av.getAlignment ().getGroups ().contains (sg)) {\r
139 this.menu1.setLabel (jalview.util.MessageManager.getString ("action.edit_new_group"));\r
140 this.groupMenu.remove (this.unGroupMenuItem);\r
141 } else {\r
142 this.menu1.setLabel (jalview.util.MessageManager.getString ("action.edit_group"));\r
143 this.groupMenu.remove (this.createGroupMenuItem);\r
144 }} else {\r
145 this.remove (this.hideSeqs);\r
146 this.remove (this.groupMenu);\r
147 }if (links != null && links.size () > 0) {\r
148 var linkMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.link"));\r
149 for (var i = 0; i < links.size (); i++) {\r
150 var link = links.elementAt (i);\r
151 var urlLink =  new jalview.util.UrlLink (link);\r
152 if (!urlLink.isValid ()) {\r
153 System.err.println (urlLink.getInvalidMessage ());\r
154 continue;\r
155 }var target = urlLink.getTarget ();\r
156 var label = urlLink.getLabel ();\r
157 if (seq != null && urlLink.isDynamic ()) {\r
158 var dbr = jalview.util.DBRefUtils.selectRefs (seq.getDBRef (),  Clazz.newArray (-1, [target]));\r
159 var id = seq.getName ();\r
160 var descr = seq.getDescription ();\r
161 if (descr != null && descr.length < 1) {\r
162 descr = null;\r
163 }if (dbr != null) {\r
164 for (var r = 0; r < dbr.length; r++) {\r
165 if (id != null && dbr[r].getAccessionId ().equals (id)) {\r
166 id = null;\r
167 }var urls = urlLink.makeUrls (dbr[r].getAccessionId (), true);\r
168 if (urls != null) {\r
169 for (var u = 0; u < urls.length; u += 2) {\r
170 this.addshowLink (linkMenu, label + "|" + urls[u], urls[u + 1]);\r
171 }\r
172 }}\r
173 }if (id != null) {\r
174 var urls = urlLink.makeUrls (id, true);\r
175 if (urls != null) {\r
176 for (var u = 0; u < urls.length; u += 2) {\r
177 this.addshowLink (linkMenu, label, urls[u + 1]);\r
178 }\r
179 }}if (descr != null && urlLink.getRegexReplace () != null) {\r
180 var urls = urlLink.makeUrls (descr, true);\r
181 if (urls != null) {\r
182 for (var u = 0; u < urls.length; u += 2) {\r
183 this.addshowLink (linkMenu, label, urls[u + 1]);\r
184 }\r
185 }}} else {\r
186 this.addshowLink (linkMenu, target, urlLink.getUrl_prefix ());\r
187 }}\r
188 if (linkMenu.getItemCount () > 0) {\r
189 if (seq != null) {\r
190 this.seqMenu.add (linkMenu);\r
191 } else {\r
192 this.add (linkMenu);\r
193 }}}if (seq != null) {\r
194 this.seqMenu.setLabel (seq.getName ());\r
195 if (seq === this.ap.av.getAlignment ().getSeqrep ()) {\r
196 this.makeReferenceSeq.setLabel (jalview.util.MessageManager.getString ("action.unmark_as_reference"));\r
197 } else {\r
198 this.makeReferenceSeq.setLabel (jalview.util.MessageManager.getString ("action.set_as_reference"));\r
199 }this.repGroup.setLabel (jalview.util.MessageManager.formatMessage ("label.represent_group_with",  Clazz.newArray (-1, [seq.getName ()])));\r
200 } else {\r
201 this.remove (this.seqMenu);\r
202 }if (!this.ap.av.hasHiddenRows ()) {\r
203 this.remove (this.revealAll);\r
204 this.remove (this.revealSeq);\r
205 } else {\r
206 var index = this.ap.av.getAlignment ().findIndex (seq);\r
207 if (this.ap.av.adjustForHiddenSeqs (index) - this.ap.av.adjustForHiddenSeqs (index - 1) > 1) {\r
208 this.revealSeq_index = index;\r
209 } else {\r
210 this.remove (this.revealSeq);\r
211 }}}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceI,java.util.Vector");\r
212 Clazz.defineMethod (c$, "buildAnnotationSubmenus", \r
213 ($fz = function () {\r
214 var selectedSequence = (this.seq == null ? java.util.Collections.emptyList () : java.util.Arrays.asList ([this.seq]));\r
215 this.buildAnnotationTypesMenus (this.seqShowAnnotationsMenu, this.seqHideAnnotationsMenu, selectedSequence);\r
216 this.configureReferenceAnnotationsMenu (this.seqAddReferenceAnnotations, selectedSequence);\r
217 var selectedGroup = (this.ap.av.getSelectionGroup () == null ? java.util.Collections.emptyList () : this.ap.av.getSelectionGroup ().getSequences ());\r
218 this.buildAnnotationTypesMenus (this.groupShowAnnotationsMenu, this.groupHideAnnotationsMenu, selectedGroup);\r
219 this.configureReferenceAnnotationsMenu (this.groupAddReferenceAnnotations, selectedGroup);\r
220 }, $fz.isPrivate = true, $fz));\r
221 Clazz.defineMethod (c$, "configureReferenceAnnotationsMenu", \r
222 ($fz = function (menuItem, forSequences) {\r
223 menuItem.setEnabled (false);\r
224 var tipEntries =  new java.util.TreeMap ();\r
225 var candidates =  new java.util.LinkedHashMap ();\r
226 var al = this.ap.av.getAlignment ();\r
227 jalview.analysis.AlignmentUtils.findAddableReferenceAnnotations (forSequences, tipEntries, candidates, al);\r
228 if (!candidates.isEmpty ()) {\r
229 var tooltip =  new StringBuilder (64);\r
230 tooltip.append (jalview.util.MessageManager.getString ("label.add_annotations_for"));\r
231 menuItem.setEnabled (true);\r
232 menuItem.addActionListener (((Clazz.isClassDefined ("jalview.appletgui.APopupMenu$1") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.APopupMenu$1, this, Clazz.cloneFinals ("candidates", candidates))));\r
233 }}, $fz.isPrivate = true, $fz), "awt2swing.MenuItem,java.util.List");\r
234 Clazz.defineMethod (c$, "addReferenceAnnotations_actionPerformed", \r
235 function (candidates) {\r
236 var selectionGroup = this.ap.av.getSelectionGroup ();\r
237 var alignment = this.ap.getAlignment ();\r
238 jalview.analysis.AlignmentUtils.addReferenceAnnotations (candidates, alignment, selectionGroup);\r
239 this.refresh ();\r
240 }, "java.util.Map");\r
241 Clazz.defineMethod (c$, "addshowLink", \r
242 ($fz = function (linkMenu, target, url) {\r
243 this.addshowLink (linkMenu, target, target, url);\r
244 }, $fz.isPrivate = true, $fz), "awt2swing.Menu,~S,~S");\r
245 Clazz.defineMethod (c$, "addshowLink", \r
246 ($fz = function (linkMenu, target, label, url) {\r
247 var item =  new awt2swing.MenuItem (label);\r
248 item.addActionListener (((Clazz.isClassDefined ("jalview.appletgui.APopupMenu$2") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$2$ ()), Clazz.innerTypeInstance (jalview.appletgui.APopupMenu$2, this, Clazz.cloneFinals ("url", url, "target", target))));\r
249 linkMenu.add (item);\r
250 }, $fz.isPrivate = true, $fz), "awt2swing.Menu,~S,~S,~S");\r
251 Clazz.overrideMethod (c$, "itemStateChanged", \r
252 function (evt) {\r
253 if (evt.getSource () === this.abovePIDColour) {\r
254 this.abovePIDColour_itemStateChanged ();\r
255 } else if (evt.getSource () === this.showColourText) {\r
256 this.showColourText_itemStateChanged ();\r
257 } else if (evt.getSource () === this.showText) {\r
258 this.showText_itemStateChanged ();\r
259 } else if (evt.getSource () === this.showBoxes) {\r
260 this.showBoxes_itemStateChanged ();\r
261 } else if (evt.getSource () === this.displayNonconserved) {\r
262 this.showNonconserved_itemStateChanged ();\r
263 }}, "java.awt.event.ItemEvent");\r
264 Clazz.overrideMethod (c$, "actionPerformed", \r
265 function (evt) {\r
266 var source = evt.getSource ();\r
267 if (source === this.clustalColour) {\r
268 this.clustalColour_actionPerformed ();\r
269 } else if (source === this.zappoColour) {\r
270 this.zappoColour_actionPerformed ();\r
271 } else if (source === this.taylorColour) {\r
272 this.taylorColour_actionPerformed ();\r
273 } else if (source === this.hydrophobicityColour) {\r
274 this.hydrophobicityColour_actionPerformed ();\r
275 } else if (source === this.helixColour) {\r
276 this.helixColour_actionPerformed ();\r
277 } else if (source === this.strandColour) {\r
278 this.strandColour_actionPerformed ();\r
279 } else if (source === this.turnColour) {\r
280 this.turnColour_actionPerformed ();\r
281 } else if (source === this.buriedColour) {\r
282 this.buriedColour_actionPerformed ();\r
283 } else if (source === this.nucleotideMenuItem) {\r
284 this.nucleotideMenuItem_actionPerformed ();\r
285 } else if (source === this.userDefinedColour) {\r
286 this.userDefinedColour_actionPerformed ();\r
287 } else if (source === this.PIDColour) {\r
288 this.PIDColour_actionPerformed ();\r
289 } else if (source === this.BLOSUM62Colour) {\r
290 this.BLOSUM62Colour_actionPerformed ();\r
291 } else if (source === this.noColourmenuItem) {\r
292 this.noColourmenuItem_actionPerformed ();\r
293 } else if (source === this.conservationMenuItem) {\r
294 this.conservationMenuItem_itemStateChanged ();\r
295 } else if (source === this.unGroupMenuItem) {\r
296 this.unGroupMenuItem_actionPerformed ();\r
297 } else if (source === this.createGroupMenuItem) {\r
298 this.createGroupMenuItem_actionPerformed ();\r
299 } else if (source === this.sequenceName) {\r
300 this.editName ();\r
301 } else if (source === this.makeReferenceSeq) {\r
302 this.makeReferenceSeq_actionPerformed ();\r
303 } else if (source === this.sequenceDetails) {\r
304 this.showSequenceDetails ();\r
305 } else if (source === this.selSeqDetails) {\r
306 this.showSequenceSelectionDetails ();\r
307 } else if (source === this.pdb) {\r
308 this.addPDB ();\r
309 } else if (source === this.hideSeqs) {\r
310 this.hideSequences (false);\r
311 } else if (source === this.repGroup) {\r
312 this.hideSequences (true);\r
313 } else if (source === this.revealSeq) {\r
314 this.ap.av.showSequence (this.revealSeq_index);\r
315 } else if (source === this.revealAll) {\r
316 this.ap.av.showAllHiddenSeqs ();\r
317 } else if (source === this.editGroupName) {\r
318 var dialog =  new jalview.appletgui.EditNameDialog (this.getGroup ().getName (), this.getGroup ().getDescription (), "       Group Name", "Group Description", this.ap.alignFrame, "Edit Group Name / Description", 500, 100, true);\r
319 if (dialog.accept) {\r
320 this.getGroup ().setName (dialog.getName ().$replace (' ', '_'));\r
321 this.getGroup ().setDescription (dialog.getDescription ());\r
322 }} else if (source === this.copy) {\r
323 this.ap.alignFrame.copy_actionPerformed ();\r
324 } else if (source === this.cut) {\r
325 this.ap.alignFrame.cut_actionPerformed ();\r
326 } else if (source === this.editSequence) {\r
327 var sg = this.ap.av.getSelectionGroup ();\r
328 if (sg != null) {\r
329 if (this.seq == null) {\r
330 this.seq = sg.getSequenceAt (0);\r
331 }var dialog =  new jalview.appletgui.EditNameDialog (this.seq.getSequenceAsString (sg.getStartRes (), sg.getEndRes () + 1), null, "Edit Sequence ", null, this.ap.alignFrame, "Edit Sequence", 500, 100, true);\r
332 if (dialog.accept) {\r
333 var editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.edit_sequences"), jalview.commands.EditCommand.Action.REPLACE, dialog.getName ().$replace (' ', this.ap.av.getGapCharacter ()), sg.getSequencesAsArray (this.ap.av.getHiddenRepSequences ()), sg.getStartRes (), sg.getEndRes () + 1, this.ap.av.getAlignment ());\r
334 this.ap.alignFrame.addHistoryItem (editCommand);\r
335 this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());\r
336 }}} else if (source === this.toUpper || source === this.toLower || source === this.toggleCase) {\r
337 var sg = this.ap.av.getSelectionGroup ();\r
338 if (sg != null) {\r
339 var startEnd = this.ap.av.getVisibleRegionBoundaries (sg.getStartRes (), sg.getEndRes () + 1);\r
340 var description;\r
341 var caseChange;\r
342 if (source === this.toggleCase) {\r
343 description = "Toggle Case";\r
344 caseChange = jalview.commands.ChangeCaseCommand.TOGGLE_CASE;\r
345 } else if (source === this.toUpper) {\r
346 description = "To Upper Case";\r
347 caseChange = jalview.commands.ChangeCaseCommand.TO_UPPER;\r
348 } else {\r
349 description = "To Lower Case";\r
350 caseChange = jalview.commands.ChangeCaseCommand.TO_LOWER;\r
351 }var caseCommand =  new jalview.commands.ChangeCaseCommand (description, sg.getSequencesAsArray (this.ap.av.getHiddenRepSequences ()), startEnd, caseChange);\r
352 this.ap.alignFrame.addHistoryItem (caseCommand);\r
353 this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());\r
354 }} else if (source === this.sequenceFeature) {\r
355 var sg = this.ap.av.getSelectionGroup ();\r
356 if (sg == null) {\r
357 return;\r
358 }var rsize = 0;\r
359 var gSize = sg.getSize ();\r
360 var rseqs;\r
361 var seqs =  new Array (gSize);\r
362 var tfeatures;\r
363 var features =  new Array (gSize);\r
364 for (var i = 0; i < gSize; i++) {\r
365 var start = sg.getSequenceAt (i).findPosition (sg.getStartRes ());\r
366 var end = sg.findEndRes (sg.getSequenceAt (i));\r
367 if (start <= end) {\r
368 seqs[rsize] = sg.getSequenceAt (i);\r
369 features[rsize] =  new jalview.datamodel.SequenceFeature (null, null, null, start, end, "Jalview");\r
370 rsize++;\r
371 }}\r
372 rseqs =  new Array (rsize);\r
373 tfeatures =  new Array (rsize);\r
374 System.arraycopy (seqs, 0, rseqs, 0, rsize);\r
375 System.arraycopy (features, 0, tfeatures, 0, rsize);\r
376 features = tfeatures;\r
377 seqs = rseqs;\r
378 if (this.ap.seqPanel.seqCanvas.getFeatureRenderer ().amendFeatures (seqs, features, true, this.ap)) {\r
379 this.ap.alignFrame.sequenceFeatures.setState (true);\r
380 this.ap.av.setShowSequenceFeatures (true);\r
381 ;this.ap.highlightSearchResults (null);\r
382 }} else {\r
383 this.outputText (evt);\r
384 }}, "java.awt.event.ActionEvent");\r
385 Clazz.defineMethod (c$, "outputText", \r
386 function (e) {\r
387 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this.ap.alignFrame);\r
388 var frame =  new awt2swing.Frame ();\r
389 frame.add (cap);\r
390 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.selection_output_command",  Clazz.newArray (-1, [e.getActionCommand ()])), 600, 500);\r
391 cap.setText ( new jalview.io.AppletFormatAdapter ().formatSequences (e.getActionCommand (), this.ap.av.getShowJVSuffix (), this.ap, true));\r
392 }, "java.awt.event.ActionEvent");\r
393 Clazz.defineMethod (c$, "showSequenceSelectionDetails", \r
394 function () {\r
395 this.createSequenceDetailsReport (this.ap.av.getSequenceSelection ());\r
396 });\r
397 Clazz.defineMethod (c$, "showSequenceDetails", \r
398 function () {\r
399 this.createSequenceDetailsReport ( Clazz.newArray (-1, [this.seq]));\r
400 });\r
401 Clazz.defineMethod (c$, "createSequenceDetailsReport", \r
402 function (sequences) {\r
403 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this.ap.alignFrame);\r
404 var contents =  new StringBuffer ();\r
405 for (var seq, $seq = 0, $$seq = sequences; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {\r
406 contents.append (jalview.util.MessageManager.formatMessage ("label.annotation_for_displayid",  Clazz.newArray (-1, [seq.getDisplayId (true)])));\r
407  new jalview.io.SequenceAnnotationReport (null).createSequenceAnnotationReport (contents, seq, true, true, false, (this.ap.seqPanel.seqCanvas.fr != null) ? this.ap.seqPanel.seqCanvas.fr.getMinMax () : null);\r
408 contents.append ("</p>");\r
409 }\r
410 var frame =  new awt2swing.Frame ();\r
411 frame.add (cap);\r
412 jalview.bin.JalviewLite.addFrame (frame, "Sequence Details for " + (sequences.length == 1 ? sequences[0].getDisplayId (true) : "Selection"), 600, 500);\r
413 cap.setText (jalview.util.MessageManager.formatMessage ("label.html_content",  Clazz.newArray (-1, [contents.toString ()])));\r
414 }, "~A");\r
415 Clazz.defineMethod (c$, "editName", \r
416 function () {\r
417 var dialog =  new jalview.appletgui.EditNameDialog (this.seq.getName (), this.seq.getDescription (), "       Sequence Name", "Sequence Description", this.ap.alignFrame, "Edit Sequence Name / Description", 500, 100, true);\r
418 if (dialog.accept) {\r
419 this.seq.setName (dialog.getName ());\r
420 this.seq.setDescription (dialog.getDescription ());\r
421 this.ap.paintAlignment (false);\r
422 }});\r
423 Clazz.defineMethod (c$, "addPDB", \r
424 function () {\r
425 if (this.seq.getPDBId () != null) {\r
426 var entry = this.seq.getPDBId ().firstElement ();\r
427 if (this.ap.av.applet.jmolAvailable) {\r
428  new jalview.appletgui.AppletJmol (entry,  Clazz.newArray (-1, [this.seq]), null, this.ap, jalview.io.AppletFormatAdapter.URL);\r
429 }} else {\r
430 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this.ap.alignFrame);\r
431 cap.setText (jalview.util.MessageManager.getString ("label.paste_pdb_file"));\r
432 cap.setPDBImport (this.seq);\r
433 var frame =  new awt2swing.Frame ();\r
434 frame.add (cap);\r
435 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.paste_pdb_file_for_sequence",  Clazz.newArray (-1, [this.seq.getName ()])), 400, 300);\r
436 }});\r
437 Clazz.defineMethod (c$, "jbInit", \r
438 ($fz = function () {\r
439 this.groupMenu.setLabel (jalview.util.MessageManager.getString ("label.selection"));\r
440 this.sequenceFeature.addActionListener (this);\r
441 this.editGroupName.addActionListener (this);\r
442 this.unGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_group"));\r
443 this.unGroupMenuItem.addActionListener (this);\r
444 this.createGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.create_group"));\r
445 this.createGroupMenuItem.addActionListener (this);\r
446 this.nucleotideMenuItem.setLabel (jalview.util.MessageManager.getString ("label.nucleotide"));\r
447 this.nucleotideMenuItem.addActionListener (this);\r
448 this.conservationMenuItem.addItemListener (this);\r
449 this.abovePIDColour.addItemListener (this);\r
450 this.colourMenu.setLabel (jalview.util.MessageManager.getString ("label.group_colour"));\r
451 this.showBoxes.setLabel (jalview.util.MessageManager.getString ("action.boxes"));\r
452 this.showBoxes.setState (true);\r
453 this.showBoxes.addItemListener (this);\r
454 this.sequenceName.addActionListener (this);\r
455 this.sequenceDetails.addActionListener (this);\r
456 this.selSeqDetails.addActionListener (this);\r
457 this.displayNonconserved.setLabel (jalview.util.MessageManager.getString ("label.show_non_conversed"));\r
458 this.displayNonconserved.setState (false);\r
459 this.displayNonconserved.addItemListener (this);\r
460 this.showText.setLabel (jalview.util.MessageManager.getString ("action.text"));\r
461 this.showText.addItemListener (this);\r
462 this.showColourText.setLabel (jalview.util.MessageManager.getString ("label.colour_text"));\r
463 this.showColourText.addItemListener (this);\r
464 this.outputmenu.setLabel (jalview.util.MessageManager.getString ("label.out_to_textbox"));\r
465 this.seqMenu.setLabel (jalview.util.MessageManager.getString ("label.sequence"));\r
466 this.pdb.setLabel (jalview.util.MessageManager.getString ("label.view_pdb_structure"));\r
467 this.hideSeqs.setLabel (jalview.util.MessageManager.getString ("action.hide_sequences"));\r
468 this.repGroup.setLabel (jalview.util.MessageManager.formatMessage ("label.represent_group_with",  Clazz.newArray (-1, [""])));\r
469 this.revealAll.setLabel (jalview.util.MessageManager.getString ("action.reveal_all"));\r
470 this.revealSeq.setLabel (jalview.util.MessageManager.getString ("action.reveal_sequences"));\r
471 this.menu1.setLabel (jalview.util.MessageManager.getString ("label.group") + ":");\r
472 this.add (this.groupMenu);\r
473 this.add (this.seqMenu);\r
474 this.add (this.hideSeqs);\r
475 this.add (this.revealSeq);\r
476 this.add (this.revealAll);\r
477 this.groupMenu.add (this.groupShowAnnotationsMenu);\r
478 this.groupMenu.add (this.groupHideAnnotationsMenu);\r
479 this.groupMenu.add (this.groupAddReferenceAnnotations);\r
480 this.groupMenu.add (this.editMenu);\r
481 this.groupMenu.add (this.outputmenu);\r
482 this.groupMenu.add (this.sequenceFeature);\r
483 this.groupMenu.add (this.createGroupMenuItem);\r
484 this.groupMenu.add (this.unGroupMenuItem);\r
485 this.groupMenu.add (this.menu1);\r
486 this.colourMenu.add (this.noColourmenuItem);\r
487 this.colourMenu.add (this.clustalColour);\r
488 this.colourMenu.add (this.BLOSUM62Colour);\r
489 this.colourMenu.add (this.PIDColour);\r
490 this.colourMenu.add (this.zappoColour);\r
491 this.colourMenu.add (this.taylorColour);\r
492 this.colourMenu.add (this.hydrophobicityColour);\r
493 this.colourMenu.add (this.helixColour);\r
494 this.colourMenu.add (this.strandColour);\r
495 this.colourMenu.add (this.turnColour);\r
496 this.colourMenu.add (this.buriedColour);\r
497 this.colourMenu.add (this.nucleotideMenuItem);\r
498 this.colourMenu.add (this.userDefinedColour);\r
499 this.colourMenu.addSeparator ();\r
500 this.colourMenu.add (this.abovePIDColour);\r
501 this.colourMenu.add (this.conservationMenuItem);\r
502 this.noColourmenuItem.setLabel (jalview.util.MessageManager.getString ("label.none"));\r
503 this.noColourmenuItem.addActionListener (this);\r
504 this.clustalColour.setLabel (jalview.util.MessageManager.getString ("label.clustalx_colours"));\r
505 this.clustalColour.addActionListener (this);\r
506 this.zappoColour.setLabel (jalview.util.MessageManager.getString ("label.zappo"));\r
507 this.zappoColour.addActionListener (this);\r
508 this.taylorColour.setLabel (jalview.util.MessageManager.getString ("label.taylor"));\r
509 this.taylorColour.addActionListener (this);\r
510 this.hydrophobicityColour.setLabel (jalview.util.MessageManager.getString ("label.hydrophobicity"));\r
511 this.hydrophobicityColour.addActionListener (this);\r
512 this.helixColour.setLabel (jalview.util.MessageManager.getString ("label.helix_propensity"));\r
513 this.helixColour.addActionListener (this);\r
514 this.strandColour.setLabel (jalview.util.MessageManager.getString ("label.strand_propensity"));\r
515 this.strandColour.addActionListener (this);\r
516 this.turnColour.setLabel (jalview.util.MessageManager.getString ("label.turn_propensity"));\r
517 this.turnColour.addActionListener (this);\r
518 this.buriedColour.setLabel (jalview.util.MessageManager.getString ("label.buried_index"));\r
519 this.buriedColour.addActionListener (this);\r
520 this.abovePIDColour.setLabel (jalview.util.MessageManager.getString ("label.above_identity_percentage"));\r
521 this.userDefinedColour.setLabel (jalview.util.MessageManager.getString ("action.user_defined"));\r
522 this.userDefinedColour.addActionListener (this);\r
523 this.PIDColour.setLabel (jalview.util.MessageManager.getString ("action.percentage_identity"));\r
524 this.PIDColour.addActionListener (this);\r
525 this.BLOSUM62Colour.setLabel ("BLOSUM62");\r
526 this.BLOSUM62Colour.addActionListener (this);\r
527 this.conservationMenuItem.setLabel (jalview.util.MessageManager.getString ("label.conservation"));\r
528 this.editMenu.add (this.copy);\r
529 this.copy.addActionListener (this);\r
530 this.editMenu.add (this.cut);\r
531 this.cut.addActionListener (this);\r
532 this.editMenu.add (this.editSequence);\r
533 this.editSequence.addActionListener (this);\r
534 this.editMenu.add (this.toUpper);\r
535 this.toUpper.addActionListener (this);\r
536 this.editMenu.add (this.toLower);\r
537 this.toLower.addActionListener (this);\r
538 this.editMenu.add (this.toggleCase);\r
539 this.seqMenu.add (this.seqShowAnnotationsMenu);\r
540 this.seqMenu.add (this.seqHideAnnotationsMenu);\r
541 this.seqMenu.add (this.seqAddReferenceAnnotations);\r
542 this.seqMenu.add (this.sequenceName);\r
543 this.seqMenu.add (this.makeReferenceSeq);\r
544 if (!this.ap.av.applet.useXtrnalSviewer) {\r
545 this.seqMenu.add (this.pdb);\r
546 }this.seqMenu.add (this.repGroup);\r
547 this.menu1.add (this.editGroupName);\r
548 this.menu1.add (this.colourMenu);\r
549 this.menu1.add (this.showBoxes);\r
550 this.menu1.add (this.showText);\r
551 this.menu1.add (this.showColourText);\r
552 this.menu1.add (this.displayNonconserved);\r
553 this.toggleCase.addActionListener (this);\r
554 this.pdb.addActionListener (this);\r
555 this.hideSeqs.addActionListener (this);\r
556 this.repGroup.addActionListener (this);\r
557 this.revealAll.addActionListener (this);\r
558 this.revealSeq.addActionListener (this);\r
559 this.makeReferenceSeq.addActionListener (this);\r
560 }, $fz.isPrivate = true, $fz));\r
561 Clazz.defineMethod (c$, "refresh", \r
562 function () {\r
563 this.ap.paintAlignment (true);\r
564 });\r
565 Clazz.defineMethod (c$, "clustalColour_actionPerformed", \r
566 function () {\r
567 var sg = this.getGroup ();\r
568 sg.cs =  new jalview.schemes.ClustalxColourScheme (sg, this.ap.av.getHiddenRepSequences ());\r
569 this.refresh ();\r
570 });\r
571 Clazz.defineMethod (c$, "zappoColour_actionPerformed", \r
572 function () {\r
573 this.getGroup ().cs =  new jalview.schemes.ZappoColourScheme ();\r
574 this.refresh ();\r
575 });\r
576 Clazz.defineMethod (c$, "taylorColour_actionPerformed", \r
577 function () {\r
578 this.getGroup ().cs =  new jalview.schemes.TaylorColourScheme ();\r
579 this.refresh ();\r
580 });\r
581 Clazz.defineMethod (c$, "hydrophobicityColour_actionPerformed", \r
582 function () {\r
583 this.getGroup ().cs =  new jalview.schemes.HydrophobicColourScheme ();\r
584 this.refresh ();\r
585 });\r
586 Clazz.defineMethod (c$, "helixColour_actionPerformed", \r
587 function () {\r
588 this.getGroup ().cs =  new jalview.schemes.HelixColourScheme ();\r
589 this.refresh ();\r
590 });\r
591 Clazz.defineMethod (c$, "strandColour_actionPerformed", \r
592 function () {\r
593 this.getGroup ().cs =  new jalview.schemes.StrandColourScheme ();\r
594 this.refresh ();\r
595 });\r
596 Clazz.defineMethod (c$, "turnColour_actionPerformed", \r
597 function () {\r
598 this.getGroup ().cs =  new jalview.schemes.TurnColourScheme ();\r
599 this.refresh ();\r
600 });\r
601 Clazz.defineMethod (c$, "buriedColour_actionPerformed", \r
602 function () {\r
603 this.getGroup ().cs =  new jalview.schemes.BuriedColourScheme ();\r
604 this.refresh ();\r
605 });\r
606 Clazz.defineMethod (c$, "nucleotideMenuItem_actionPerformed", \r
607 function () {\r
608 this.getGroup ().cs =  new jalview.schemes.NucleotideColourScheme ();\r
609 this.refresh ();\r
610 });\r
611 Clazz.defineMethod (c$, "abovePIDColour_itemStateChanged", \r
612 function () {\r
613 var sg = this.getGroup ();\r
614 if (sg.cs == null) {\r
615 return;\r
616 }if (this.abovePIDColour.getState ()) {\r
617 sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));\r
618 var threshold = jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, sg.cs, this.getGroup ().getName ());\r
619 sg.cs.setThreshold (threshold, this.ap.av.isIgnoreGapsConsensus ());\r
620 jalview.appletgui.SliderPanel.showPIDSlider ();\r
621 } else {\r
622 sg.cs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());\r
623 }this.refresh ();\r
624 });\r
625 Clazz.defineMethod (c$, "userDefinedColour_actionPerformed", \r
626 function () {\r
627  new jalview.appletgui.UserDefinedColours (this.ap, this.getGroup ());\r
628 });\r
629 Clazz.defineMethod (c$, "PIDColour_actionPerformed", \r
630 function () {\r
631 var sg = this.getGroup ();\r
632 sg.cs =  new jalview.schemes.PIDColourScheme ();\r
633 sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));\r
634 this.refresh ();\r
635 });\r
636 Clazz.defineMethod (c$, "BLOSUM62Colour_actionPerformed", \r
637 function () {\r
638 var sg = this.getGroup ();\r
639 sg.cs =  new jalview.schemes.Blosum62ColourScheme ();\r
640 sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));\r
641 this.refresh ();\r
642 });\r
643 Clazz.defineMethod (c$, "noColourmenuItem_actionPerformed", \r
644 function () {\r
645 this.getGroup ().cs = null;\r
646 this.refresh ();\r
647 });\r
648 Clazz.defineMethod (c$, "conservationMenuItem_itemStateChanged", \r
649 function () {\r
650 var sg = this.getGroup ();\r
651 if (sg.cs == null) {\r
652 return;\r
653 }if (this.conservationMenuItem.getState ()) {\r
654 sg.cs.setConservation (jalview.analysis.Conservation.calculateConservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth (), false, this.ap.av.getConsPercGaps (), false));\r
655 jalview.appletgui.SliderPanel.setConservationSlider (this.ap, sg.cs, sg.getName ());\r
656 jalview.appletgui.SliderPanel.showConservationSlider ();\r
657 } else {\r
658 sg.cs.setConservation (null);\r
659 }this.refresh ();\r
660 });\r
661 Clazz.defineMethod (c$, "getGroup", \r
662 function () {\r
663 var sg = this.ap.av.getSelectionGroup ();\r
664 if (sg != null) {\r
665 this.ap.av.getAlignment ().addGroup (sg);\r
666 }return sg;\r
667 });\r
668 Clazz.defineMethod (c$, "unGroupMenuItem_actionPerformed", \r
669 function () {\r
670 var sg = this.ap.av.getSelectionGroup ();\r
671 this.ap.av.getAlignment ().deleteGroup (sg);\r
672 this.ap.av.setSelectionGroup (null);\r
673 this.ap.paintAlignment (true);\r
674 });\r
675 Clazz.defineMethod (c$, "createGroupMenuItem_actionPerformed", \r
676 function () {\r
677 this.getGroup ();\r
678 this.refresh ();\r
679 });\r
680 Clazz.defineMethod (c$, "showColourText_itemStateChanged", \r
681 function () {\r
682 this.getGroup ().setColourText (this.showColourText.getState ());\r
683 this.refresh ();\r
684 });\r
685 Clazz.defineMethod (c$, "showText_itemStateChanged", \r
686 function () {\r
687 this.getGroup ().setDisplayText (this.showText.getState ());\r
688 this.refresh ();\r
689 });\r
690 Clazz.defineMethod (c$, "makeReferenceSeq_actionPerformed", \r
691 function () {\r
692 if (!this.ap.av.getAlignment ().hasSeqrep ()) {\r
693 this.ap.av.setDisplayReferenceSeq (true);\r
694 this.ap.av.setColourByReferenceSeq (true);\r
695 this.ap.av.getAlignment ().setSeqrep (this.seq);\r
696 } else {\r
697 if (this.ap.av.getAlignment ().getSeqrep () === this.seq) {\r
698 this.ap.av.getAlignment ().setSeqrep (null);\r
699 } else {\r
700 this.ap.av.getAlignment ().setSeqrep (this.seq);\r
701 }}this.refresh ();\r
702 });\r
703 Clazz.defineMethod (c$, "showNonconserved_itemStateChanged", \r
704 function () {\r
705 this.getGroup ().setShowNonconserved (this.displayNonconserved.getState ());\r
706 this.refresh ();\r
707 });\r
708 Clazz.defineMethod (c$, "showBoxes_itemStateChanged", \r
709 function () {\r
710 this.getGroup ().setDisplayBoxes (this.showBoxes.getState ());\r
711 this.refresh ();\r
712 });\r
713 Clazz.defineMethod (c$, "hideSequences", \r
714 function (representGroup) {\r
715 var sg = this.ap.av.getSelectionGroup ();\r
716 if (sg == null || sg.getSize () < 1) {\r
717 this.ap.av.hideSequence ( Clazz.newArray (-1, [this.seq]));\r
718 return;\r
719 }this.ap.av.setSelectionGroup (null);\r
720 if (representGroup) {\r
721 this.ap.av.hideRepSequences (this.seq, sg);\r
722 return;\r
723 }var gsize = sg.getSize ();\r
724 var hseqs;\r
725 hseqs =  new Array (gsize);\r
726 var index = 0;\r
727 for (var i = 0; i < gsize; i++) {\r
728 hseqs[index++] = sg.getSequenceAt (i);\r
729 }\r
730 this.ap.av.hideSequence (hseqs);\r
731 this.ap.av.sendSelection ();\r
732 }, "~B");\r
733 Clazz.defineMethod (c$, "buildAnnotationTypesMenus", \r
734 function (showMenu, hideMenu, forSequences) {\r
735 showMenu.removeAll ();\r
736 hideMenu.removeAll ();\r
737 var all = java.util.Arrays.asList (["All"]);\r
738 this.addAnnotationTypeToShowHide (showMenu, forSequences, "", all, true, true);\r
739 this.addAnnotationTypeToShowHide (hideMenu, forSequences, "", all, true, false);\r
740 showMenu.addSeparator ();\r
741 hideMenu.addSeparator ();\r
742 var annotations = this.ap.getAlignment ().getAlignmentAnnotation ();\r
743 var shownTypes =  new java.util.LinkedHashMap ();\r
744 var hiddenTypes =  new java.util.LinkedHashMap ();\r
745 jalview.analysis.AlignmentAnnotationUtils.getShownHiddenTypes (shownTypes, hiddenTypes, jalview.analysis.AlignmentAnnotationUtils.asList (annotations), forSequences);\r
746 for (var calcId, $calcId = hiddenTypes.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {\r
747 for (var type, $type = hiddenTypes.get (calcId).iterator (); $type.hasNext () && ((type = $type.next ()) || true);) {\r
748 this.addAnnotationTypeToShowHide (showMenu, forSequences, calcId, type, false, true);\r
749 }\r
750 }\r
751 showMenu.setEnabled (!hiddenTypes.isEmpty ());\r
752 for (var calcId, $calcId = shownTypes.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {\r
753 for (var type, $type = shownTypes.get (calcId).iterator (); $type.hasNext () && ((type = $type.next ()) || true);) {\r
754 this.addAnnotationTypeToShowHide (hideMenu, forSequences, calcId, type, false, false);\r
755 }\r
756 }\r
757 hideMenu.setEnabled (!shownTypes.isEmpty ());\r
758 }, "awt2swing.Menu,awt2swing.Menu,java.util.List");\r
759 Clazz.defineMethod (c$, "addAnnotationTypeToShowHide", \r
760 function (showOrHideMenu, forSequences, calcId, types, allTypes, actionIsShow) {\r
761 var label = types.toString ();\r
762 label = label.substring (1, label.length - 1);\r
763 var item =  new awt2swing.MenuItem (label);\r
764 item.addActionListener (((Clazz.isClassDefined ("jalview.appletgui.APopupMenu$3") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$3$ ()), Clazz.innerTypeInstance (jalview.appletgui.APopupMenu$3, this, Clazz.cloneFinals ("types", types, "forSequences", forSequences, "allTypes", allTypes, "actionIsShow", actionIsShow))));\r
765 showOrHideMenu.add (item);\r
766 }, "awt2swing.Menu,java.util.List,~S,java.util.List,~B,~B");\r
767 c$.$APopupMenu$1$ = function () {\r
768 Clazz.pu$h ();\r
769 c$ = Clazz.declareAnonymous (jalview.appletgui, "APopupMenu$1", null, java.awt.event.ActionListener);\r
770 Clazz.overrideMethod (c$, "actionPerformed", \r
771 function (e) {\r
772 this.b$["jalview.appletgui.APopupMenu"].addReferenceAnnotations_actionPerformed (this.f$.candidates);\r
773 }, "java.awt.event.ActionEvent");\r
774 c$ = Clazz.p0p ();\r
775 };\r
776 c$.$APopupMenu$2$ = function () {\r
777 Clazz.pu$h ();\r
778 c$ = Clazz.declareAnonymous (jalview.appletgui, "APopupMenu$2", null, java.awt.event.ActionListener);\r
779 Clazz.overrideMethod (c$, "actionPerformed", \r
780 function (e) {\r
781 this.b$["jalview.appletgui.APopupMenu"].ap.alignFrame.showURL (this.f$.url, this.f$.target);\r
782 }, "java.awt.event.ActionEvent");\r
783 c$ = Clazz.p0p ();\r
784 };\r
785 c$.$APopupMenu$3$ = function () {\r
786 Clazz.pu$h ();\r
787 c$ = Clazz.declareAnonymous (jalview.appletgui, "APopupMenu$3", null, java.awt.event.ActionListener);\r
788 Clazz.overrideMethod (c$, "actionPerformed", \r
789 function (e) {\r
790 jalview.analysis.AlignmentUtils.showOrHideSequenceAnnotations (this.b$["jalview.appletgui.APopupMenu"].ap.getAlignment (), this.f$.types, this.f$.forSequences, this.f$.allTypes, this.f$.actionIsShow);\r
791 this.b$["jalview.appletgui.APopupMenu"].refresh ();\r
792 }, "java.awt.event.ActionEvent");\r
793 c$ = Clazz.p0p ();\r
794 };\r
795 Clazz.defineStatics (c$,\r
796 "ALL_ANNOTATIONS", "All");\r
797 });\r