JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / jalview / viewmodel / AlignmentViewport.js
1 Clazz.declarePackage ("jalview.viewmodel");\r
2 Clazz.load (["jalview.api.AlignViewportI", "jalview.structure.CommandListener", "$.VamsasSource", "jalview.datamodel.ColumnSelection", "jalview.viewmodel.styles.ViewStyle", "jalview.workers.AlignCalcManager", "java.beans.PropertyChangeSupport", "java.util.ArrayDeque", "$.HashMap"], "jalview.viewmodel.AlignmentViewport", ["jalview.analysis.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.AlignmentView", "$.CigarArray", "$.Sequence", "$.SequenceGroup", "jalview.schemes.Blosum62ColourScheme", "$.PIDColourScheme", "$.ResidueProperties", "jalview.util.Comparison", "$.MappingUtils", "jalview.workers.ComplementConsensusThread", "$.ConsensusThread", "$.ConservationThread", "$.StrucConsensusThread", "java.awt.Color", "java.util.ArrayList", "$.BitSet", "$.Hashtable"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.viewStyle = null;\r
5 this.codingComplement = null;\r
6 this.featuresDisplayed = null;\r
7 this.historyList = null;\r
8 this.redoList = null;\r
9 this.alignment = null;\r
10 this.sequenceSetID = null;\r
11 this.$isDataset = false;\r
12 this.hiddenRepSequences = null;\r
13 this.colSel = null;\r
14 this.autoCalculateConsensus = true;\r
15 this.autoCalculateStrucConsensus = true;\r
16 this.ignoreGapsInConsensusCalculation = false;\r
17 this.globalColourScheme = null;\r
18 this.consensus = null;\r
19 this.complementConsensus = null;\r
20 this.strucConsensus = null;\r
21 this.conservation = null;\r
22 this.quality = null;\r
23 this.groupConsensus = null;\r
24 this.groupConservation = null;\r
25 this.hconsensus = null;\r
26 this.hcomplementConsensus = null;\r
27 this.hStrucConsensus = null;\r
28 this.hconservation = null;\r
29 this.ConsPercGaps = 25;\r
30 this.calculator = null;\r
31 this.showGroupConservation = false;\r
32 this.showGroupConsensus = false;\r
33 this.showSequenceLogo = false;\r
34 this.normaliseSequenceLogo = false;\r
35 this.showConsensusHistogram = true;\r
36 this.padGaps = false;\r
37 this.sortByTree = false;\r
38 this.selectionGroup = null;\r
39 this.viewId = null;\r
40 this.sgrouphash = -1;\r
41 this.colselhash = -1;\r
42 this.changeSupport = null;\r
43 this.showConservation = true;\r
44 this.showQuality = true;\r
45 this.showConsensus = true;\r
46 this.sequenceColours = null;\r
47 this.sortAnnotationsBy = null;\r
48 this.showAutocalculatedAbove = false;\r
49 this.followHighlight = true;\r
50 this.startRes = 0;\r
51 this.endRes = 0;\r
52 this.startSeq = 0;\r
53 this.endSeq = 0;\r
54 Clazz.instantialize (this, arguments);\r
55 }, jalview.viewmodel, "AlignmentViewport", null, [jalview.api.AlignViewportI, jalview.structure.CommandListener, jalview.structure.VamsasSource]);\r
56 Clazz.prepareFields (c$, function () {\r
57 this.viewStyle =  new jalview.viewmodel.styles.ViewStyle ();\r
58 this.historyList =  new java.util.ArrayDeque ();\r
59 this.redoList =  new java.util.ArrayDeque ();\r
60 this.colSel =  new jalview.datamodel.ColumnSelection ();\r
61 this.calculator =  new jalview.workers.AlignCalcManager ();\r
62 this.changeSupport =  new java.beans.PropertyChangeSupport (this);\r
63 this.sequenceColours =  new java.util.HashMap ();\r
64 });\r
65 Clazz.defineMethod (c$, "setFontName", \r
66 function (name) {\r
67 this.viewStyle.setFontName (name);\r
68 }, "~S");\r
69 Clazz.defineMethod (c$, "setFontStyle", \r
70 function (style) {\r
71 this.viewStyle.setFontStyle (style);\r
72 }, "~N");\r
73 Clazz.defineMethod (c$, "setFontSize", \r
74 function (size) {\r
75 this.viewStyle.setFontSize (size);\r
76 }, "~N");\r
77 Clazz.defineMethod (c$, "getFontStyle", \r
78 function () {\r
79 return this.viewStyle.getFontStyle ();\r
80 });\r
81 Clazz.defineMethod (c$, "getFontName", \r
82 function () {\r
83 return this.viewStyle.getFontName ();\r
84 });\r
85 Clazz.defineMethod (c$, "getFontSize", \r
86 function () {\r
87 return this.viewStyle.getFontSize ();\r
88 });\r
89 Clazz.defineMethod (c$, "setUpperCasebold", \r
90 function (upperCasebold) {\r
91 this.viewStyle.setUpperCasebold (upperCasebold);\r
92 }, "~B");\r
93 Clazz.defineMethod (c$, "isUpperCasebold", \r
94 function () {\r
95 return this.viewStyle.isUpperCasebold ();\r
96 });\r
97 Clazz.defineMethod (c$, "isSeqNameItalics", \r
98 function () {\r
99 return this.viewStyle.isSeqNameItalics ();\r
100 });\r
101 Clazz.defineMethod (c$, "setColourByReferenceSeq", \r
102 function (colourByReferenceSeq) {\r
103 this.viewStyle.setColourByReferenceSeq (colourByReferenceSeq);\r
104 }, "~B");\r
105 Clazz.defineMethod (c$, "setColourAppliesToAllGroups", \r
106 function (b) {\r
107 this.viewStyle.setColourAppliesToAllGroups (b);\r
108 }, "~B");\r
109 Clazz.defineMethod (c$, "getColourAppliesToAllGroups", \r
110 function () {\r
111 return this.viewStyle.getColourAppliesToAllGroups ();\r
112 });\r
113 Clazz.defineMethod (c$, "getAbovePIDThreshold", \r
114 function () {\r
115 return this.viewStyle.getAbovePIDThreshold ();\r
116 });\r
117 Clazz.defineMethod (c$, "setIncrement", \r
118 function (inc) {\r
119 this.viewStyle.setIncrement (inc);\r
120 }, "~N");\r
121 Clazz.defineMethod (c$, "getIncrement", \r
122 function () {\r
123 return this.viewStyle.getIncrement ();\r
124 });\r
125 Clazz.defineMethod (c$, "setConservationSelected", \r
126 function (b) {\r
127 this.viewStyle.setConservationSelected (b);\r
128 }, "~B");\r
129 Clazz.defineMethod (c$, "setShowHiddenMarkers", \r
130 function (show) {\r
131 this.viewStyle.setShowHiddenMarkers (show);\r
132 }, "~B");\r
133 Clazz.defineMethod (c$, "getShowHiddenMarkers", \r
134 function () {\r
135 return this.viewStyle.getShowHiddenMarkers ();\r
136 });\r
137 Clazz.defineMethod (c$, "setScaleRightWrapped", \r
138 function (b) {\r
139 this.viewStyle.setScaleRightWrapped (b);\r
140 }, "~B");\r
141 Clazz.defineMethod (c$, "setScaleLeftWrapped", \r
142 function (b) {\r
143 this.viewStyle.setScaleLeftWrapped (b);\r
144 }, "~B");\r
145 Clazz.defineMethod (c$, "setScaleAboveWrapped", \r
146 function (b) {\r
147 this.viewStyle.setScaleAboveWrapped (b);\r
148 }, "~B");\r
149 Clazz.defineMethod (c$, "getScaleLeftWrapped", \r
150 function () {\r
151 return this.viewStyle.getScaleLeftWrapped ();\r
152 });\r
153 Clazz.defineMethod (c$, "getScaleAboveWrapped", \r
154 function () {\r
155 return this.viewStyle.getScaleAboveWrapped ();\r
156 });\r
157 Clazz.defineMethod (c$, "getScaleRightWrapped", \r
158 function () {\r
159 return this.viewStyle.getScaleRightWrapped ();\r
160 });\r
161 Clazz.defineMethod (c$, "setAbovePIDThreshold", \r
162 function (b) {\r
163 this.viewStyle.setAbovePIDThreshold (b);\r
164 }, "~B");\r
165 Clazz.defineMethod (c$, "setThreshold", \r
166 function (thresh) {\r
167 this.viewStyle.setThreshold (thresh);\r
168 }, "~N");\r
169 Clazz.defineMethod (c$, "getThreshold", \r
170 function () {\r
171 return this.viewStyle.getThreshold ();\r
172 });\r
173 Clazz.defineMethod (c$, "getShowJVSuffix", \r
174 function () {\r
175 return this.viewStyle.getShowJVSuffix ();\r
176 });\r
177 Clazz.defineMethod (c$, "setShowJVSuffix", \r
178 function (b) {\r
179 this.viewStyle.setShowJVSuffix (b);\r
180 }, "~B");\r
181 Clazz.defineMethod (c$, "setWrapAlignment", \r
182 function (state) {\r
183 this.viewStyle.setWrapAlignment (state);\r
184 }, "~B");\r
185 Clazz.defineMethod (c$, "setShowText", \r
186 function (state) {\r
187 this.viewStyle.setShowText (state);\r
188 }, "~B");\r
189 Clazz.defineMethod (c$, "setRenderGaps", \r
190 function (state) {\r
191 this.viewStyle.setRenderGaps (state);\r
192 }, "~B");\r
193 Clazz.defineMethod (c$, "getColourText", \r
194 function () {\r
195 return this.viewStyle.getColourText ();\r
196 });\r
197 Clazz.defineMethod (c$, "setColourText", \r
198 function (state) {\r
199 this.viewStyle.setColourText (state);\r
200 }, "~B");\r
201 Clazz.defineMethod (c$, "getWrapAlignment", \r
202 function () {\r
203 return this.viewStyle.getWrapAlignment ();\r
204 });\r
205 Clazz.defineMethod (c$, "getShowText", \r
206 function () {\r
207 return this.viewStyle.getShowText ();\r
208 });\r
209 Clazz.defineMethod (c$, "getWrappedWidth", \r
210 function () {\r
211 return this.viewStyle.getWrappedWidth ();\r
212 });\r
213 Clazz.defineMethod (c$, "setWrappedWidth", \r
214 function (w) {\r
215 this.viewStyle.setWrappedWidth (w);\r
216 }, "~N");\r
217 Clazz.defineMethod (c$, "getCharHeight", \r
218 function () {\r
219 return this.viewStyle.getCharHeight ();\r
220 });\r
221 Clazz.defineMethod (c$, "setCharHeight", \r
222 function (h) {\r
223 this.viewStyle.setCharHeight (h);\r
224 }, "~N");\r
225 Clazz.defineMethod (c$, "getCharWidth", \r
226 function () {\r
227 return this.viewStyle.getCharWidth ();\r
228 });\r
229 Clazz.defineMethod (c$, "setCharWidth", \r
230 function (w) {\r
231 this.viewStyle.setCharWidth (w);\r
232 }, "~N");\r
233 Clazz.defineMethod (c$, "getShowBoxes", \r
234 function () {\r
235 return this.viewStyle.getShowBoxes ();\r
236 });\r
237 Clazz.defineMethod (c$, "getShowUnconserved", \r
238 function () {\r
239 return this.viewStyle.getShowUnconserved ();\r
240 });\r
241 Clazz.defineMethod (c$, "setShowUnconserved", \r
242 function (showunconserved) {\r
243 this.viewStyle.setShowUnconserved (showunconserved);\r
244 }, "~B");\r
245 Clazz.defineMethod (c$, "setSeqNameItalics", \r
246 function (default1) {\r
247 this.viewStyle.setSeqNameItalics (default1);\r
248 }, "~B");\r
249 Clazz.defineMethod (c$, "getAlignment", \r
250 function () {\r
251 return this.alignment;\r
252 });\r
253 Clazz.overrideMethod (c$, "getGapCharacter", \r
254 function () {\r
255 return this.alignment.getGapCharacter ();\r
256 });\r
257 Clazz.defineMethod (c$, "setDataset", \r
258 function (b) {\r
259 this.$isDataset = b;\r
260 }, "~B");\r
261 Clazz.defineMethod (c$, "isDataset", \r
262 function () {\r
263 return this.$isDataset;\r
264 });\r
265 Clazz.overrideMethod (c$, "setGlobalColourScheme", \r
266 function (cs) {\r
267 this.globalColourScheme = cs;\r
268 var recalc = false;\r
269 if (cs != null) {\r
270 cs.setConservationApplied (recalc = this.getConservationSelected ());\r
271 if (this.getAbovePIDThreshold () || Clazz.instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz.instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {\r
272 recalc = true;\r
273 cs.setThreshold (this.viewStyle.getThreshold (), this.ignoreGapsInConsensusCalculation);\r
274 } else {\r
275 cs.setThreshold (0, this.ignoreGapsInConsensusCalculation);\r
276 }if (recalc) {\r
277 cs.setConsensus (this.hconsensus);\r
278 cs.setConservation (this.hconservation);\r
279 }cs.alignmentChanged (this.alignment, this.hiddenRepSequences);\r
280 }if (this.getColourAppliesToAllGroups ()) {\r
281 for (var sg, $sg = this.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {\r
282 if (cs == null) {\r
283 sg.cs = null;\r
284 continue;\r
285 }sg.cs = cs.applyTo (sg, this.getHiddenRepSequences ());\r
286 sg.setConsPercGaps (this.ConsPercGaps);\r
287 if (this.getAbovePIDThreshold () || Clazz.instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz.instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {\r
288 sg.cs.setThreshold (this.viewStyle.getThreshold (), this.isIgnoreGapsConsensus ());\r
289 recalc = true;\r
290 } else {\r
291 sg.cs.setThreshold (0, this.isIgnoreGapsConsensus ());\r
292 }if (this.getConservationSelected ()) {\r
293 sg.cs.setConservationApplied (true);\r
294 recalc = true;\r
295 } else {\r
296 sg.cs.setConservation (null);\r
297 }if (recalc) {\r
298 sg.recalcConservation ();\r
299 } else {\r
300 sg.cs.alignmentChanged (sg, this.hiddenRepSequences);\r
301 }}\r
302 }}, "jalview.schemes.ColourSchemeI");\r
303 Clazz.overrideMethod (c$, "getGlobalColourScheme", \r
304 function () {\r
305 return this.globalColourScheme;\r
306 });\r
307 Clazz.overrideMethod (c$, "setConservation", \r
308 function (cons) {\r
309 this.hconservation = cons;\r
310 }, "jalview.analysis.Conservation");\r
311 Clazz.overrideMethod (c$, "getConsPercGaps", \r
312 function () {\r
313 return this.ConsPercGaps;\r
314 });\r
315 Clazz.overrideMethod (c$, "setSequenceConsensusHash", \r
316 function (hconsensus) {\r
317 this.hconsensus = hconsensus;\r
318 }, "~A");\r
319 Clazz.overrideMethod (c$, "setComplementConsensusHash", \r
320 function (hconsensus) {\r
321 this.hcomplementConsensus = hconsensus;\r
322 }, "~A");\r
323 Clazz.overrideMethod (c$, "getSequenceConsensusHash", \r
324 function () {\r
325 return this.hconsensus;\r
326 });\r
327 Clazz.overrideMethod (c$, "getComplementConsensusHash", \r
328 function () {\r
329 return this.hcomplementConsensus;\r
330 });\r
331 Clazz.overrideMethod (c$, "getRnaStructureConsensusHash", \r
332 function () {\r
333 return this.hStrucConsensus;\r
334 });\r
335 Clazz.overrideMethod (c$, "setRnaStructureConsensusHash", \r
336 function (hStrucConsensus) {\r
337 this.hStrucConsensus = hStrucConsensus;\r
338 }, "~A");\r
339 Clazz.overrideMethod (c$, "getAlignmentQualityAnnot", \r
340 function () {\r
341 return this.quality;\r
342 });\r
343 Clazz.overrideMethod (c$, "getAlignmentConservationAnnotation", \r
344 function () {\r
345 return this.conservation;\r
346 });\r
347 Clazz.overrideMethod (c$, "getAlignmentConsensusAnnotation", \r
348 function () {\r
349 return this.consensus;\r
350 });\r
351 Clazz.overrideMethod (c$, "getComplementConsensusAnnotation", \r
352 function () {\r
353 return this.complementConsensus;\r
354 });\r
355 Clazz.overrideMethod (c$, "getAlignmentStrucConsensusAnnotation", \r
356 function () {\r
357 return this.strucConsensus;\r
358 });\r
359 Clazz.defineMethod (c$, "updateConservation", \r
360 function (ap) {\r
361 if (this.alignment.isNucleotide () || this.conservation == null || !this.autoCalculateConsensus) {\r
362 return;\r
363 }if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConservationThread) == null) {\r
364 this.calculator.registerWorker ( new jalview.workers.ConservationThread (this, ap));\r
365 }}, "jalview.api.AlignmentViewPanel");\r
366 Clazz.defineMethod (c$, "updateConsensus", \r
367 function (ap) {\r
368 if (this.consensus == null || !this.autoCalculateConsensus) {\r
369 return;\r
370 }if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConsensusThread) == null) {\r
371 this.calculator.registerWorker ( new jalview.workers.ConsensusThread (this, ap));\r
372 }var al = this.getAlignment ();\r
373 if (!al.isNucleotide () && al.getCodonFrames () != null && !al.getCodonFrames ().isEmpty ()) {\r
374 if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ComplementConsensusThread) == null) {\r
375 this.calculator.registerWorker ( new jalview.workers.ComplementConsensusThread (this, ap));\r
376 }}}, "jalview.api.AlignmentViewPanel");\r
377 Clazz.defineMethod (c$, "updateStrucConsensus", \r
378 function (ap) {\r
379 if (this.autoCalculateStrucConsensus && this.strucConsensus == null && this.alignment.isNucleotide () && this.alignment.hasRNAStructure ()) {\r
380 this.initRNAStructure ();\r
381 }if (this.strucConsensus == null || !this.autoCalculateStrucConsensus) {\r
382 return;\r
383 }if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.StrucConsensusThread) == null) {\r
384 this.calculator.registerWorker ( new jalview.workers.StrucConsensusThread (this, ap));\r
385 }}, "jalview.api.AlignmentViewPanel");\r
386 Clazz.defineMethod (c$, "isCalcInProgress", \r
387 function () {\r
388 return this.calculator.isWorking ();\r
389 });\r
390 Clazz.overrideMethod (c$, "isCalculationInProgress", \r
391 function (alignmentAnnotation) {\r
392 if (!alignmentAnnotation.autoCalculated) {\r
393 return false;\r
394 }if (this.calculator.workingInvolvedWith (alignmentAnnotation)) {\r
395 return true;\r
396 }return false;\r
397 }, "jalview.datamodel.AlignmentAnnotation");\r
398 Clazz.overrideMethod (c$, "isClosed", \r
399 function () {\r
400 return this.alignment == null;\r
401 });\r
402 Clazz.overrideMethod (c$, "getCalcManager", \r
403 function () {\r
404 return this.calculator;\r
405 });\r
406 Clazz.overrideMethod (c$, "isShowSequenceLogo", \r
407 function () {\r
408 return this.showSequenceLogo;\r
409 });\r
410 Clazz.defineMethod (c$, "setShowSequenceLogo", \r
411 function (showSequenceLogo) {\r
412 if (showSequenceLogo != this.showSequenceLogo) {\r
413 this.showSequenceLogo = showSequenceLogo;\r
414 this.calculator.updateAnnotationFor (jalview.workers.ConsensusThread);\r
415 this.calculator.updateAnnotationFor (jalview.workers.ComplementConsensusThread);\r
416 this.calculator.updateAnnotationFor (jalview.workers.StrucConsensusThread);\r
417 }this.showSequenceLogo = showSequenceLogo;\r
418 }, "~B");\r
419 Clazz.defineMethod (c$, "setShowConsensusHistogram", \r
420 function (showConsensusHistogram) {\r
421 this.showConsensusHistogram = showConsensusHistogram;\r
422 }, "~B");\r
423 Clazz.defineMethod (c$, "isShowGroupConservation", \r
424 function () {\r
425 return this.showGroupConservation;\r
426 });\r
427 Clazz.defineMethod (c$, "setShowGroupConservation", \r
428 function (showGroupConservation) {\r
429 this.showGroupConservation = showGroupConservation;\r
430 }, "~B");\r
431 Clazz.defineMethod (c$, "isShowGroupConsensus", \r
432 function () {\r
433 return this.showGroupConsensus;\r
434 });\r
435 Clazz.defineMethod (c$, "setShowGroupConsensus", \r
436 function (showGroupConsensus) {\r
437 this.showGroupConsensus = showGroupConsensus;\r
438 }, "~B");\r
439 Clazz.overrideMethod (c$, "isShowConsensusHistogram", \r
440 function () {\r
441 return this.showConsensusHistogram;\r
442 });\r
443 Clazz.overrideMethod (c$, "getSelectionGroup", \r
444 function () {\r
445 return this.selectionGroup;\r
446 });\r
447 Clazz.overrideMethod (c$, "setSelectionGroup", \r
448 function (sg) {\r
449 this.selectionGroup = sg;\r
450 }, "jalview.datamodel.SequenceGroup");\r
451 Clazz.defineMethod (c$, "setHiddenColumns", \r
452 function (colsel) {\r
453 this.colSel = colsel;\r
454 }, "jalview.datamodel.ColumnSelection");\r
455 Clazz.overrideMethod (c$, "getColumnSelection", \r
456 function () {\r
457 return this.colSel;\r
458 });\r
459 Clazz.overrideMethod (c$, "setColumnSelection", \r
460 function (colSel) {\r
461 this.colSel = colSel;\r
462 if (colSel != null) {\r
463 this.updateHiddenColumns ();\r
464 }}, "jalview.datamodel.ColumnSelection");\r
465 Clazz.overrideMethod (c$, "getHiddenRepSequences", \r
466 function () {\r
467 return this.hiddenRepSequences;\r
468 });\r
469 Clazz.overrideMethod (c$, "setHiddenRepSequences", \r
470 function (hiddenRepSequences) {\r
471 this.hiddenRepSequences = hiddenRepSequences;\r
472 }, "java.util.Map");\r
473 Clazz.overrideMethod (c$, "hasHiddenColumns", \r
474 function () {\r
475 return this.colSel != null && this.colSel.hasHiddenColumns ();\r
476 });\r
477 Clazz.defineMethod (c$, "updateHiddenColumns", \r
478 function () {\r
479 });\r
480 Clazz.overrideMethod (c$, "hasHiddenRows", \r
481 function () {\r
482 return this.alignment.getHiddenSequences ().getSize () > 0;\r
483 });\r
484 Clazz.defineMethod (c$, "setSequenceSetId", \r
485 function (newid) {\r
486 if (this.sequenceSetID != null) {\r
487 System.err.println ("Warning - overwriting a sequenceSetId for a viewport!");\r
488 }this.sequenceSetID =  String.instantialize (newid);\r
489 }, "~S");\r
490 Clazz.overrideMethod (c$, "getSequenceSetId", \r
491 function () {\r
492 if (this.sequenceSetID == null) {\r
493 this.sequenceSetID = this.alignment.hashCode () + "";\r
494 }return this.sequenceSetID;\r
495 });\r
496 Clazz.overrideMethod (c$, "getViewId", \r
497 function () {\r
498 if (this.viewId == null) {\r
499 this.viewId = this.getSequenceSetId () + "." + this.hashCode () + "";\r
500 }return this.viewId;\r
501 });\r
502 Clazz.defineMethod (c$, "setIgnoreGapsConsensus", \r
503 function (b, ap) {\r
504 this.ignoreGapsInConsensusCalculation = b;\r
505 if (ap != null) {\r
506 this.updateConsensus (ap);\r
507 if (this.globalColourScheme != null) {\r
508 this.globalColourScheme.setThreshold (this.globalColourScheme.getThreshold (), this.ignoreGapsInConsensusCalculation);\r
509 }}}, "~B,jalview.api.AlignmentViewPanel");\r
510 Clazz.defineMethod (c$, "isSelectionGroupChanged", \r
511 function (b) {\r
512 var hc = (this.selectionGroup == null || this.selectionGroup.getSize () == 0) ? -1 : this.selectionGroup.hashCode ();\r
513 if (hc != -1 && hc != this.sgrouphash) {\r
514 if (b) {\r
515 this.sgrouphash = hc;\r
516 }return true;\r
517 }return false;\r
518 }, "~B");\r
519 Clazz.defineMethod (c$, "isColSelChanged", \r
520 function (b) {\r
521 var hc = (this.colSel == null || this.colSel.size () == 0) ? -1 : this.colSel.hashCode ();\r
522 if (hc != -1 && hc != this.colselhash) {\r
523 if (b) {\r
524 this.colselhash = hc;\r
525 }return true;\r
526 }return false;\r
527 }, "~B");\r
528 Clazz.overrideMethod (c$, "isIgnoreGapsConsensus", \r
529 function () {\r
530 return this.ignoreGapsInConsensusCalculation;\r
531 });\r
532 Clazz.defineMethod (c$, "addPropertyChangeListener", \r
533 function (listener) {\r
534 this.changeSupport.addPropertyChangeListener (listener);\r
535 }, "java.beans.PropertyChangeListener");\r
536 Clazz.defineMethod (c$, "removePropertyChangeListener", \r
537 function (listener) {\r
538 this.changeSupport.removePropertyChangeListener (listener);\r
539 }, "java.beans.PropertyChangeListener");\r
540 Clazz.defineMethod (c$, "firePropertyChange", \r
541 function (prop, oldvalue, newvalue) {\r
542 this.changeSupport.firePropertyChange (prop, oldvalue, newvalue);\r
543 }, "~S,~O,~O");\r
544 Clazz.defineMethod (c$, "hideSelectedColumns", \r
545 function () {\r
546 if (this.colSel.size () < 1) {\r
547 return;\r
548 }this.colSel.hideSelectedColumns ();\r
549 this.setSelectionGroup (null);\r
550 });\r
551 Clazz.defineMethod (c$, "hideColumns", \r
552 function (start, end) {\r
553 if (start == end) {\r
554 this.colSel.hideColumns (start);\r
555 } else {\r
556 this.colSel.hideColumns (start, end);\r
557 }}, "~N,~N");\r
558 Clazz.defineMethod (c$, "showColumn", \r
559 function (col) {\r
560 this.colSel.revealHiddenColumns (col);\r
561 }, "~N");\r
562 Clazz.defineMethod (c$, "showAllHiddenColumns", \r
563 function () {\r
564 this.colSel.revealAllHiddenColumns ();\r
565 });\r
566 Clazz.defineMethod (c$, "showAllHiddenSeqs", \r
567 function () {\r
568 if (this.alignment.getHiddenSequences ().getSize () > 0) {\r
569 if (this.selectionGroup == null) {\r
570 this.selectionGroup =  new jalview.datamodel.SequenceGroup ();\r
571 this.selectionGroup.setEndRes (this.alignment.getWidth () - 1);\r
572 }var tmp = this.alignment.getHiddenSequences ().showAll (this.hiddenRepSequences);\r
573 for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {\r
574 this.selectionGroup.addSequence (seq, false);\r
575 this.setSequenceAnnotationsVisible (seq, true);\r
576 }\r
577 this.hiddenRepSequences = null;\r
578 this.firePropertyChange ("alignment", null, this.alignment.getSequences ());\r
579 this.sendSelection ();\r
580 }});\r
581 Clazz.defineMethod (c$, "showSequence", \r
582 function (index) {\r
583 var tmp = this.alignment.getHiddenSequences ().showSequence (index, this.hiddenRepSequences);\r
584 if (tmp.size () > 0) {\r
585 if (this.selectionGroup == null) {\r
586 this.selectionGroup =  new jalview.datamodel.SequenceGroup ();\r
587 this.selectionGroup.setEndRes (this.alignment.getWidth () - 1);\r
588 }for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {\r
589 this.selectionGroup.addSequence (seq, false);\r
590 this.setSequenceAnnotationsVisible (seq, true);\r
591 }\r
592 this.firePropertyChange ("alignment", null, this.alignment.getSequences ());\r
593 this.sendSelection ();\r
594 }}, "~N");\r
595 Clazz.defineMethod (c$, "hideAllSelectedSeqs", \r
596 function () {\r
597 if (this.selectionGroup == null || this.selectionGroup.getSize () < 1) {\r
598 return;\r
599 }var seqs = this.selectionGroup.getSequencesInOrder (this.alignment);\r
600 this.hideSequence (seqs);\r
601 this.setSelectionGroup (null);\r
602 });\r
603 Clazz.defineMethod (c$, "hideSequence", \r
604 function (seq) {\r
605 if (seq != null) {\r
606 for (var i = 0; i < seq.length; i++) {\r
607 this.alignment.getHiddenSequences ().hideSequence (seq[i]);\r
608 this.setSequenceAnnotationsVisible (seq[i], false);\r
609 }\r
610 this.firePropertyChange ("alignment", null, this.alignment.getSequences ());\r
611 }}, "~A");\r
612 Clazz.defineMethod (c$, "setSequenceAnnotationsVisible", \r
613 function (sequenceI, visible) {\r
614 for (var ann, $ann = 0, $$ann = this.alignment.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {\r
615 if (ann.sequenceRef === sequenceI) {\r
616 ann.visible = visible;\r
617 }}\r
618 }, "jalview.datamodel.SequenceI,~B");\r
619 Clazz.defineMethod (c$, "hideRepSequences", \r
620 function (repSequence, sg) {\r
621 var sSize = sg.getSize ();\r
622 if (sSize < 2) {\r
623 return;\r
624 }if (this.hiddenRepSequences == null) {\r
625 this.hiddenRepSequences =  new java.util.Hashtable ();\r
626 }this.hiddenRepSequences.put (repSequence, sg);\r
627 var seqs =  new Array (sSize - 1);\r
628 var index = 0;\r
629 for (var i = 0; i < sSize; i++) {\r
630 if (sg.getSequenceAt (i) !== repSequence) {\r
631 if (index == sSize - 1) {\r
632 return;\r
633 }seqs[index++] = sg.getSequenceAt (i);\r
634 }}\r
635 sg.setSeqrep (repSequence);\r
636 sg.setHidereps (true);\r
637 this.hideSequence (seqs);\r
638 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");\r
639 Clazz.defineMethod (c$, "isHiddenRepSequence", \r
640 function (seq) {\r
641 return this.alignment.getSeqrep () === seq || (this.hiddenRepSequences != null && this.hiddenRepSequences.containsKey (seq));\r
642 }, "jalview.datamodel.SequenceI");\r
643 Clazz.defineMethod (c$, "getRepresentedSequences", \r
644 function (seq) {\r
645 return (this.hiddenRepSequences == null ? null : this.hiddenRepSequences.get (seq));\r
646 }, "jalview.datamodel.SequenceI");\r
647 Clazz.overrideMethod (c$, "adjustForHiddenSeqs", \r
648 function (alignmentIndex) {\r
649 return this.alignment.getHiddenSequences ().adjustForHiddenSeqs (alignmentIndex);\r
650 }, "~N");\r
651 Clazz.overrideMethod (c$, "invertColumnSelection", \r
652 function () {\r
653 this.colSel.invertColumnSelection (0, this.alignment.getWidth ());\r
654 });\r
655 Clazz.overrideMethod (c$, "getSelectionAsNewSequence", \r
656 function () {\r
657 var sequences;\r
658 if (this.selectionGroup == null || this.selectionGroup.getSize () == 0) {\r
659 sequences = this.alignment.getSequencesArray ();\r
660 var annots = this.alignment.getAlignmentAnnotation ();\r
661 for (var i = 0; i < sequences.length; i++) {\r
662 sequences[i] =  new jalview.datamodel.Sequence (sequences[i], annots);\r
663 }\r
664 } else {\r
665 sequences = this.selectionGroup.getSelectionAsNewSequences (this.alignment);\r
666 }return sequences;\r
667 });\r
668 Clazz.overrideMethod (c$, "getSequenceSelection", \r
669 function () {\r
670 var sequences = null;\r
671 if (this.selectionGroup != null) {\r
672 sequences = this.selectionGroup.getSequencesInOrder (this.alignment);\r
673 }if (sequences == null) {\r
674 sequences = this.alignment.getSequencesArray ();\r
675 }return sequences;\r
676 });\r
677 Clazz.overrideMethod (c$, "getViewAsCigars", \r
678 function (selectedRegionOnly) {\r
679 return  new jalview.datamodel.CigarArray (this.alignment, this.colSel, (selectedRegionOnly ? this.selectionGroup : null));\r
680 }, "~B");\r
681 Clazz.defineMethod (c$, "getAlignmentView", \r
682 function (selectedOnly) {\r
683 return this.getAlignmentView (selectedOnly, false);\r
684 }, "~B");\r
685 Clazz.defineMethod (c$, "getAlignmentView", \r
686 function (selectedOnly, markGroups) {\r
687 return  new jalview.datamodel.AlignmentView (this.alignment, this.colSel, this.selectionGroup, this.colSel != null && this.colSel.hasHiddenColumns (), selectedOnly, markGroups);\r
688 }, "~B,~B");\r
689 Clazz.overrideMethod (c$, "getViewAsString", \r
690 function (selectedRegionOnly) {\r
691 var selection = null;\r
692 var seqs = null;\r
693 var i;\r
694 var iSize;\r
695 var start = 0;\r
696 var end = 0;\r
697 if (selectedRegionOnly && this.selectionGroup != null) {\r
698 iSize = this.selectionGroup.getSize ();\r
699 seqs = this.selectionGroup.getSequencesInOrder (this.alignment);\r
700 start = this.selectionGroup.getStartRes ();\r
701 end = this.selectionGroup.getEndRes () + 1;\r
702 } else {\r
703 iSize = this.alignment.getHeight ();\r
704 seqs = this.alignment.getSequencesArray ();\r
705 end = this.alignment.getWidth ();\r
706 }selection =  new Array (iSize);\r
707 if (this.colSel != null && this.colSel.hasHiddenColumns ()) {\r
708 selection = this.colSel.getVisibleSequenceStrings (start, end, seqs);\r
709 } else {\r
710 for (i = 0; i < iSize; i++) {\r
711 selection[i] = seqs[i].getSequenceAsString (start, end);\r
712 }\r
713 }return selection;\r
714 }, "~B");\r
715 Clazz.overrideMethod (c$, "getVisibleRegionBoundaries", \r
716 function (min, max) {\r
717 var regions =  new java.util.ArrayList ();\r
718 var start = min;\r
719 var end = max;\r
720 do {\r
721 if (this.colSel != null && this.colSel.hasHiddenColumns ()) {\r
722 if (start == 0) {\r
723 start = this.colSel.adjustForHiddenColumns (start);\r
724 }end = this.colSel.getHiddenBoundaryRight (start);\r
725 if (start == end) {\r
726 end = max;\r
727 }if (end > max) {\r
728 end = max;\r
729 }}regions.add ( Clazz.newIntArray (-1, [start, end]));\r
730 if (this.colSel != null && this.colSel.hasHiddenColumns ()) {\r
731 start = this.colSel.adjustForHiddenColumns (end);\r
732 start = this.colSel.getHiddenBoundaryLeft (start) + 1;\r
733 }} while (end < max);\r
734 var startEnd =  Clazz.newIntArray (regions.size (), 2, 0);\r
735 return regions;\r
736 }, "~N,~N");\r
737 Clazz.overrideMethod (c$, "getVisibleAlignmentAnnotation", \r
738 function (selectedOnly) {\r
739 var ala =  new java.util.ArrayList ();\r
740 var aa;\r
741 if ((aa = this.alignment.getAlignmentAnnotation ()) != null) {\r
742 for (var annot, $annot = 0, $$annot = aa; $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) {\r
743 var clone =  new jalview.datamodel.AlignmentAnnotation (annot);\r
744 if (selectedOnly && this.selectionGroup != null) {\r
745 this.colSel.makeVisibleAnnotation (this.selectionGroup.getStartRes (), this.selectionGroup.getEndRes (), clone);\r
746 } else {\r
747 this.colSel.makeVisibleAnnotation (clone);\r
748 }ala.add (clone);\r
749 }\r
750 }return ala;\r
751 }, "~B");\r
752 Clazz.overrideMethod (c$, "isPadGaps", \r
753 function () {\r
754 return this.padGaps;\r
755 });\r
756 Clazz.overrideMethod (c$, "setPadGaps", \r
757 function (padGaps) {\r
758 this.padGaps = padGaps;\r
759 }, "~B");\r
760 Clazz.overrideMethod (c$, "alignmentChanged", \r
761 function (ap) {\r
762 if (this.isPadGaps ()) {\r
763 this.alignment.padGaps ();\r
764 }if (this.autoCalculateConsensus) {\r
765 this.updateConsensus (ap);\r
766 }if (this.hconsensus != null && this.autoCalculateConsensus) {\r
767 this.updateConservation (ap);\r
768 }if (this.autoCalculateStrucConsensus) {\r
769 this.updateStrucConsensus (ap);\r
770 }var alWidth = this.alignment.getWidth ();\r
771 var groups = this.alignment.getGroups ();\r
772 if (groups != null) {\r
773 for (var sg, $sg = groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {\r
774 if (sg.getEndRes () > alWidth) {\r
775 sg.setEndRes (alWidth - 1);\r
776 }}\r
777 }if (this.selectionGroup != null && this.selectionGroup.getEndRes () > alWidth) {\r
778 this.selectionGroup.setEndRes (alWidth - 1);\r
779 }this.resetAllColourSchemes ();\r
780 this.calculator.restartWorkers ();\r
781 }, "jalview.api.AlignmentViewPanel");\r
782 Clazz.defineMethod (c$, "resetAllColourSchemes", \r
783 function () {\r
784 var cs = this.globalColourScheme;\r
785 if (cs != null) {\r
786 cs.alignmentChanged (this.alignment, this.hiddenRepSequences);\r
787 cs.setConsensus (this.hconsensus);\r
788 if (cs.conservationApplied ()) {\r
789 cs.setConservation (jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.alignment.getWidth (), false, this.getConsPercGaps (), false));\r
790 }}for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {\r
791 if (sg.cs != null) {\r
792 sg.cs.alignmentChanged (sg, this.hiddenRepSequences);\r
793 }sg.recalcConservation ();\r
794 }\r
795 });\r
796 Clazz.defineMethod (c$, "initAutoAnnotation", \r
797 function () {\r
798 if (this.hconsensus == null && !this.$isDataset) {\r
799 if (!this.alignment.isNucleotide ()) {\r
800 this.initConservation ();\r
801 this.initQuality ();\r
802 } else {\r
803 this.initRNAStructure ();\r
804 }this.consensus =  new jalview.datamodel.AlignmentAnnotation ("Consensus", "PID",  new Array (1), 0, 100, 1);\r
805 this.initConsensus (this.consensus);\r
806 this.initComplementConsensus ();\r
807 }});\r
808 Clazz.defineMethod (c$, "initComplementConsensus", \r
809 function () {\r
810 if (!this.alignment.isNucleotide ()) {\r
811 var codonMappings = this.alignment.getCodonFrames ();\r
812 if (codonMappings != null && !codonMappings.isEmpty ()) {\r
813 this.complementConsensus =  new jalview.datamodel.AlignmentAnnotation ("cDNA Consensus", "PID for cDNA",  new Array (1), 0, 100, 1);\r
814 this.initConsensus (this.complementConsensus);\r
815 }}});\r
816 Clazz.defineMethod (c$, "initConsensus", \r
817 ($fz = function (aa) {\r
818 aa.hasText = true;\r
819 aa.autoCalculated = true;\r
820 if (this.showConsensus) {\r
821 this.alignment.addAnnotation (aa);\r
822 }}, $fz.isPrivate = true, $fz), "jalview.datamodel.AlignmentAnnotation");\r
823 Clazz.defineMethod (c$, "initConservation", \r
824 ($fz = function () {\r
825 if (this.showConservation) {\r
826 if (this.conservation == null) {\r
827 this.conservation =  new jalview.datamodel.AlignmentAnnotation ("Conservation", "Conservation of total alignment less than " + this.getConsPercGaps () + "% gaps",  new Array (1), 0, 11, 1);\r
828 this.conservation.hasText = true;\r
829 this.conservation.autoCalculated = true;\r
830 this.alignment.addAnnotation (this.conservation);\r
831 }}}, $fz.isPrivate = true, $fz));\r
832 Clazz.defineMethod (c$, "initQuality", \r
833 ($fz = function () {\r
834 if (this.showQuality) {\r
835 if (this.quality == null) {\r
836 this.quality =  new jalview.datamodel.AlignmentAnnotation ("Quality", "Alignment Quality based on Blosum62 scores",  new Array (1), 0, 11, 1);\r
837 this.quality.hasText = true;\r
838 this.quality.autoCalculated = true;\r
839 this.alignment.addAnnotation (this.quality);\r
840 }}}, $fz.isPrivate = true, $fz));\r
841 Clazz.defineMethod (c$, "initRNAStructure", \r
842 ($fz = function () {\r
843 if (this.alignment.hasRNAStructure () && this.strucConsensus == null) {\r
844 this.strucConsensus =  new jalview.datamodel.AlignmentAnnotation ("StrucConsensus", "PID",  new Array (1), 0, 100, 1);\r
845 this.strucConsensus.hasText = true;\r
846 this.strucConsensus.autoCalculated = true;\r
847 if (this.showConsensus) {\r
848 this.alignment.addAnnotation (this.strucConsensus);\r
849 }}}, $fz.isPrivate = true, $fz));\r
850 Clazz.overrideMethod (c$, "calcPanelHeight", \r
851 function () {\r
852 var anns = this.getAlignment ().getAlignmentAnnotation ();\r
853 var height = 0;\r
854 var charHeight = this.getCharHeight ();\r
855 if (anns != null) {\r
856 var graphgrp =  new java.util.BitSet ();\r
857 for (var aa, $aa = 0, $$aa = anns; $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {\r
858 if (aa == null) {\r
859 System.err.println ("Null annotation row: ignoring.");\r
860 continue;\r
861 }if (!aa.visible) {\r
862 continue;\r
863 }if (aa.graphGroup > -1) {\r
864 if (graphgrp.get (aa.graphGroup)) {\r
865 continue;\r
866 } else {\r
867 graphgrp.set (aa.graphGroup);\r
868 }}aa.height = 0;\r
869 if (aa.hasText) {\r
870 aa.height += charHeight;\r
871 }if (aa.hasIcons) {\r
872 aa.height += 16;\r
873 }if (aa.graph > 0) {\r
874 aa.height += aa.graphHeight;\r
875 }if (aa.height == 0) {\r
876 aa.height = 20;\r
877 }height += aa.height;\r
878 }\r
879 }if (height == 0) {\r
880 height = 20;\r
881 }return height;\r
882 });\r
883 Clazz.overrideMethod (c$, "updateGroupAnnotationSettings", \r
884 function (applyGlobalSettings, preserveNewGroupSettings) {\r
885 var updateCalcs = false;\r
886 var conv = this.isShowGroupConservation ();\r
887 var cons = this.isShowGroupConsensus ();\r
888 var showprf = this.isShowSequenceLogo ();\r
889 var showConsHist = this.isShowConsensusHistogram ();\r
890 var normLogo = this.isNormaliseSequenceLogo ();\r
891 var sortg = true;\r
892 var aan = this.alignment.getAlignmentAnnotation ();\r
893 var oldrfs =  new java.util.ArrayList ();\r
894 if (aan != null) {\r
895 for (var an = 0; an < aan.length; an++) {\r
896 if (aan[an].autoCalculated && aan[an].groupRef != null) {\r
897 oldrfs.add (aan[an].groupRef);\r
898 this.alignment.deleteAnnotation (aan[an], false);\r
899 }}\r
900 }if (this.alignment.getGroups () != null) {\r
901 for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {\r
902 updateCalcs = false;\r
903 if (applyGlobalSettings || (!preserveNewGroupSettings && !oldrfs.contains (sg))) {\r
904 sg.setshowSequenceLogo (showprf);\r
905 sg.setShowConsensusHistogram (showConsHist);\r
906 sg.setNormaliseSequenceLogo (normLogo);\r
907 }if (conv) {\r
908 updateCalcs = true;\r
909 this.alignment.addAnnotation (sg.getConservationRow (), 0);\r
910 }if (cons) {\r
911 updateCalcs = true;\r
912 this.alignment.addAnnotation (sg.getConsensus (), 0);\r
913 }if (updateCalcs) {\r
914 sg.recalcConservation ();\r
915 }}\r
916 }oldrfs.clear ();\r
917 }, "~B,~B");\r
918 Clazz.defineMethod (c$, "isDisplayReferenceSeq", \r
919 function () {\r
920 return this.alignment.hasSeqrep () && this.viewStyle.isDisplayReferenceSeq ();\r
921 });\r
922 Clazz.defineMethod (c$, "setDisplayReferenceSeq", \r
923 function (displayReferenceSeq) {\r
924 this.viewStyle.setDisplayReferenceSeq (displayReferenceSeq);\r
925 }, "~B");\r
926 Clazz.defineMethod (c$, "isColourByReferenceSeq", \r
927 function () {\r
928 return this.alignment.hasSeqrep () && this.viewStyle.isColourByReferenceSeq ();\r
929 });\r
930 Clazz.overrideMethod (c$, "getSequenceColour", \r
931 function (seq) {\r
932 var sqc = this.sequenceColours.get (seq);\r
933 return (sqc == null ? java.awt.Color.white : sqc);\r
934 }, "jalview.datamodel.SequenceI");\r
935 Clazz.overrideMethod (c$, "setSequenceColour", \r
936 function (seq, col) {\r
937 if (col == null) {\r
938 this.sequenceColours.remove (seq);\r
939 } else {\r
940 this.sequenceColours.put (seq, col);\r
941 }}, "jalview.datamodel.SequenceI,java.awt.Color");\r
942 Clazz.overrideMethod (c$, "updateSequenceIdColours", \r
943 function () {\r
944 for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {\r
945 if (sg.idColour != null) {\r
946 for (var s, $s = sg.getSequences (this.getHiddenRepSequences ()).iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {\r
947 this.sequenceColours.put (s, sg.idColour);\r
948 }\r
949 }}\r
950 });\r
951 Clazz.overrideMethod (c$, "clearSequenceColours", \r
952 function () {\r
953 this.sequenceColours.clear ();\r
954 });\r
955 Clazz.defineMethod (c$, "getCodingComplement", \r
956 function () {\r
957 return this.codingComplement;\r
958 });\r
959 Clazz.defineMethod (c$, "setCodingComplement", \r
960 function (av) {\r
961 if (this === av) {\r
962 System.err.println ("Ignoring recursive setCodingComplement request");\r
963 } else {\r
964 this.codingComplement = av;\r
965 if (av.getCodingComplement () !== this) {\r
966 av.setCodingComplement (this);\r
967 }}}, "jalview.api.AlignViewportI");\r
968 Clazz.overrideMethod (c$, "isNucleotide", \r
969 function () {\r
970 return this.getAlignment () == null ? false : this.getAlignment ().isNucleotide ();\r
971 });\r
972 Clazz.overrideMethod (c$, "getFeaturesDisplayed", \r
973 function () {\r
974 return this.featuresDisplayed;\r
975 });\r
976 Clazz.overrideMethod (c$, "setFeaturesDisplayed", \r
977 function (featuresDisplayedI) {\r
978 this.featuresDisplayed = featuresDisplayedI;\r
979 }, "jalview.api.FeaturesDisplayedI");\r
980 Clazz.overrideMethod (c$, "areFeaturesDisplayed", \r
981 function () {\r
982 return this.featuresDisplayed != null && this.featuresDisplayed.getRegisterdFeaturesCount () > 0;\r
983 });\r
984 Clazz.defineMethod (c$, "setShowSequenceFeatures", \r
985 function (b) {\r
986 this.viewStyle.setShowSequenceFeatures (b);\r
987 }, "~B");\r
988 Clazz.defineMethod (c$, "isShowSequenceFeatures", \r
989 function () {\r
990 return this.viewStyle.isShowSequenceFeatures ();\r
991 });\r
992 Clazz.defineMethod (c$, "setShowSequenceFeaturesHeight", \r
993 function (selected) {\r
994 this.viewStyle.setShowSequenceFeaturesHeight (selected);\r
995 }, "~B");\r
996 Clazz.defineMethod (c$, "isShowSequenceFeaturesHeight", \r
997 function () {\r
998 return this.viewStyle.isShowSequenceFeaturesHeight ();\r
999 });\r
1000 Clazz.defineMethod (c$, "setShowAnnotation", \r
1001 function (b) {\r
1002 this.viewStyle.setShowAnnotation (b);\r
1003 }, "~B");\r
1004 Clazz.defineMethod (c$, "isShowAnnotation", \r
1005 function () {\r
1006 return this.viewStyle.isShowAnnotation ();\r
1007 });\r
1008 Clazz.defineMethod (c$, "isRightAlignIds", \r
1009 function () {\r
1010 return this.viewStyle.isRightAlignIds ();\r
1011 });\r
1012 Clazz.defineMethod (c$, "setRightAlignIds", \r
1013 function (rightAlignIds) {\r
1014 this.viewStyle.setRightAlignIds (rightAlignIds);\r
1015 }, "~B");\r
1016 Clazz.defineMethod (c$, "getConservationSelected", \r
1017 function () {\r
1018 return this.viewStyle.getConservationSelected ();\r
1019 });\r
1020 Clazz.defineMethod (c$, "setShowBoxes", \r
1021 function (state) {\r
1022 this.viewStyle.setShowBoxes (state);\r
1023 }, "~B");\r
1024 Clazz.defineMethod (c$, "getTextColour", \r
1025 function () {\r
1026 return this.viewStyle.getTextColour ();\r
1027 });\r
1028 Clazz.defineMethod (c$, "getTextColour2", \r
1029 function () {\r
1030 return this.viewStyle.getTextColour2 ();\r
1031 });\r
1032 Clazz.defineMethod (c$, "getThresholdTextColour", \r
1033 function () {\r
1034 return this.viewStyle.getThresholdTextColour ();\r
1035 });\r
1036 Clazz.defineMethod (c$, "isConservationColourSelected", \r
1037 function () {\r
1038 return this.viewStyle.isConservationColourSelected ();\r
1039 });\r
1040 Clazz.defineMethod (c$, "isRenderGaps", \r
1041 function () {\r
1042 return this.viewStyle.isRenderGaps ();\r
1043 });\r
1044 Clazz.defineMethod (c$, "isShowColourText", \r
1045 function () {\r
1046 return this.viewStyle.isShowColourText ();\r
1047 });\r
1048 Clazz.defineMethod (c$, "setConservationColourSelected", \r
1049 function (conservationColourSelected) {\r
1050 this.viewStyle.setConservationColourSelected (conservationColourSelected);\r
1051 }, "~B");\r
1052 Clazz.defineMethod (c$, "setShowColourText", \r
1053 function (showColourText) {\r
1054 this.viewStyle.setShowColourText (showColourText);\r
1055 }, "~B");\r
1056 Clazz.defineMethod (c$, "setTextColour", \r
1057 function (textColour) {\r
1058 this.viewStyle.setTextColour (textColour);\r
1059 }, "java.awt.Color");\r
1060 Clazz.defineMethod (c$, "setThresholdTextColour", \r
1061 function (thresholdTextColour) {\r
1062 this.viewStyle.setThresholdTextColour (thresholdTextColour);\r
1063 }, "~N");\r
1064 Clazz.defineMethod (c$, "setTextColour2", \r
1065 function (textColour2) {\r
1066 this.viewStyle.setTextColour2 (textColour2);\r
1067 }, "java.awt.Color");\r
1068 Clazz.overrideMethod (c$, "getViewStyle", \r
1069 function () {\r
1070 return  new jalview.viewmodel.styles.ViewStyle (this.viewStyle);\r
1071 });\r
1072 Clazz.overrideMethod (c$, "setViewStyle", \r
1073 function (settingsForView) {\r
1074 this.viewStyle =  new jalview.viewmodel.styles.ViewStyle (settingsForView);\r
1075 }, "jalview.api.ViewStyleI");\r
1076 Clazz.defineMethod (c$, "sameStyle", \r
1077 function (them) {\r
1078 return this.viewStyle.sameStyle (them);\r
1079 }, "jalview.api.ViewStyleI");\r
1080 Clazz.defineMethod (c$, "getIdWidth", \r
1081 function () {\r
1082 return this.viewStyle.getIdWidth ();\r
1083 });\r
1084 Clazz.defineMethod (c$, "setIdWidth", \r
1085 function (i) {\r
1086 this.viewStyle.setIdWidth (i);\r
1087 }, "~N");\r
1088 Clazz.defineMethod (c$, "isCentreColumnLabels", \r
1089 function () {\r
1090 return this.viewStyle.isCentreColumnLabels ();\r
1091 });\r
1092 Clazz.defineMethod (c$, "setCentreColumnLabels", \r
1093 function (centreColumnLabels) {\r
1094 this.viewStyle.setCentreColumnLabels (centreColumnLabels);\r
1095 }, "~B");\r
1096 Clazz.defineMethod (c$, "setShowDBRefs", \r
1097 function (showdbrefs) {\r
1098 this.viewStyle.setShowDBRefs (showdbrefs);\r
1099 }, "~B");\r
1100 Clazz.defineMethod (c$, "isShowDBRefs", \r
1101 function () {\r
1102 return this.viewStyle.isShowDBRefs ();\r
1103 });\r
1104 Clazz.defineMethod (c$, "isShowNPFeats", \r
1105 function () {\r
1106 return this.viewStyle.isShowNPFeats ();\r
1107 });\r
1108 Clazz.defineMethod (c$, "setShowNPFeats", \r
1109 function (shownpfeats) {\r
1110 this.viewStyle.setShowNPFeats (shownpfeats);\r
1111 }, "~B");\r
1112 Clazz.defineMethod (c$, "addToHistoryList", \r
1113 function (command) {\r
1114 if (this.historyList != null) {\r
1115 this.historyList.push (command);\r
1116 this.broadcastCommand (command, false);\r
1117 }}, "jalview.commands.CommandI");\r
1118 Clazz.defineMethod (c$, "broadcastCommand", \r
1119 function (command, undo) {\r
1120 this.getStructureSelectionManager ().commandPerformed (command, undo, this.getVamsasSource ());\r
1121 }, "jalview.commands.CommandI,~B");\r
1122 Clazz.defineMethod (c$, "addToRedoList", \r
1123 function (command) {\r
1124 if (this.redoList != null) {\r
1125 this.redoList.push (command);\r
1126 }this.broadcastCommand (command, true);\r
1127 }, "jalview.commands.CommandI");\r
1128 Clazz.defineMethod (c$, "clearRedoList", \r
1129 function () {\r
1130 if (this.redoList != null) {\r
1131 this.redoList.clear ();\r
1132 }});\r
1133 Clazz.defineMethod (c$, "setHistoryList", \r
1134 function (list) {\r
1135 this.historyList = list;\r
1136 }, "java.util.Deque");\r
1137 Clazz.defineMethod (c$, "getHistoryList", \r
1138 function () {\r
1139 return this.historyList;\r
1140 });\r
1141 Clazz.defineMethod (c$, "setRedoList", \r
1142 function (list) {\r
1143 this.redoList = list;\r
1144 }, "java.util.Deque");\r
1145 Clazz.defineMethod (c$, "getRedoList", \r
1146 function () {\r
1147 return this.redoList;\r
1148 });\r
1149 Clazz.overrideMethod (c$, "getVamsasSource", \r
1150 function () {\r
1151 return this;\r
1152 });\r
1153 Clazz.defineMethod (c$, "getSortAnnotationsBy", \r
1154 function () {\r
1155 return this.sortAnnotationsBy;\r
1156 });\r
1157 Clazz.defineMethod (c$, "setSortAnnotationsBy", \r
1158 function (sortAnnotationsBy) {\r
1159 this.sortAnnotationsBy = sortAnnotationsBy;\r
1160 }, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");\r
1161 Clazz.defineMethod (c$, "isShowAutocalculatedAbove", \r
1162 function () {\r
1163 return this.showAutocalculatedAbove;\r
1164 });\r
1165 Clazz.defineMethod (c$, "setShowAutocalculatedAbove", \r
1166 function (showAutocalculatedAbove) {\r
1167 this.showAutocalculatedAbove = showAutocalculatedAbove;\r
1168 }, "~B");\r
1169 Clazz.defineMethod (c$, "isScaleProteinAsCdna", \r
1170 function () {\r
1171 return this.viewStyle.isScaleProteinAsCdna ();\r
1172 });\r
1173 Clazz.defineMethod (c$, "setScaleProteinAsCdna", \r
1174 function (b) {\r
1175 this.viewStyle.setScaleProteinAsCdna (b);\r
1176 }, "~B");\r
1177 Clazz.defineMethod (c$, "isFollowHighlight", \r
1178 function () {\r
1179 return this.followHighlight;\r
1180 });\r
1181 Clazz.overrideMethod (c$, "setFollowHighlight", \r
1182 function (b) {\r
1183 this.followHighlight = b;\r
1184 }, "~B");\r
1185 Clazz.defineMethod (c$, "getStartRes", \r
1186 function () {\r
1187 return this.startRes;\r
1188 });\r
1189 Clazz.overrideMethod (c$, "getEndRes", \r
1190 function () {\r
1191 return this.endRes;\r
1192 });\r
1193 Clazz.defineMethod (c$, "getStartSeq", \r
1194 function () {\r
1195 return this.startSeq;\r
1196 });\r
1197 Clazz.defineMethod (c$, "setStartRes", \r
1198 function (res) {\r
1199 this.startRes = res;\r
1200 }, "~N");\r
1201 Clazz.defineMethod (c$, "setStartSeq", \r
1202 function (seq) {\r
1203 this.startSeq = seq;\r
1204 }, "~N");\r
1205 Clazz.defineMethod (c$, "setEndRes", \r
1206 function (res) {\r
1207 if (res > this.alignment.getWidth () - 1) {\r
1208 res = this.alignment.getWidth () - 1;\r
1209 }if (res < 0) {\r
1210 res = 0;\r
1211 }this.endRes = res;\r
1212 }, "~N");\r
1213 Clazz.defineMethod (c$, "setEndSeq", \r
1214 function (seq) {\r
1215 if (seq > this.alignment.getHeight ()) {\r
1216 seq = this.alignment.getHeight ();\r
1217 }if (seq < 0) {\r
1218 seq = 0;\r
1219 }this.endSeq = seq;\r
1220 }, "~N");\r
1221 Clazz.defineMethod (c$, "getEndSeq", \r
1222 function () {\r
1223 return this.endSeq;\r
1224 });\r
1225 Clazz.defineMethod (c$, "findComplementScrollTarget", \r
1226 function (sr) {\r
1227 var complement = this.getCodingComplement ();\r
1228 if (complement == null || !complement.isFollowHighlight ()) {\r
1229 return 0;\r
1230 }var iAmProtein = !this.getAlignment ().isNucleotide ();\r
1231 var proteinAlignment = iAmProtein ? this.getAlignment () : complement.getAlignment ();\r
1232 if (proteinAlignment == null) {\r
1233 return 0;\r
1234 }var mappings = proteinAlignment.getCodonFrames ();\r
1235 var seqOffset = 0;\r
1236 var sequence = null;\r
1237 var middleColumn = this.getStartRes () + Clazz.doubleToInt ((this.getEndRes () - this.getStartRes ()) / 2);\r
1238 var hiddenSequences = this.getAlignment ().getHiddenSequences ();\r
1239 for (var seqNo = this.getStartSeq (); seqNo < this.getEndSeq (); seqNo++, seqOffset++) {\r
1240 sequence = this.getAlignment ().getSequenceAt (seqNo);\r
1241 if (hiddenSequences != null && hiddenSequences.isHidden (sequence)) {\r
1242 continue;\r
1243 }if (jalview.util.Comparison.isGap (sequence.getCharAt (middleColumn))) {\r
1244 continue;\r
1245 }var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (sequence, mappings);\r
1246 if (!seqMappings.isEmpty ()) {\r
1247 break;\r
1248 }}\r
1249 if (sequence == null) {\r
1250 return 0;\r
1251 }jalview.util.MappingUtils.addSearchResults (sr, sequence, sequence.findPosition (middleColumn), mappings);\r
1252 return seqOffset;\r
1253 }, "jalview.datamodel.SearchResults");\r
1254 });\r