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