X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fviewmodel%2FAlignmentViewport.js;h=cdbd489de97790dcb70497d5836476d8eaaccdcb;hp=6f07731967e6f730d045b17dec15aa738e3e26b3;hb=7301a2415adab88038b291fc54caeeb3a5a47a44;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/viewmodel/AlignmentViewport.js b/bin/jalview/viewmodel/AlignmentViewport.js index 6f07731..cdbd489 100644 --- a/bin/jalview/viewmodel/AlignmentViewport.js +++ b/bin/jalview/viewmodel/AlignmentViewport.js @@ -1,1254 +1,1254 @@ -Clazz.declarePackage ("jalview.viewmodel"); -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 () { -c$ = Clazz.decorateAsClass (function () { -this.viewStyle = null; -this.codingComplement = null; -this.featuresDisplayed = null; -this.historyList = null; -this.redoList = null; -this.alignment = null; -this.sequenceSetID = null; -this.$isDataset = false; -this.hiddenRepSequences = null; -this.colSel = null; -this.autoCalculateConsensus = true; -this.autoCalculateStrucConsensus = true; -this.ignoreGapsInConsensusCalculation = false; -this.globalColourScheme = null; -this.consensus = null; -this.complementConsensus = null; -this.strucConsensus = null; -this.conservation = null; -this.quality = null; -this.groupConsensus = null; -this.groupConservation = null; -this.hconsensus = null; -this.hcomplementConsensus = null; -this.hStrucConsensus = null; -this.hconservation = null; -this.ConsPercGaps = 25; -this.calculator = null; -this.showGroupConservation = false; -this.showGroupConsensus = false; -this.showSequenceLogo = false; -this.normaliseSequenceLogo = false; -this.showConsensusHistogram = true; -this.padGaps = false; -this.sortByTree = false; -this.selectionGroup = null; -this.viewId = null; -this.sgrouphash = -1; -this.colselhash = -1; -this.changeSupport = null; -this.showConservation = true; -this.showQuality = true; -this.showConsensus = true; -this.sequenceColours = null; -this.sortAnnotationsBy = null; -this.showAutocalculatedAbove = false; -this.followHighlight = true; -this.startRes = 0; -this.endRes = 0; -this.startSeq = 0; -this.endSeq = 0; -Clazz.instantialize (this, arguments); -}, jalview.viewmodel, "AlignmentViewport", null, [jalview.api.AlignViewportI, jalview.structure.CommandListener, jalview.structure.VamsasSource]); -Clazz.prepareFields (c$, function () { -this.viewStyle = new jalview.viewmodel.styles.ViewStyle (); -this.historyList = new java.util.ArrayDeque (); -this.redoList = new java.util.ArrayDeque (); -this.colSel = new jalview.datamodel.ColumnSelection (); -this.calculator = new jalview.workers.AlignCalcManager (); -this.changeSupport = new java.beans.PropertyChangeSupport (this); -this.sequenceColours = new java.util.HashMap (); -}); -Clazz.defineMethod (c$, "setFontName", -function (name) { -this.viewStyle.setFontName (name); -}, "~S"); -Clazz.defineMethod (c$, "setFontStyle", -function (style) { -this.viewStyle.setFontStyle (style); -}, "~N"); -Clazz.defineMethod (c$, "setFontSize", -function (size) { -this.viewStyle.setFontSize (size); -}, "~N"); -Clazz.defineMethod (c$, "getFontStyle", -function () { -return this.viewStyle.getFontStyle (); -}); -Clazz.defineMethod (c$, "getFontName", -function () { -return this.viewStyle.getFontName (); -}); -Clazz.defineMethod (c$, "getFontSize", -function () { -return this.viewStyle.getFontSize (); -}); -Clazz.defineMethod (c$, "setUpperCasebold", -function (upperCasebold) { -this.viewStyle.setUpperCasebold (upperCasebold); -}, "~B"); -Clazz.defineMethod (c$, "isUpperCasebold", -function () { -return this.viewStyle.isUpperCasebold (); -}); -Clazz.defineMethod (c$, "isSeqNameItalics", -function () { -return this.viewStyle.isSeqNameItalics (); -}); -Clazz.defineMethod (c$, "setColourByReferenceSeq", -function (colourByReferenceSeq) { -this.viewStyle.setColourByReferenceSeq (colourByReferenceSeq); -}, "~B"); -Clazz.defineMethod (c$, "setColourAppliesToAllGroups", -function (b) { -this.viewStyle.setColourAppliesToAllGroups (b); -}, "~B"); -Clazz.defineMethod (c$, "getColourAppliesToAllGroups", -function () { -return this.viewStyle.getColourAppliesToAllGroups (); -}); -Clazz.defineMethod (c$, "getAbovePIDThreshold", -function () { -return this.viewStyle.getAbovePIDThreshold (); -}); -Clazz.defineMethod (c$, "setIncrement", -function (inc) { -this.viewStyle.setIncrement (inc); -}, "~N"); -Clazz.defineMethod (c$, "getIncrement", -function () { -return this.viewStyle.getIncrement (); -}); -Clazz.defineMethod (c$, "setConservationSelected", -function (b) { -this.viewStyle.setConservationSelected (b); -}, "~B"); -Clazz.defineMethod (c$, "setShowHiddenMarkers", -function (show) { -this.viewStyle.setShowHiddenMarkers (show); -}, "~B"); -Clazz.defineMethod (c$, "getShowHiddenMarkers", -function () { -return this.viewStyle.getShowHiddenMarkers (); -}); -Clazz.defineMethod (c$, "setScaleRightWrapped", -function (b) { -this.viewStyle.setScaleRightWrapped (b); -}, "~B"); -Clazz.defineMethod (c$, "setScaleLeftWrapped", -function (b) { -this.viewStyle.setScaleLeftWrapped (b); -}, "~B"); -Clazz.defineMethod (c$, "setScaleAboveWrapped", -function (b) { -this.viewStyle.setScaleAboveWrapped (b); -}, "~B"); -Clazz.defineMethod (c$, "getScaleLeftWrapped", -function () { -return this.viewStyle.getScaleLeftWrapped (); -}); -Clazz.defineMethod (c$, "getScaleAboveWrapped", -function () { -return this.viewStyle.getScaleAboveWrapped (); -}); -Clazz.defineMethod (c$, "getScaleRightWrapped", -function () { -return this.viewStyle.getScaleRightWrapped (); -}); -Clazz.defineMethod (c$, "setAbovePIDThreshold", -function (b) { -this.viewStyle.setAbovePIDThreshold (b); -}, "~B"); -Clazz.defineMethod (c$, "setThreshold", -function (thresh) { -this.viewStyle.setThreshold (thresh); -}, "~N"); -Clazz.defineMethod (c$, "getThreshold", -function () { -return this.viewStyle.getThreshold (); -}); -Clazz.defineMethod (c$, "getShowJVSuffix", -function () { -return this.viewStyle.getShowJVSuffix (); -}); -Clazz.defineMethod (c$, "setShowJVSuffix", -function (b) { -this.viewStyle.setShowJVSuffix (b); -}, "~B"); -Clazz.defineMethod (c$, "setWrapAlignment", -function (state) { -this.viewStyle.setWrapAlignment (state); -}, "~B"); -Clazz.defineMethod (c$, "setShowText", -function (state) { -this.viewStyle.setShowText (state); -}, "~B"); -Clazz.defineMethod (c$, "setRenderGaps", -function (state) { -this.viewStyle.setRenderGaps (state); -}, "~B"); -Clazz.defineMethod (c$, "getColourText", -function () { -return this.viewStyle.getColourText (); -}); -Clazz.defineMethod (c$, "setColourText", -function (state) { -this.viewStyle.setColourText (state); -}, "~B"); -Clazz.defineMethod (c$, "getWrapAlignment", -function () { -return this.viewStyle.getWrapAlignment (); -}); -Clazz.defineMethod (c$, "getShowText", -function () { -return this.viewStyle.getShowText (); -}); -Clazz.defineMethod (c$, "getWrappedWidth", -function () { -return this.viewStyle.getWrappedWidth (); -}); -Clazz.defineMethod (c$, "setWrappedWidth", -function (w) { -this.viewStyle.setWrappedWidth (w); -}, "~N"); -Clazz.defineMethod (c$, "getCharHeight", -function () { -return this.viewStyle.getCharHeight (); -}); -Clazz.defineMethod (c$, "setCharHeight", -function (h) { -this.viewStyle.setCharHeight (h); -}, "~N"); -Clazz.defineMethod (c$, "getCharWidth", -function () { -return this.viewStyle.getCharWidth (); -}); -Clazz.defineMethod (c$, "setCharWidth", -function (w) { -this.viewStyle.setCharWidth (w); -}, "~N"); -Clazz.defineMethod (c$, "getShowBoxes", -function () { -return this.viewStyle.getShowBoxes (); -}); -Clazz.defineMethod (c$, "getShowUnconserved", -function () { -return this.viewStyle.getShowUnconserved (); -}); -Clazz.defineMethod (c$, "setShowUnconserved", -function (showunconserved) { -this.viewStyle.setShowUnconserved (showunconserved); -}, "~B"); -Clazz.defineMethod (c$, "setSeqNameItalics", -function (default1) { -this.viewStyle.setSeqNameItalics (default1); -}, "~B"); -Clazz.defineMethod (c$, "getAlignment", -function () { -return this.alignment; -}); -Clazz.overrideMethod (c$, "getGapCharacter", -function () { -return this.alignment.getGapCharacter (); -}); -Clazz.defineMethod (c$, "setDataset", -function (b) { -this.$isDataset = b; -}, "~B"); -Clazz.defineMethod (c$, "isDataset", -function () { -return this.$isDataset; -}); -Clazz.overrideMethod (c$, "setGlobalColourScheme", -function (cs) { -this.globalColourScheme = cs; -var recalc = false; -if (cs != null) { -cs.setConservationApplied (recalc = this.getConservationSelected ()); -if (this.getAbovePIDThreshold () || Clazz.instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz.instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) { -recalc = true; -cs.setThreshold (this.viewStyle.getThreshold (), this.ignoreGapsInConsensusCalculation); -} else { -cs.setThreshold (0, this.ignoreGapsInConsensusCalculation); -}if (recalc) { -cs.setConsensus (this.hconsensus); -cs.setConservation (this.hconservation); -}cs.alignmentChanged (this.alignment, this.hiddenRepSequences); -}if (this.getColourAppliesToAllGroups ()) { -for (var sg, $sg = this.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { -if (cs == null) { -sg.cs = null; -continue; -}sg.cs = cs.applyTo (sg, this.getHiddenRepSequences ()); -sg.setConsPercGaps (this.ConsPercGaps); -if (this.getAbovePIDThreshold () || Clazz.instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz.instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) { -sg.cs.setThreshold (this.viewStyle.getThreshold (), this.isIgnoreGapsConsensus ()); -recalc = true; -} else { -sg.cs.setThreshold (0, this.isIgnoreGapsConsensus ()); -}if (this.getConservationSelected ()) { -sg.cs.setConservationApplied (true); -recalc = true; -} else { -sg.cs.setConservation (null); -}if (recalc) { -sg.recalcConservation (); -} else { -sg.cs.alignmentChanged (sg, this.hiddenRepSequences); -}} -}}, "jalview.schemes.ColourSchemeI"); -Clazz.overrideMethod (c$, "getGlobalColourScheme", -function () { -return this.globalColourScheme; -}); -Clazz.overrideMethod (c$, "setConservation", -function (cons) { -this.hconservation = cons; -}, "jalview.analysis.Conservation"); -Clazz.overrideMethod (c$, "getConsPercGaps", -function () { -return this.ConsPercGaps; -}); -Clazz.overrideMethod (c$, "setSequenceConsensusHash", -function (hconsensus) { -this.hconsensus = hconsensus; -}, "~A"); -Clazz.overrideMethod (c$, "setComplementConsensusHash", -function (hconsensus) { -this.hcomplementConsensus = hconsensus; -}, "~A"); -Clazz.overrideMethod (c$, "getSequenceConsensusHash", -function () { -return this.hconsensus; -}); -Clazz.overrideMethod (c$, "getComplementConsensusHash", -function () { -return this.hcomplementConsensus; -}); -Clazz.overrideMethod (c$, "getRnaStructureConsensusHash", -function () { -return this.hStrucConsensus; -}); -Clazz.overrideMethod (c$, "setRnaStructureConsensusHash", -function (hStrucConsensus) { -this.hStrucConsensus = hStrucConsensus; -}, "~A"); -Clazz.overrideMethod (c$, "getAlignmentQualityAnnot", -function () { -return this.quality; -}); -Clazz.overrideMethod (c$, "getAlignmentConservationAnnotation", -function () { -return this.conservation; -}); -Clazz.overrideMethod (c$, "getAlignmentConsensusAnnotation", -function () { -return this.consensus; -}); -Clazz.overrideMethod (c$, "getComplementConsensusAnnotation", -function () { -return this.complementConsensus; -}); -Clazz.overrideMethod (c$, "getAlignmentStrucConsensusAnnotation", -function () { -return this.strucConsensus; -}); -Clazz.defineMethod (c$, "updateConservation", -function (ap) { -if (this.alignment.isNucleotide () || this.conservation == null || !this.autoCalculateConsensus) { -return; -}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConservationThread) == null) { -this.calculator.registerWorker ( new jalview.workers.ConservationThread (this, ap)); -}}, "jalview.api.AlignmentViewPanel"); -Clazz.defineMethod (c$, "updateConsensus", -function (ap) { -if (this.consensus == null || !this.autoCalculateConsensus) { -return; -}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConsensusThread) == null) { -this.calculator.registerWorker ( new jalview.workers.ConsensusThread (this, ap)); -}var al = this.getAlignment (); -if (!al.isNucleotide () && al.getCodonFrames () != null && !al.getCodonFrames ().isEmpty ()) { -if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ComplementConsensusThread) == null) { -this.calculator.registerWorker ( new jalview.workers.ComplementConsensusThread (this, ap)); -}}}, "jalview.api.AlignmentViewPanel"); -Clazz.defineMethod (c$, "updateStrucConsensus", -function (ap) { -if (this.autoCalculateStrucConsensus && this.strucConsensus == null && this.alignment.isNucleotide () && this.alignment.hasRNAStructure ()) { -this.initRNAStructure (); -}if (this.strucConsensus == null || !this.autoCalculateStrucConsensus) { -return; -}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.StrucConsensusThread) == null) { -this.calculator.registerWorker ( new jalview.workers.StrucConsensusThread (this, ap)); -}}, "jalview.api.AlignmentViewPanel"); -Clazz.defineMethod (c$, "isCalcInProgress", -function () { -return this.calculator.isWorking (); -}); -Clazz.overrideMethod (c$, "isCalculationInProgress", -function (alignmentAnnotation) { -if (!alignmentAnnotation.autoCalculated) { -return false; -}if (this.calculator.workingInvolvedWith (alignmentAnnotation)) { -return true; -}return false; -}, "jalview.datamodel.AlignmentAnnotation"); -Clazz.overrideMethod (c$, "isClosed", -function () { -return this.alignment == null; -}); -Clazz.overrideMethod (c$, "getCalcManager", -function () { -return this.calculator; -}); -Clazz.overrideMethod (c$, "isShowSequenceLogo", -function () { -return this.showSequenceLogo; -}); -Clazz.defineMethod (c$, "setShowSequenceLogo", -function (showSequenceLogo) { -if (showSequenceLogo != this.showSequenceLogo) { -this.showSequenceLogo = showSequenceLogo; -this.calculator.updateAnnotationFor (jalview.workers.ConsensusThread); -this.calculator.updateAnnotationFor (jalview.workers.ComplementConsensusThread); -this.calculator.updateAnnotationFor (jalview.workers.StrucConsensusThread); -}this.showSequenceLogo = showSequenceLogo; -}, "~B"); -Clazz.defineMethod (c$, "setShowConsensusHistogram", -function (showConsensusHistogram) { -this.showConsensusHistogram = showConsensusHistogram; -}, "~B"); -Clazz.defineMethod (c$, "isShowGroupConservation", -function () { -return this.showGroupConservation; -}); -Clazz.defineMethod (c$, "setShowGroupConservation", -function (showGroupConservation) { -this.showGroupConservation = showGroupConservation; -}, "~B"); -Clazz.defineMethod (c$, "isShowGroupConsensus", -function () { -return this.showGroupConsensus; -}); -Clazz.defineMethod (c$, "setShowGroupConsensus", -function (showGroupConsensus) { -this.showGroupConsensus = showGroupConsensus; -}, "~B"); -Clazz.overrideMethod (c$, "isShowConsensusHistogram", -function () { -return this.showConsensusHistogram; -}); -Clazz.overrideMethod (c$, "getSelectionGroup", -function () { -return this.selectionGroup; -}); -Clazz.overrideMethod (c$, "setSelectionGroup", -function (sg) { -this.selectionGroup = sg; -}, "jalview.datamodel.SequenceGroup"); -Clazz.defineMethod (c$, "setHiddenColumns", -function (colsel) { -this.colSel = colsel; -}, "jalview.datamodel.ColumnSelection"); -Clazz.overrideMethod (c$, "getColumnSelection", -function () { -return this.colSel; -}); -Clazz.overrideMethod (c$, "setColumnSelection", -function (colSel) { -this.colSel = colSel; -if (colSel != null) { -this.updateHiddenColumns (); -}}, "jalview.datamodel.ColumnSelection"); -Clazz.overrideMethod (c$, "getHiddenRepSequences", -function () { -return this.hiddenRepSequences; -}); -Clazz.overrideMethod (c$, "setHiddenRepSequences", -function (hiddenRepSequences) { -this.hiddenRepSequences = hiddenRepSequences; -}, "java.util.Map"); -Clazz.overrideMethod (c$, "hasHiddenColumns", -function () { -return this.colSel != null && this.colSel.hasHiddenColumns (); -}); -Clazz.defineMethod (c$, "updateHiddenColumns", -function () { -}); -Clazz.overrideMethod (c$, "hasHiddenRows", -function () { -return this.alignment.getHiddenSequences ().getSize () > 0; -}); -Clazz.defineMethod (c$, "setSequenceSetId", -function (newid) { -if (this.sequenceSetID != null) { -System.err.println ("Warning - overwriting a sequenceSetId for a viewport!"); -}this.sequenceSetID = String.instantialize (newid); -}, "~S"); -Clazz.overrideMethod (c$, "getSequenceSetId", -function () { -if (this.sequenceSetID == null) { -this.sequenceSetID = this.alignment.hashCode () + ""; -}return this.sequenceSetID; -}); -Clazz.overrideMethod (c$, "getViewId", -function () { -if (this.viewId == null) { -this.viewId = this.getSequenceSetId () + "." + this.hashCode () + ""; -}return this.viewId; -}); -Clazz.defineMethod (c$, "setIgnoreGapsConsensus", -function (b, ap) { -this.ignoreGapsInConsensusCalculation = b; -if (ap != null) { -this.updateConsensus (ap); -if (this.globalColourScheme != null) { -this.globalColourScheme.setThreshold (this.globalColourScheme.getThreshold (), this.ignoreGapsInConsensusCalculation); -}}}, "~B,jalview.api.AlignmentViewPanel"); -Clazz.defineMethod (c$, "isSelectionGroupChanged", -function (b) { -var hc = (this.selectionGroup == null || this.selectionGroup.getSize () == 0) ? -1 : this.selectionGroup.hashCode (); -if (hc != -1 && hc != this.sgrouphash) { -if (b) { -this.sgrouphash = hc; -}return true; -}return false; -}, "~B"); -Clazz.defineMethod (c$, "isColSelChanged", -function (b) { -var hc = (this.colSel == null || this.colSel.size () == 0) ? -1 : this.colSel.hashCode (); -if (hc != -1 && hc != this.colselhash) { -if (b) { -this.colselhash = hc; -}return true; -}return false; -}, "~B"); -Clazz.overrideMethod (c$, "isIgnoreGapsConsensus", -function () { -return this.ignoreGapsInConsensusCalculation; -}); -Clazz.defineMethod (c$, "addPropertyChangeListener", -function (listener) { -this.changeSupport.addPropertyChangeListener (listener); -}, "java.beans.PropertyChangeListener"); -Clazz.defineMethod (c$, "removePropertyChangeListener", -function (listener) { -this.changeSupport.removePropertyChangeListener (listener); -}, "java.beans.PropertyChangeListener"); -Clazz.defineMethod (c$, "firePropertyChange", -function (prop, oldvalue, newvalue) { -this.changeSupport.firePropertyChange (prop, oldvalue, newvalue); -}, "~S,~O,~O"); -Clazz.defineMethod (c$, "hideSelectedColumns", -function () { -if (this.colSel.size () < 1) { -return; -}this.colSel.hideSelectedColumns (); -this.setSelectionGroup (null); -}); -Clazz.defineMethod (c$, "hideColumns", -function (start, end) { -if (start == end) { -this.colSel.hideColumns (start); -} else { -this.colSel.hideColumns (start, end); -}}, "~N,~N"); -Clazz.defineMethod (c$, "showColumn", -function (col) { -this.colSel.revealHiddenColumns (col); -}, "~N"); -Clazz.defineMethod (c$, "showAllHiddenColumns", -function () { -this.colSel.revealAllHiddenColumns (); -}); -Clazz.defineMethod (c$, "showAllHiddenSeqs", -function () { -if (this.alignment.getHiddenSequences ().getSize () > 0) { -if (this.selectionGroup == null) { -this.selectionGroup = new jalview.datamodel.SequenceGroup (); -this.selectionGroup.setEndRes (this.alignment.getWidth () - 1); -}var tmp = this.alignment.getHiddenSequences ().showAll (this.hiddenRepSequences); -for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) { -this.selectionGroup.addSequence (seq, false); -this.setSequenceAnnotationsVisible (seq, true); -} -this.hiddenRepSequences = null; -this.firePropertyChange ("alignment", null, this.alignment.getSequences ()); -this.sendSelection (); -}}); -Clazz.defineMethod (c$, "showSequence", -function (index) { -var tmp = this.alignment.getHiddenSequences ().showSequence (index, this.hiddenRepSequences); -if (tmp.size () > 0) { -if (this.selectionGroup == null) { -this.selectionGroup = new jalview.datamodel.SequenceGroup (); -this.selectionGroup.setEndRes (this.alignment.getWidth () - 1); -}for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) { -this.selectionGroup.addSequence (seq, false); -this.setSequenceAnnotationsVisible (seq, true); -} -this.firePropertyChange ("alignment", null, this.alignment.getSequences ()); -this.sendSelection (); -}}, "~N"); -Clazz.defineMethod (c$, "hideAllSelectedSeqs", -function () { -if (this.selectionGroup == null || this.selectionGroup.getSize () < 1) { -return; -}var seqs = this.selectionGroup.getSequencesInOrder (this.alignment); -this.hideSequence (seqs); -this.setSelectionGroup (null); -}); -Clazz.defineMethod (c$, "hideSequence", -function (seq) { -if (seq != null) { -for (var i = 0; i < seq.length; i++) { -this.alignment.getHiddenSequences ().hideSequence (seq[i]); -this.setSequenceAnnotationsVisible (seq[i], false); -} -this.firePropertyChange ("alignment", null, this.alignment.getSequences ()); -}}, "~A"); -Clazz.defineMethod (c$, "setSequenceAnnotationsVisible", -function (sequenceI, visible) { -for (var ann, $ann = 0, $$ann = this.alignment.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) { -if (ann.sequenceRef === sequenceI) { -ann.visible = visible; -}} -}, "jalview.datamodel.SequenceI,~B"); -Clazz.defineMethod (c$, "hideRepSequences", -function (repSequence, sg) { -var sSize = sg.getSize (); -if (sSize < 2) { -return; -}if (this.hiddenRepSequences == null) { -this.hiddenRepSequences = new java.util.Hashtable (); -}this.hiddenRepSequences.put (repSequence, sg); -var seqs = new Array (sSize - 1); -var index = 0; -for (var i = 0; i < sSize; i++) { -if (sg.getSequenceAt (i) !== repSequence) { -if (index == sSize - 1) { -return; -}seqs[index++] = sg.getSequenceAt (i); -}} -sg.setSeqrep (repSequence); -sg.setHidereps (true); -this.hideSequence (seqs); -}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup"); -Clazz.defineMethod (c$, "isHiddenRepSequence", -function (seq) { -return this.alignment.getSeqrep () === seq || (this.hiddenRepSequences != null && this.hiddenRepSequences.containsKey (seq)); -}, "jalview.datamodel.SequenceI"); -Clazz.defineMethod (c$, "getRepresentedSequences", -function (seq) { -return (this.hiddenRepSequences == null ? null : this.hiddenRepSequences.get (seq)); -}, "jalview.datamodel.SequenceI"); -Clazz.overrideMethod (c$, "adjustForHiddenSeqs", -function (alignmentIndex) { -return this.alignment.getHiddenSequences ().adjustForHiddenSeqs (alignmentIndex); -}, "~N"); -Clazz.overrideMethod (c$, "invertColumnSelection", -function () { -this.colSel.invertColumnSelection (0, this.alignment.getWidth ()); -}); -Clazz.overrideMethod (c$, "getSelectionAsNewSequence", -function () { -var sequences; -if (this.selectionGroup == null || this.selectionGroup.getSize () == 0) { -sequences = this.alignment.getSequencesArray (); -var annots = this.alignment.getAlignmentAnnotation (); -for (var i = 0; i < sequences.length; i++) { -sequences[i] = new jalview.datamodel.Sequence (sequences[i], annots); -} -} else { -sequences = this.selectionGroup.getSelectionAsNewSequences (this.alignment); -}return sequences; -}); -Clazz.overrideMethod (c$, "getSequenceSelection", -function () { -var sequences = null; -if (this.selectionGroup != null) { -sequences = this.selectionGroup.getSequencesInOrder (this.alignment); -}if (sequences == null) { -sequences = this.alignment.getSequencesArray (); -}return sequences; -}); -Clazz.overrideMethod (c$, "getViewAsCigars", -function (selectedRegionOnly) { -return new jalview.datamodel.CigarArray (this.alignment, this.colSel, (selectedRegionOnly ? this.selectionGroup : null)); -}, "~B"); -Clazz.defineMethod (c$, "getAlignmentView", -function (selectedOnly) { -return this.getAlignmentView (selectedOnly, false); -}, "~B"); -Clazz.defineMethod (c$, "getAlignmentView", -function (selectedOnly, markGroups) { -return new jalview.datamodel.AlignmentView (this.alignment, this.colSel, this.selectionGroup, this.colSel != null && this.colSel.hasHiddenColumns (), selectedOnly, markGroups); -}, "~B,~B"); -Clazz.overrideMethod (c$, "getViewAsString", -function (selectedRegionOnly) { -var selection = null; -var seqs = null; -var i; -var iSize; -var start = 0; -var end = 0; -if (selectedRegionOnly && this.selectionGroup != null) { -iSize = this.selectionGroup.getSize (); -seqs = this.selectionGroup.getSequencesInOrder (this.alignment); -start = this.selectionGroup.getStartRes (); -end = this.selectionGroup.getEndRes () + 1; -} else { -iSize = this.alignment.getHeight (); -seqs = this.alignment.getSequencesArray (); -end = this.alignment.getWidth (); -}selection = new Array (iSize); -if (this.colSel != null && this.colSel.hasHiddenColumns ()) { -selection = this.colSel.getVisibleSequenceStrings (start, end, seqs); -} else { -for (i = 0; i < iSize; i++) { -selection[i] = seqs[i].getSequenceAsString (start, end); -} -}return selection; -}, "~B"); -Clazz.overrideMethod (c$, "getVisibleRegionBoundaries", -function (min, max) { -var regions = new java.util.ArrayList (); -var start = min; -var end = max; -do { -if (this.colSel != null && this.colSel.hasHiddenColumns ()) { -if (start == 0) { -start = this.colSel.adjustForHiddenColumns (start); -}end = this.colSel.getHiddenBoundaryRight (start); -if (start == end) { -end = max; -}if (end > max) { -end = max; -}}regions.add ( Clazz.newIntArray (-1, [start, end])); -if (this.colSel != null && this.colSel.hasHiddenColumns ()) { -start = this.colSel.adjustForHiddenColumns (end); -start = this.colSel.getHiddenBoundaryLeft (start) + 1; -}} while (end < max); -var startEnd = Clazz.newIntArray (regions.size (), 2, 0); -return regions; -}, "~N,~N"); -Clazz.overrideMethod (c$, "getVisibleAlignmentAnnotation", -function (selectedOnly) { -var ala = new java.util.ArrayList (); -var aa; -if ((aa = this.alignment.getAlignmentAnnotation ()) != null) { -for (var annot, $annot = 0, $$annot = aa; $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) { -var clone = new jalview.datamodel.AlignmentAnnotation (annot); -if (selectedOnly && this.selectionGroup != null) { -this.colSel.makeVisibleAnnotation (this.selectionGroup.getStartRes (), this.selectionGroup.getEndRes (), clone); -} else { -this.colSel.makeVisibleAnnotation (clone); -}ala.add (clone); -} -}return ala; -}, "~B"); -Clazz.overrideMethod (c$, "isPadGaps", -function () { -return this.padGaps; -}); -Clazz.overrideMethod (c$, "setPadGaps", -function (padGaps) { -this.padGaps = padGaps; -}, "~B"); -Clazz.overrideMethod (c$, "alignmentChanged", -function (ap) { -if (this.isPadGaps ()) { -this.alignment.padGaps (); -}if (this.autoCalculateConsensus) { -this.updateConsensus (ap); -}if (this.hconsensus != null && this.autoCalculateConsensus) { -this.updateConservation (ap); -}if (this.autoCalculateStrucConsensus) { -this.updateStrucConsensus (ap); -}var alWidth = this.alignment.getWidth (); -var groups = this.alignment.getGroups (); -if (groups != null) { -for (var sg, $sg = groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { -if (sg.getEndRes () > alWidth) { -sg.setEndRes (alWidth - 1); -}} -}if (this.selectionGroup != null && this.selectionGroup.getEndRes () > alWidth) { -this.selectionGroup.setEndRes (alWidth - 1); -}this.resetAllColourSchemes (); -this.calculator.restartWorkers (); -}, "jalview.api.AlignmentViewPanel"); -Clazz.defineMethod (c$, "resetAllColourSchemes", -function () { -var cs = this.globalColourScheme; -if (cs != null) { -cs.alignmentChanged (this.alignment, this.hiddenRepSequences); -cs.setConsensus (this.hconsensus); -if (cs.conservationApplied ()) { -cs.setConservation (jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.alignment.getWidth (), false, this.getConsPercGaps (), false)); -}}for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { -if (sg.cs != null) { -sg.cs.alignmentChanged (sg, this.hiddenRepSequences); -}sg.recalcConservation (); -} -}); -Clazz.defineMethod (c$, "initAutoAnnotation", -function () { -if (this.hconsensus == null && !this.$isDataset) { -if (!this.alignment.isNucleotide ()) { -this.initConservation (); -this.initQuality (); -} else { -this.initRNAStructure (); -}this.consensus = new jalview.datamodel.AlignmentAnnotation ("Consensus", "PID", new Array (1), 0, 100, 1); -this.initConsensus (this.consensus); -this.initComplementConsensus (); -}}); -Clazz.defineMethod (c$, "initComplementConsensus", -function () { -if (!this.alignment.isNucleotide ()) { -var codonMappings = this.alignment.getCodonFrames (); -if (codonMappings != null && !codonMappings.isEmpty ()) { -this.complementConsensus = new jalview.datamodel.AlignmentAnnotation ("cDNA Consensus", "PID for cDNA", new Array (1), 0, 100, 1); -this.initConsensus (this.complementConsensus); -}}}); -Clazz.defineMethod (c$, "initConsensus", -($fz = function (aa) { -aa.hasText = true; -aa.autoCalculated = true; -if (this.showConsensus) { -this.alignment.addAnnotation (aa); -}}, $fz.isPrivate = true, $fz), "jalview.datamodel.AlignmentAnnotation"); -Clazz.defineMethod (c$, "initConservation", -($fz = function () { -if (this.showConservation) { -if (this.conservation == null) { -this.conservation = new jalview.datamodel.AlignmentAnnotation ("Conservation", "Conservation of total alignment less than " + this.getConsPercGaps () + "% gaps", new Array (1), 0, 11, 1); -this.conservation.hasText = true; -this.conservation.autoCalculated = true; -this.alignment.addAnnotation (this.conservation); -}}}, $fz.isPrivate = true, $fz)); -Clazz.defineMethod (c$, "initQuality", -($fz = function () { -if (this.showQuality) { -if (this.quality == null) { -this.quality = new jalview.datamodel.AlignmentAnnotation ("Quality", "Alignment Quality based on Blosum62 scores", new Array (1), 0, 11, 1); -this.quality.hasText = true; -this.quality.autoCalculated = true; -this.alignment.addAnnotation (this.quality); -}}}, $fz.isPrivate = true, $fz)); -Clazz.defineMethod (c$, "initRNAStructure", -($fz = function () { -if (this.alignment.hasRNAStructure () && this.strucConsensus == null) { -this.strucConsensus = new jalview.datamodel.AlignmentAnnotation ("StrucConsensus", "PID", new Array (1), 0, 100, 1); -this.strucConsensus.hasText = true; -this.strucConsensus.autoCalculated = true; -if (this.showConsensus) { -this.alignment.addAnnotation (this.strucConsensus); -}}}, $fz.isPrivate = true, $fz)); -Clazz.overrideMethod (c$, "calcPanelHeight", -function () { -var anns = this.getAlignment ().getAlignmentAnnotation (); -var height = 0; -var charHeight = this.getCharHeight (); -if (anns != null) { -var graphgrp = new java.util.BitSet (); -for (var aa, $aa = 0, $$aa = anns; $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) { -if (aa == null) { -System.err.println ("Null annotation row: ignoring."); -continue; -}if (!aa.visible) { -continue; -}if (aa.graphGroup > -1) { -if (graphgrp.get (aa.graphGroup)) { -continue; -} else { -graphgrp.set (aa.graphGroup); -}}aa.height = 0; -if (aa.hasText) { -aa.height += charHeight; -}if (aa.hasIcons) { -aa.height += 16; -}if (aa.graph > 0) { -aa.height += aa.graphHeight; -}if (aa.height == 0) { -aa.height = 20; -}height += aa.height; -} -}if (height == 0) { -height = 20; -}return height; -}); -Clazz.overrideMethod (c$, "updateGroupAnnotationSettings", -function (applyGlobalSettings, preserveNewGroupSettings) { -var updateCalcs = false; -var conv = this.isShowGroupConservation (); -var cons = this.isShowGroupConsensus (); -var showprf = this.isShowSequenceLogo (); -var showConsHist = this.isShowConsensusHistogram (); -var normLogo = this.isNormaliseSequenceLogo (); -var sortg = true; -var aan = this.alignment.getAlignmentAnnotation (); -var oldrfs = new java.util.ArrayList (); -if (aan != null) { -for (var an = 0; an < aan.length; an++) { -if (aan[an].autoCalculated && aan[an].groupRef != null) { -oldrfs.add (aan[an].groupRef); -this.alignment.deleteAnnotation (aan[an], false); -}} -}if (this.alignment.getGroups () != null) { -for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { -updateCalcs = false; -if (applyGlobalSettings || (!preserveNewGroupSettings && !oldrfs.contains (sg))) { -sg.setshowSequenceLogo (showprf); -sg.setShowConsensusHistogram (showConsHist); -sg.setNormaliseSequenceLogo (normLogo); -}if (conv) { -updateCalcs = true; -this.alignment.addAnnotation (sg.getConservationRow (), 0); -}if (cons) { -updateCalcs = true; -this.alignment.addAnnotation (sg.getConsensus (), 0); -}if (updateCalcs) { -sg.recalcConservation (); -}} -}oldrfs.clear (); -}, "~B,~B"); -Clazz.defineMethod (c$, "isDisplayReferenceSeq", -function () { -return this.alignment.hasSeqrep () && this.viewStyle.isDisplayReferenceSeq (); -}); -Clazz.defineMethod (c$, "setDisplayReferenceSeq", -function (displayReferenceSeq) { -this.viewStyle.setDisplayReferenceSeq (displayReferenceSeq); -}, "~B"); -Clazz.defineMethod (c$, "isColourByReferenceSeq", -function () { -return this.alignment.hasSeqrep () && this.viewStyle.isColourByReferenceSeq (); -}); -Clazz.overrideMethod (c$, "getSequenceColour", -function (seq) { -var sqc = this.sequenceColours.get (seq); -return (sqc == null ? java.awt.Color.white : sqc); -}, "jalview.datamodel.SequenceI"); -Clazz.overrideMethod (c$, "setSequenceColour", -function (seq, col) { -if (col == null) { -this.sequenceColours.remove (seq); -} else { -this.sequenceColours.put (seq, col); -}}, "jalview.datamodel.SequenceI,java.awt.Color"); -Clazz.overrideMethod (c$, "updateSequenceIdColours", -function () { -for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { -if (sg.idColour != null) { -for (var s, $s = sg.getSequences (this.getHiddenRepSequences ()).iterator (); $s.hasNext () && ((s = $s.next ()) || true);) { -this.sequenceColours.put (s, sg.idColour); -} -}} -}); -Clazz.overrideMethod (c$, "clearSequenceColours", -function () { -this.sequenceColours.clear (); -}); -Clazz.defineMethod (c$, "getCodingComplement", -function () { -return this.codingComplement; -}); -Clazz.defineMethod (c$, "setCodingComplement", -function (av) { -if (this === av) { -System.err.println ("Ignoring recursive setCodingComplement request"); -} else { -this.codingComplement = av; -if (av.getCodingComplement () !== this) { -av.setCodingComplement (this); -}}}, "jalview.api.AlignViewportI"); -Clazz.overrideMethod (c$, "isNucleotide", -function () { -return this.getAlignment () == null ? false : this.getAlignment ().isNucleotide (); -}); -Clazz.overrideMethod (c$, "getFeaturesDisplayed", -function () { -return this.featuresDisplayed; -}); -Clazz.overrideMethod (c$, "setFeaturesDisplayed", -function (featuresDisplayedI) { -this.featuresDisplayed = featuresDisplayedI; -}, "jalview.api.FeaturesDisplayedI"); -Clazz.overrideMethod (c$, "areFeaturesDisplayed", -function () { -return this.featuresDisplayed != null && this.featuresDisplayed.getRegisterdFeaturesCount () > 0; -}); -Clazz.defineMethod (c$, "setShowSequenceFeatures", -function (b) { -this.viewStyle.setShowSequenceFeatures (b); -}, "~B"); -Clazz.defineMethod (c$, "isShowSequenceFeatures", -function () { -return this.viewStyle.isShowSequenceFeatures (); -}); -Clazz.defineMethod (c$, "setShowSequenceFeaturesHeight", -function (selected) { -this.viewStyle.setShowSequenceFeaturesHeight (selected); -}, "~B"); -Clazz.defineMethod (c$, "isShowSequenceFeaturesHeight", -function () { -return this.viewStyle.isShowSequenceFeaturesHeight (); -}); -Clazz.defineMethod (c$, "setShowAnnotation", -function (b) { -this.viewStyle.setShowAnnotation (b); -}, "~B"); -Clazz.defineMethod (c$, "isShowAnnotation", -function () { -return this.viewStyle.isShowAnnotation (); -}); -Clazz.defineMethod (c$, "isRightAlignIds", -function () { -return this.viewStyle.isRightAlignIds (); -}); -Clazz.defineMethod (c$, "setRightAlignIds", -function (rightAlignIds) { -this.viewStyle.setRightAlignIds (rightAlignIds); -}, "~B"); -Clazz.defineMethod (c$, "getConservationSelected", -function () { -return this.viewStyle.getConservationSelected (); -}); -Clazz.defineMethod (c$, "setShowBoxes", -function (state) { -this.viewStyle.setShowBoxes (state); -}, "~B"); -Clazz.defineMethod (c$, "getTextColour", -function () { -return this.viewStyle.getTextColour (); -}); -Clazz.defineMethod (c$, "getTextColour2", -function () { -return this.viewStyle.getTextColour2 (); -}); -Clazz.defineMethod (c$, "getThresholdTextColour", -function () { -return this.viewStyle.getThresholdTextColour (); -}); -Clazz.defineMethod (c$, "isConservationColourSelected", -function () { -return this.viewStyle.isConservationColourSelected (); -}); -Clazz.defineMethod (c$, "isRenderGaps", -function () { -return this.viewStyle.isRenderGaps (); -}); -Clazz.defineMethod (c$, "isShowColourText", -function () { -return this.viewStyle.isShowColourText (); -}); -Clazz.defineMethod (c$, "setConservationColourSelected", -function (conservationColourSelected) { -this.viewStyle.setConservationColourSelected (conservationColourSelected); -}, "~B"); -Clazz.defineMethod (c$, "setShowColourText", -function (showColourText) { -this.viewStyle.setShowColourText (showColourText); -}, "~B"); -Clazz.defineMethod (c$, "setTextColour", -function (textColour) { -this.viewStyle.setTextColour (textColour); -}, "java.awt.Color"); -Clazz.defineMethod (c$, "setThresholdTextColour", -function (thresholdTextColour) { -this.viewStyle.setThresholdTextColour (thresholdTextColour); -}, "~N"); -Clazz.defineMethod (c$, "setTextColour2", -function (textColour2) { -this.viewStyle.setTextColour2 (textColour2); -}, "java.awt.Color"); -Clazz.overrideMethod (c$, "getViewStyle", -function () { -return new jalview.viewmodel.styles.ViewStyle (this.viewStyle); -}); -Clazz.overrideMethod (c$, "setViewStyle", -function (settingsForView) { -this.viewStyle = new jalview.viewmodel.styles.ViewStyle (settingsForView); -}, "jalview.api.ViewStyleI"); -Clazz.defineMethod (c$, "sameStyle", -function (them) { -return this.viewStyle.sameStyle (them); -}, "jalview.api.ViewStyleI"); -Clazz.defineMethod (c$, "getIdWidth", -function () { -return this.viewStyle.getIdWidth (); -}); -Clazz.defineMethod (c$, "setIdWidth", -function (i) { -this.viewStyle.setIdWidth (i); -}, "~N"); -Clazz.defineMethod (c$, "isCentreColumnLabels", -function () { -return this.viewStyle.isCentreColumnLabels (); -}); -Clazz.defineMethod (c$, "setCentreColumnLabels", -function (centreColumnLabels) { -this.viewStyle.setCentreColumnLabels (centreColumnLabels); -}, "~B"); -Clazz.defineMethod (c$, "setShowDBRefs", -function (showdbrefs) { -this.viewStyle.setShowDBRefs (showdbrefs); -}, "~B"); -Clazz.defineMethod (c$, "isShowDBRefs", -function () { -return this.viewStyle.isShowDBRefs (); -}); -Clazz.defineMethod (c$, "isShowNPFeats", -function () { -return this.viewStyle.isShowNPFeats (); -}); -Clazz.defineMethod (c$, "setShowNPFeats", -function (shownpfeats) { -this.viewStyle.setShowNPFeats (shownpfeats); -}, "~B"); -Clazz.defineMethod (c$, "addToHistoryList", -function (command) { -if (this.historyList != null) { -this.historyList.push (command); -this.broadcastCommand (command, false); -}}, "jalview.commands.CommandI"); -Clazz.defineMethod (c$, "broadcastCommand", -function (command, undo) { -this.getStructureSelectionManager ().commandPerformed (command, undo, this.getVamsasSource ()); -}, "jalview.commands.CommandI,~B"); -Clazz.defineMethod (c$, "addToRedoList", -function (command) { -if (this.redoList != null) { -this.redoList.push (command); -}this.broadcastCommand (command, true); -}, "jalview.commands.CommandI"); -Clazz.defineMethod (c$, "clearRedoList", -function () { -if (this.redoList != null) { -this.redoList.clear (); -}}); -Clazz.defineMethod (c$, "setHistoryList", -function (list) { -this.historyList = list; -}, "java.util.Deque"); -Clazz.defineMethod (c$, "getHistoryList", -function () { -return this.historyList; -}); -Clazz.defineMethod (c$, "setRedoList", -function (list) { -this.redoList = list; -}, "java.util.Deque"); -Clazz.defineMethod (c$, "getRedoList", -function () { -return this.redoList; -}); -Clazz.overrideMethod (c$, "getVamsasSource", -function () { -return this; -}); -Clazz.defineMethod (c$, "getSortAnnotationsBy", -function () { -return this.sortAnnotationsBy; -}); -Clazz.defineMethod (c$, "setSortAnnotationsBy", -function (sortAnnotationsBy) { -this.sortAnnotationsBy = sortAnnotationsBy; -}, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder"); -Clazz.defineMethod (c$, "isShowAutocalculatedAbove", -function () { -return this.showAutocalculatedAbove; -}); -Clazz.defineMethod (c$, "setShowAutocalculatedAbove", -function (showAutocalculatedAbove) { -this.showAutocalculatedAbove = showAutocalculatedAbove; -}, "~B"); -Clazz.defineMethod (c$, "isScaleProteinAsCdna", -function () { -return this.viewStyle.isScaleProteinAsCdna (); -}); -Clazz.defineMethod (c$, "setScaleProteinAsCdna", -function (b) { -this.viewStyle.setScaleProteinAsCdna (b); -}, "~B"); -Clazz.defineMethod (c$, "isFollowHighlight", -function () { -return this.followHighlight; -}); -Clazz.overrideMethod (c$, "setFollowHighlight", -function (b) { -this.followHighlight = b; -}, "~B"); -Clazz.defineMethod (c$, "getStartRes", -function () { -return this.startRes; -}); -Clazz.overrideMethod (c$, "getEndRes", -function () { -return this.endRes; -}); -Clazz.defineMethod (c$, "getStartSeq", -function () { -return this.startSeq; -}); -Clazz.defineMethod (c$, "setStartRes", -function (res) { -this.startRes = res; -}, "~N"); -Clazz.defineMethod (c$, "setStartSeq", -function (seq) { -this.startSeq = seq; -}, "~N"); -Clazz.defineMethod (c$, "setEndRes", -function (res) { -if (res > this.alignment.getWidth () - 1) { -res = this.alignment.getWidth () - 1; -}if (res < 0) { -res = 0; -}this.endRes = res; -}, "~N"); -Clazz.defineMethod (c$, "setEndSeq", -function (seq) { -if (seq > this.alignment.getHeight ()) { -seq = this.alignment.getHeight (); -}if (seq < 0) { -seq = 0; -}this.endSeq = seq; -}, "~N"); -Clazz.defineMethod (c$, "getEndSeq", -function () { -return this.endSeq; -}); -Clazz.defineMethod (c$, "findComplementScrollTarget", -function (sr) { -var complement = this.getCodingComplement (); -if (complement == null || !complement.isFollowHighlight ()) { -return 0; -}var iAmProtein = !this.getAlignment ().isNucleotide (); -var proteinAlignment = iAmProtein ? this.getAlignment () : complement.getAlignment (); -if (proteinAlignment == null) { -return 0; -}var mappings = proteinAlignment.getCodonFrames (); -var seqOffset = 0; -var sequence = null; -var middleColumn = this.getStartRes () + Clazz.doubleToInt ((this.getEndRes () - this.getStartRes ()) / 2); -var hiddenSequences = this.getAlignment ().getHiddenSequences (); -for (var seqNo = this.getStartSeq (); seqNo < this.getEndSeq (); seqNo++, seqOffset++) { -sequence = this.getAlignment ().getSequenceAt (seqNo); -if (hiddenSequences != null && hiddenSequences.isHidden (sequence)) { -continue; -}if (jalview.util.Comparison.isGap (sequence.getCharAt (middleColumn))) { -continue; -}var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (sequence, mappings); -if (!seqMappings.isEmpty ()) { -break; -}} -if (sequence == null) { -return 0; -}jalview.util.MappingUtils.addSearchResults (sr, sequence, sequence.findPosition (middleColumn), mappings); -return seqOffset; -}, "jalview.datamodel.SearchResults"); -}); +Clazz.declarePackage ("jalview.viewmodel"); +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 () { +c$ = Clazz.decorateAsClass (function () { +this.viewStyle = null; +this.codingComplement = null; +this.featuresDisplayed = null; +this.historyList = null; +this.redoList = null; +this.alignment = null; +this.sequenceSetID = null; +this.$isDataset = false; +this.hiddenRepSequences = null; +this.colSel = null; +this.autoCalculateConsensus = true; +this.autoCalculateStrucConsensus = true; +this.ignoreGapsInConsensusCalculation = false; +this.globalColourScheme = null; +this.consensus = null; +this.complementConsensus = null; +this.strucConsensus = null; +this.conservation = null; +this.quality = null; +this.groupConsensus = null; +this.groupConservation = null; +this.hconsensus = null; +this.hcomplementConsensus = null; +this.hStrucConsensus = null; +this.hconservation = null; +this.ConsPercGaps = 25; +this.calculator = null; +this.showGroupConservation = false; +this.showGroupConsensus = false; +this.showSequenceLogo = false; +this.normaliseSequenceLogo = false; +this.showConsensusHistogram = true; +this.padGaps = false; +this.sortByTree = false; +this.selectionGroup = null; +this.viewId = null; +this.sgrouphash = -1; +this.colselhash = -1; +this.changeSupport = null; +this.showConservation = true; +this.showQuality = true; +this.showConsensus = true; +this.sequenceColours = null; +this.sortAnnotationsBy = null; +this.showAutocalculatedAbove = false; +this.followHighlight = true; +this.startRes = 0; +this.endRes = 0; +this.startSeq = 0; +this.endSeq = 0; +Clazz.instantialize (this, arguments); +}, jalview.viewmodel, "AlignmentViewport", null, [jalview.api.AlignViewportI, jalview.structure.CommandListener, jalview.structure.VamsasSource]); +Clazz.prepareFields (c$, function () { +this.viewStyle = new jalview.viewmodel.styles.ViewStyle (); +this.historyList = new java.util.ArrayDeque (); +this.redoList = new java.util.ArrayDeque (); +this.colSel = new jalview.datamodel.ColumnSelection (); +this.calculator = new jalview.workers.AlignCalcManager (); +this.changeSupport = new java.beans.PropertyChangeSupport (this); +this.sequenceColours = new java.util.HashMap (); +}); +Clazz.defineMethod (c$, "setFontName", +function (name) { +this.viewStyle.setFontName (name); +}, "~S"); +Clazz.defineMethod (c$, "setFontStyle", +function (style) { +this.viewStyle.setFontStyle (style); +}, "~N"); +Clazz.defineMethod (c$, "setFontSize", +function (size) { +this.viewStyle.setFontSize (size); +}, "~N"); +Clazz.defineMethod (c$, "getFontStyle", +function () { +return this.viewStyle.getFontStyle (); +}); +Clazz.defineMethod (c$, "getFontName", +function () { +return this.viewStyle.getFontName (); +}); +Clazz.defineMethod (c$, "getFontSize", +function () { +return this.viewStyle.getFontSize (); +}); +Clazz.defineMethod (c$, "setUpperCasebold", +function (upperCasebold) { +this.viewStyle.setUpperCasebold (upperCasebold); +}, "~B"); +Clazz.defineMethod (c$, "isUpperCasebold", +function () { +return this.viewStyle.isUpperCasebold (); +}); +Clazz.defineMethod (c$, "isSeqNameItalics", +function () { +return this.viewStyle.isSeqNameItalics (); +}); +Clazz.defineMethod (c$, "setColourByReferenceSeq", +function (colourByReferenceSeq) { +this.viewStyle.setColourByReferenceSeq (colourByReferenceSeq); +}, "~B"); +Clazz.defineMethod (c$, "setColourAppliesToAllGroups", +function (b) { +this.viewStyle.setColourAppliesToAllGroups (b); +}, "~B"); +Clazz.defineMethod (c$, "getColourAppliesToAllGroups", +function () { +return this.viewStyle.getColourAppliesToAllGroups (); +}); +Clazz.defineMethod (c$, "getAbovePIDThreshold", +function () { +return this.viewStyle.getAbovePIDThreshold (); +}); +Clazz.defineMethod (c$, "setIncrement", +function (inc) { +this.viewStyle.setIncrement (inc); +}, "~N"); +Clazz.defineMethod (c$, "getIncrement", +function () { +return this.viewStyle.getIncrement (); +}); +Clazz.defineMethod (c$, "setConservationSelected", +function (b) { +this.viewStyle.setConservationSelected (b); +}, "~B"); +Clazz.defineMethod (c$, "setShowHiddenMarkers", +function (show) { +this.viewStyle.setShowHiddenMarkers (show); +}, "~B"); +Clazz.defineMethod (c$, "getShowHiddenMarkers", +function () { +return this.viewStyle.getShowHiddenMarkers (); +}); +Clazz.defineMethod (c$, "setScaleRightWrapped", +function (b) { +this.viewStyle.setScaleRightWrapped (b); +}, "~B"); +Clazz.defineMethod (c$, "setScaleLeftWrapped", +function (b) { +this.viewStyle.setScaleLeftWrapped (b); +}, "~B"); +Clazz.defineMethod (c$, "setScaleAboveWrapped", +function (b) { +this.viewStyle.setScaleAboveWrapped (b); +}, "~B"); +Clazz.defineMethod (c$, "getScaleLeftWrapped", +function () { +return this.viewStyle.getScaleLeftWrapped (); +}); +Clazz.defineMethod (c$, "getScaleAboveWrapped", +function () { +return this.viewStyle.getScaleAboveWrapped (); +}); +Clazz.defineMethod (c$, "getScaleRightWrapped", +function () { +return this.viewStyle.getScaleRightWrapped (); +}); +Clazz.defineMethod (c$, "setAbovePIDThreshold", +function (b) { +this.viewStyle.setAbovePIDThreshold (b); +}, "~B"); +Clazz.defineMethod (c$, "setThreshold", +function (thresh) { +this.viewStyle.setThreshold (thresh); +}, "~N"); +Clazz.defineMethod (c$, "getThreshold", +function () { +return this.viewStyle.getThreshold (); +}); +Clazz.defineMethod (c$, "getShowJVSuffix", +function () { +return this.viewStyle.getShowJVSuffix (); +}); +Clazz.defineMethod (c$, "setShowJVSuffix", +function (b) { +this.viewStyle.setShowJVSuffix (b); +}, "~B"); +Clazz.defineMethod (c$, "setWrapAlignment", +function (state) { +this.viewStyle.setWrapAlignment (state); +}, "~B"); +Clazz.defineMethod (c$, "setShowText", +function (state) { +this.viewStyle.setShowText (state); +}, "~B"); +Clazz.defineMethod (c$, "setRenderGaps", +function (state) { +this.viewStyle.setRenderGaps (state); +}, "~B"); +Clazz.defineMethod (c$, "getColourText", +function () { +return this.viewStyle.getColourText (); +}); +Clazz.defineMethod (c$, "setColourText", +function (state) { +this.viewStyle.setColourText (state); +}, "~B"); +Clazz.defineMethod (c$, "getWrapAlignment", +function () { +return this.viewStyle.getWrapAlignment (); +}); +Clazz.defineMethod (c$, "getShowText", +function () { +return this.viewStyle.getShowText (); +}); +Clazz.defineMethod (c$, "getWrappedWidth", +function () { +return this.viewStyle.getWrappedWidth (); +}); +Clazz.defineMethod (c$, "setWrappedWidth", +function (w) { +this.viewStyle.setWrappedWidth (w); +}, "~N"); +Clazz.defineMethod (c$, "getCharHeight", +function () { +return this.viewStyle.getCharHeight (); +}); +Clazz.defineMethod (c$, "setCharHeight", +function (h) { +this.viewStyle.setCharHeight (h); +}, "~N"); +Clazz.defineMethod (c$, "getCharWidth", +function () { +return this.viewStyle.getCharWidth (); +}); +Clazz.defineMethod (c$, "setCharWidth", +function (w) { +this.viewStyle.setCharWidth (w); +}, "~N"); +Clazz.defineMethod (c$, "getShowBoxes", +function () { +return this.viewStyle.getShowBoxes (); +}); +Clazz.defineMethod (c$, "getShowUnconserved", +function () { +return this.viewStyle.getShowUnconserved (); +}); +Clazz.defineMethod (c$, "setShowUnconserved", +function (showunconserved) { +this.viewStyle.setShowUnconserved (showunconserved); +}, "~B"); +Clazz.defineMethod (c$, "setSeqNameItalics", +function (default1) { +this.viewStyle.setSeqNameItalics (default1); +}, "~B"); +Clazz.defineMethod (c$, "getAlignment", +function () { +return this.alignment; +}); +Clazz.overrideMethod (c$, "getGapCharacter", +function () { +return this.alignment.getGapCharacter (); +}); +Clazz.defineMethod (c$, "setDataset", +function (b) { +this.$isDataset = b; +}, "~B"); +Clazz.defineMethod (c$, "isDataset", +function () { +return this.$isDataset; +}); +Clazz.overrideMethod (c$, "setGlobalColourScheme", +function (cs) { +this.globalColourScheme = cs; +var recalc = false; +if (cs != null) { +cs.setConservationApplied (recalc = this.getConservationSelected ()); +if (this.getAbovePIDThreshold () || Clazz.instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz.instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) { +recalc = true; +cs.setThreshold (this.viewStyle.getThreshold (), this.ignoreGapsInConsensusCalculation); +} else { +cs.setThreshold (0, this.ignoreGapsInConsensusCalculation); +}if (recalc) { +cs.setConsensus (this.hconsensus); +cs.setConservation (this.hconservation); +}cs.alignmentChanged (this.alignment, this.hiddenRepSequences); +}if (this.getColourAppliesToAllGroups ()) { +for (var sg, $sg = this.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { +if (cs == null) { +sg.cs = null; +continue; +}sg.cs = cs.applyTo (sg, this.getHiddenRepSequences ()); +sg.setConsPercGaps (this.ConsPercGaps); +if (this.getAbovePIDThreshold () || Clazz.instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz.instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) { +sg.cs.setThreshold (this.viewStyle.getThreshold (), this.isIgnoreGapsConsensus ()); +recalc = true; +} else { +sg.cs.setThreshold (0, this.isIgnoreGapsConsensus ()); +}if (this.getConservationSelected ()) { +sg.cs.setConservationApplied (true); +recalc = true; +} else { +sg.cs.setConservation (null); +}if (recalc) { +sg.recalcConservation (); +} else { +sg.cs.alignmentChanged (sg, this.hiddenRepSequences); +}} +}}, "jalview.schemes.ColourSchemeI"); +Clazz.overrideMethod (c$, "getGlobalColourScheme", +function () { +return this.globalColourScheme; +}); +Clazz.overrideMethod (c$, "setConservation", +function (cons) { +this.hconservation = cons; +}, "jalview.analysis.Conservation"); +Clazz.overrideMethod (c$, "getConsPercGaps", +function () { +return this.ConsPercGaps; +}); +Clazz.overrideMethod (c$, "setSequenceConsensusHash", +function (hconsensus) { +this.hconsensus = hconsensus; +}, "~A"); +Clazz.overrideMethod (c$, "setComplementConsensusHash", +function (hconsensus) { +this.hcomplementConsensus = hconsensus; +}, "~A"); +Clazz.overrideMethod (c$, "getSequenceConsensusHash", +function () { +return this.hconsensus; +}); +Clazz.overrideMethod (c$, "getComplementConsensusHash", +function () { +return this.hcomplementConsensus; +}); +Clazz.overrideMethod (c$, "getRnaStructureConsensusHash", +function () { +return this.hStrucConsensus; +}); +Clazz.overrideMethod (c$, "setRnaStructureConsensusHash", +function (hStrucConsensus) { +this.hStrucConsensus = hStrucConsensus; +}, "~A"); +Clazz.overrideMethod (c$, "getAlignmentQualityAnnot", +function () { +return this.quality; +}); +Clazz.overrideMethod (c$, "getAlignmentConservationAnnotation", +function () { +return this.conservation; +}); +Clazz.overrideMethod (c$, "getAlignmentConsensusAnnotation", +function () { +return this.consensus; +}); +Clazz.overrideMethod (c$, "getComplementConsensusAnnotation", +function () { +return this.complementConsensus; +}); +Clazz.overrideMethod (c$, "getAlignmentStrucConsensusAnnotation", +function () { +return this.strucConsensus; +}); +Clazz.defineMethod (c$, "updateConservation", +function (ap) { +if (this.alignment.isNucleotide () || this.conservation == null || !this.autoCalculateConsensus) { +return; +}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConservationThread) == null) { +this.calculator.registerWorker ( new jalview.workers.ConservationThread (this, ap)); +}}, "jalview.api.AlignmentViewPanel"); +Clazz.defineMethod (c$, "updateConsensus", +function (ap) { +if (this.consensus == null || !this.autoCalculateConsensus) { +return; +}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConsensusThread) == null) { +this.calculator.registerWorker ( new jalview.workers.ConsensusThread (this, ap)); +}var al = this.getAlignment (); +if (!al.isNucleotide () && al.getCodonFrames () != null && !al.getCodonFrames ().isEmpty ()) { +if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ComplementConsensusThread) == null) { +this.calculator.registerWorker ( new jalview.workers.ComplementConsensusThread (this, ap)); +}}}, "jalview.api.AlignmentViewPanel"); +Clazz.defineMethod (c$, "updateStrucConsensus", +function (ap) { +if (this.autoCalculateStrucConsensus && this.strucConsensus == null && this.alignment.isNucleotide () && this.alignment.hasRNAStructure ()) { +this.initRNAStructure (); +}if (this.strucConsensus == null || !this.autoCalculateStrucConsensus) { +return; +}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.StrucConsensusThread) == null) { +this.calculator.registerWorker ( new jalview.workers.StrucConsensusThread (this, ap)); +}}, "jalview.api.AlignmentViewPanel"); +Clazz.defineMethod (c$, "isCalcInProgress", +function () { +return this.calculator.isWorking (); +}); +Clazz.overrideMethod (c$, "isCalculationInProgress", +function (alignmentAnnotation) { +if (!alignmentAnnotation.autoCalculated) { +return false; +}if (this.calculator.workingInvolvedWith (alignmentAnnotation)) { +return true; +}return false; +}, "jalview.datamodel.AlignmentAnnotation"); +Clazz.overrideMethod (c$, "isClosed", +function () { +return this.alignment == null; +}); +Clazz.overrideMethod (c$, "getCalcManager", +function () { +return this.calculator; +}); +Clazz.overrideMethod (c$, "isShowSequenceLogo", +function () { +return this.showSequenceLogo; +}); +Clazz.defineMethod (c$, "setShowSequenceLogo", +function (showSequenceLogo) { +if (showSequenceLogo != this.showSequenceLogo) { +this.showSequenceLogo = showSequenceLogo; +this.calculator.updateAnnotationFor (jalview.workers.ConsensusThread); +this.calculator.updateAnnotationFor (jalview.workers.ComplementConsensusThread); +this.calculator.updateAnnotationFor (jalview.workers.StrucConsensusThread); +}this.showSequenceLogo = showSequenceLogo; +}, "~B"); +Clazz.defineMethod (c$, "setShowConsensusHistogram", +function (showConsensusHistogram) { +this.showConsensusHistogram = showConsensusHistogram; +}, "~B"); +Clazz.defineMethod (c$, "isShowGroupConservation", +function () { +return this.showGroupConservation; +}); +Clazz.defineMethod (c$, "setShowGroupConservation", +function (showGroupConservation) { +this.showGroupConservation = showGroupConservation; +}, "~B"); +Clazz.defineMethod (c$, "isShowGroupConsensus", +function () { +return this.showGroupConsensus; +}); +Clazz.defineMethod (c$, "setShowGroupConsensus", +function (showGroupConsensus) { +this.showGroupConsensus = showGroupConsensus; +}, "~B"); +Clazz.overrideMethod (c$, "isShowConsensusHistogram", +function () { +return this.showConsensusHistogram; +}); +Clazz.overrideMethod (c$, "getSelectionGroup", +function () { +return this.selectionGroup; +}); +Clazz.overrideMethod (c$, "setSelectionGroup", +function (sg) { +this.selectionGroup = sg; +}, "jalview.datamodel.SequenceGroup"); +Clazz.defineMethod (c$, "setHiddenColumns", +function (colsel) { +this.colSel = colsel; +}, "jalview.datamodel.ColumnSelection"); +Clazz.overrideMethod (c$, "getColumnSelection", +function () { +return this.colSel; +}); +Clazz.overrideMethod (c$, "setColumnSelection", +function (colSel) { +this.colSel = colSel; +if (colSel != null) { +this.updateHiddenColumns (); +}}, "jalview.datamodel.ColumnSelection"); +Clazz.overrideMethod (c$, "getHiddenRepSequences", +function () { +return this.hiddenRepSequences; +}); +Clazz.overrideMethod (c$, "setHiddenRepSequences", +function (hiddenRepSequences) { +this.hiddenRepSequences = hiddenRepSequences; +}, "java.util.Map"); +Clazz.overrideMethod (c$, "hasHiddenColumns", +function () { +return this.colSel != null && this.colSel.hasHiddenColumns (); +}); +Clazz.defineMethod (c$, "updateHiddenColumns", +function () { +}); +Clazz.overrideMethod (c$, "hasHiddenRows", +function () { +return this.alignment.getHiddenSequences ().getSize () > 0; +}); +Clazz.defineMethod (c$, "setSequenceSetId", +function (newid) { +if (this.sequenceSetID != null) { +System.err.println ("Warning - overwriting a sequenceSetId for a viewport!"); +}this.sequenceSetID = String.instantialize (newid); +}, "~S"); +Clazz.overrideMethod (c$, "getSequenceSetId", +function () { +if (this.sequenceSetID == null) { +this.sequenceSetID = this.alignment.hashCode () + ""; +}return this.sequenceSetID; +}); +Clazz.overrideMethod (c$, "getViewId", +function () { +if (this.viewId == null) { +this.viewId = this.getSequenceSetId () + "." + this.hashCode () + ""; +}return this.viewId; +}); +Clazz.defineMethod (c$, "setIgnoreGapsConsensus", +function (b, ap) { +this.ignoreGapsInConsensusCalculation = b; +if (ap != null) { +this.updateConsensus (ap); +if (this.globalColourScheme != null) { +this.globalColourScheme.setThreshold (this.globalColourScheme.getThreshold (), this.ignoreGapsInConsensusCalculation); +}}}, "~B,jalview.api.AlignmentViewPanel"); +Clazz.defineMethod (c$, "isSelectionGroupChanged", +function (b) { +var hc = (this.selectionGroup == null || this.selectionGroup.getSize () == 0) ? -1 : this.selectionGroup.hashCode (); +if (hc != -1 && hc != this.sgrouphash) { +if (b) { +this.sgrouphash = hc; +}return true; +}return false; +}, "~B"); +Clazz.defineMethod (c$, "isColSelChanged", +function (b) { +var hc = (this.colSel == null || this.colSel.size () == 0) ? -1 : this.colSel.hashCode (); +if (hc != -1 && hc != this.colselhash) { +if (b) { +this.colselhash = hc; +}return true; +}return false; +}, "~B"); +Clazz.overrideMethod (c$, "isIgnoreGapsConsensus", +function () { +return this.ignoreGapsInConsensusCalculation; +}); +Clazz.defineMethod (c$, "addPropertyChangeListener", +function (listener) { +this.changeSupport.addPropertyChangeListener (listener); +}, "java.beans.PropertyChangeListener"); +Clazz.defineMethod (c$, "removePropertyChangeListener", +function (listener) { +this.changeSupport.removePropertyChangeListener (listener); +}, "java.beans.PropertyChangeListener"); +Clazz.defineMethod (c$, "firePropertyChange", +function (prop, oldvalue, newvalue) { +this.changeSupport.firePropertyChange (prop, oldvalue, newvalue); +}, "~S,~O,~O"); +Clazz.defineMethod (c$, "hideSelectedColumns", +function () { +if (this.colSel.size () < 1) { +return; +}this.colSel.hideSelectedColumns (); +this.setSelectionGroup (null); +}); +Clazz.defineMethod (c$, "hideColumns", +function (start, end) { +if (start == end) { +this.colSel.hideColumns (start); +} else { +this.colSel.hideColumns (start, end); +}}, "~N,~N"); +Clazz.defineMethod (c$, "showColumn", +function (col) { +this.colSel.revealHiddenColumns (col); +}, "~N"); +Clazz.defineMethod (c$, "showAllHiddenColumns", +function () { +this.colSel.revealAllHiddenColumns (); +}); +Clazz.defineMethod (c$, "showAllHiddenSeqs", +function () { +if (this.alignment.getHiddenSequences ().getSize () > 0) { +if (this.selectionGroup == null) { +this.selectionGroup = new jalview.datamodel.SequenceGroup (); +this.selectionGroup.setEndRes (this.alignment.getWidth () - 1); +}var tmp = this.alignment.getHiddenSequences ().showAll (this.hiddenRepSequences); +for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) { +this.selectionGroup.addSequence (seq, false); +this.setSequenceAnnotationsVisible (seq, true); +} +this.hiddenRepSequences = null; +this.firePropertyChange ("alignment", null, this.alignment.getSequences ()); +this.sendSelection (); +}}); +Clazz.defineMethod (c$, "showSequence", +function (index) { +var tmp = this.alignment.getHiddenSequences ().showSequence (index, this.hiddenRepSequences); +if (tmp.size () > 0) { +if (this.selectionGroup == null) { +this.selectionGroup = new jalview.datamodel.SequenceGroup (); +this.selectionGroup.setEndRes (this.alignment.getWidth () - 1); +}for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) { +this.selectionGroup.addSequence (seq, false); +this.setSequenceAnnotationsVisible (seq, true); +} +this.firePropertyChange ("alignment", null, this.alignment.getSequences ()); +this.sendSelection (); +}}, "~N"); +Clazz.defineMethod (c$, "hideAllSelectedSeqs", +function () { +if (this.selectionGroup == null || this.selectionGroup.getSize () < 1) { +return; +}var seqs = this.selectionGroup.getSequencesInOrder (this.alignment); +this.hideSequence (seqs); +this.setSelectionGroup (null); +}); +Clazz.defineMethod (c$, "hideSequence", +function (seq) { +if (seq != null) { +for (var i = 0; i < seq.length; i++) { +this.alignment.getHiddenSequences ().hideSequence (seq[i]); +this.setSequenceAnnotationsVisible (seq[i], false); +} +this.firePropertyChange ("alignment", null, this.alignment.getSequences ()); +}}, "~A"); +Clazz.defineMethod (c$, "setSequenceAnnotationsVisible", +function (sequenceI, visible) { +for (var ann, $ann = 0, $$ann = this.alignment.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) { +if (ann.sequenceRef === sequenceI) { +ann.visible = visible; +}} +}, "jalview.datamodel.SequenceI,~B"); +Clazz.defineMethod (c$, "hideRepSequences", +function (repSequence, sg) { +var sSize = sg.getSize (); +if (sSize < 2) { +return; +}if (this.hiddenRepSequences == null) { +this.hiddenRepSequences = new java.util.Hashtable (); +}this.hiddenRepSequences.put (repSequence, sg); +var seqs = new Array (sSize - 1); +var index = 0; +for (var i = 0; i < sSize; i++) { +if (sg.getSequenceAt (i) !== repSequence) { +if (index == sSize - 1) { +return; +}seqs[index++] = sg.getSequenceAt (i); +}} +sg.setSeqrep (repSequence); +sg.setHidereps (true); +this.hideSequence (seqs); +}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup"); +Clazz.defineMethod (c$, "isHiddenRepSequence", +function (seq) { +return this.alignment.getSeqrep () === seq || (this.hiddenRepSequences != null && this.hiddenRepSequences.containsKey (seq)); +}, "jalview.datamodel.SequenceI"); +Clazz.defineMethod (c$, "getRepresentedSequences", +function (seq) { +return (this.hiddenRepSequences == null ? null : this.hiddenRepSequences.get (seq)); +}, "jalview.datamodel.SequenceI"); +Clazz.overrideMethod (c$, "adjustForHiddenSeqs", +function (alignmentIndex) { +return this.alignment.getHiddenSequences ().adjustForHiddenSeqs (alignmentIndex); +}, "~N"); +Clazz.overrideMethod (c$, "invertColumnSelection", +function () { +this.colSel.invertColumnSelection (0, this.alignment.getWidth ()); +}); +Clazz.overrideMethod (c$, "getSelectionAsNewSequence", +function () { +var sequences; +if (this.selectionGroup == null || this.selectionGroup.getSize () == 0) { +sequences = this.alignment.getSequencesArray (); +var annots = this.alignment.getAlignmentAnnotation (); +for (var i = 0; i < sequences.length; i++) { +sequences[i] = new jalview.datamodel.Sequence (sequences[i], annots); +} +} else { +sequences = this.selectionGroup.getSelectionAsNewSequences (this.alignment); +}return sequences; +}); +Clazz.overrideMethod (c$, "getSequenceSelection", +function () { +var sequences = null; +if (this.selectionGroup != null) { +sequences = this.selectionGroup.getSequencesInOrder (this.alignment); +}if (sequences == null) { +sequences = this.alignment.getSequencesArray (); +}return sequences; +}); +Clazz.overrideMethod (c$, "getViewAsCigars", +function (selectedRegionOnly) { +return new jalview.datamodel.CigarArray (this.alignment, this.colSel, (selectedRegionOnly ? this.selectionGroup : null)); +}, "~B"); +Clazz.defineMethod (c$, "getAlignmentView", +function (selectedOnly) { +return this.getAlignmentView (selectedOnly, false); +}, "~B"); +Clazz.defineMethod (c$, "getAlignmentView", +function (selectedOnly, markGroups) { +return new jalview.datamodel.AlignmentView (this.alignment, this.colSel, this.selectionGroup, this.colSel != null && this.colSel.hasHiddenColumns (), selectedOnly, markGroups); +}, "~B,~B"); +Clazz.overrideMethod (c$, "getViewAsString", +function (selectedRegionOnly) { +var selection = null; +var seqs = null; +var i; +var iSize; +var start = 0; +var end = 0; +if (selectedRegionOnly && this.selectionGroup != null) { +iSize = this.selectionGroup.getSize (); +seqs = this.selectionGroup.getSequencesInOrder (this.alignment); +start = this.selectionGroup.getStartRes (); +end = this.selectionGroup.getEndRes () + 1; +} else { +iSize = this.alignment.getHeight (); +seqs = this.alignment.getSequencesArray (); +end = this.alignment.getWidth (); +}selection = new Array (iSize); +if (this.colSel != null && this.colSel.hasHiddenColumns ()) { +selection = this.colSel.getVisibleSequenceStrings (start, end, seqs); +} else { +for (i = 0; i < iSize; i++) { +selection[i] = seqs[i].getSequenceAsString (start, end); +} +}return selection; +}, "~B"); +Clazz.overrideMethod (c$, "getVisibleRegionBoundaries", +function (min, max) { +var regions = new java.util.ArrayList (); +var start = min; +var end = max; +do { +if (this.colSel != null && this.colSel.hasHiddenColumns ()) { +if (start == 0) { +start = this.colSel.adjustForHiddenColumns (start); +}end = this.colSel.getHiddenBoundaryRight (start); +if (start == end) { +end = max; +}if (end > max) { +end = max; +}}regions.add ( Clazz.newIntArray (-1, [start, end])); +if (this.colSel != null && this.colSel.hasHiddenColumns ()) { +start = this.colSel.adjustForHiddenColumns (end); +start = this.colSel.getHiddenBoundaryLeft (start) + 1; +}} while (end < max); +var startEnd = Clazz.newIntArray (regions.size (), 2, 0); +return regions; +}, "~N,~N"); +Clazz.overrideMethod (c$, "getVisibleAlignmentAnnotation", +function (selectedOnly) { +var ala = new java.util.ArrayList (); +var aa; +if ((aa = this.alignment.getAlignmentAnnotation ()) != null) { +for (var annot, $annot = 0, $$annot = aa; $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) { +var clone = new jalview.datamodel.AlignmentAnnotation (annot); +if (selectedOnly && this.selectionGroup != null) { +this.colSel.makeVisibleAnnotation (this.selectionGroup.getStartRes (), this.selectionGroup.getEndRes (), clone); +} else { +this.colSel.makeVisibleAnnotation (clone); +}ala.add (clone); +} +}return ala; +}, "~B"); +Clazz.overrideMethod (c$, "isPadGaps", +function () { +return this.padGaps; +}); +Clazz.overrideMethod (c$, "setPadGaps", +function (padGaps) { +this.padGaps = padGaps; +}, "~B"); +Clazz.overrideMethod (c$, "alignmentChanged", +function (ap) { +if (this.isPadGaps ()) { +this.alignment.padGaps (); +}if (this.autoCalculateConsensus) { +this.updateConsensus (ap); +}if (this.hconsensus != null && this.autoCalculateConsensus) { +this.updateConservation (ap); +}if (this.autoCalculateStrucConsensus) { +this.updateStrucConsensus (ap); +}var alWidth = this.alignment.getWidth (); +var groups = this.alignment.getGroups (); +if (groups != null) { +for (var sg, $sg = groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { +if (sg.getEndRes () > alWidth) { +sg.setEndRes (alWidth - 1); +}} +}if (this.selectionGroup != null && this.selectionGroup.getEndRes () > alWidth) { +this.selectionGroup.setEndRes (alWidth - 1); +}this.resetAllColourSchemes (); +this.calculator.restartWorkers (); +}, "jalview.api.AlignmentViewPanel"); +Clazz.defineMethod (c$, "resetAllColourSchemes", +function () { +var cs = this.globalColourScheme; +if (cs != null) { +cs.alignmentChanged (this.alignment, this.hiddenRepSequences); +cs.setConsensus (this.hconsensus); +if (cs.conservationApplied ()) { +cs.setConservation (jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.alignment.getWidth (), false, this.getConsPercGaps (), false)); +}}for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { +if (sg.cs != null) { +sg.cs.alignmentChanged (sg, this.hiddenRepSequences); +}sg.recalcConservation (); +} +}); +Clazz.defineMethod (c$, "initAutoAnnotation", +function () { +if (this.hconsensus == null && !this.$isDataset) { +if (!this.alignment.isNucleotide ()) { +this.initConservation (); +this.initQuality (); +} else { +this.initRNAStructure (); +}this.consensus = new jalview.datamodel.AlignmentAnnotation ("Consensus", "PID", new Array (1), 0, 100, 1); +this.initConsensus (this.consensus); +this.initComplementConsensus (); +}}); +Clazz.defineMethod (c$, "initComplementConsensus", +function () { +if (!this.alignment.isNucleotide ()) { +var codonMappings = this.alignment.getCodonFrames (); +if (codonMappings != null && !codonMappings.isEmpty ()) { +this.complementConsensus = new jalview.datamodel.AlignmentAnnotation ("cDNA Consensus", "PID for cDNA", new Array (1), 0, 100, 1); +this.initConsensus (this.complementConsensus); +}}}); +Clazz.defineMethod (c$, "initConsensus", +($fz = function (aa) { +aa.hasText = true; +aa.autoCalculated = true; +if (this.showConsensus) { +this.alignment.addAnnotation (aa); +}}, $fz.isPrivate = true, $fz), "jalview.datamodel.AlignmentAnnotation"); +Clazz.defineMethod (c$, "initConservation", +($fz = function () { +if (this.showConservation) { +if (this.conservation == null) { +this.conservation = new jalview.datamodel.AlignmentAnnotation ("Conservation", "Conservation of total alignment less than " + this.getConsPercGaps () + "% gaps", new Array (1), 0, 11, 1); +this.conservation.hasText = true; +this.conservation.autoCalculated = true; +this.alignment.addAnnotation (this.conservation); +}}}, $fz.isPrivate = true, $fz)); +Clazz.defineMethod (c$, "initQuality", +($fz = function () { +if (this.showQuality) { +if (this.quality == null) { +this.quality = new jalview.datamodel.AlignmentAnnotation ("Quality", "Alignment Quality based on Blosum62 scores", new Array (1), 0, 11, 1); +this.quality.hasText = true; +this.quality.autoCalculated = true; +this.alignment.addAnnotation (this.quality); +}}}, $fz.isPrivate = true, $fz)); +Clazz.defineMethod (c$, "initRNAStructure", +($fz = function () { +if (this.alignment.hasRNAStructure () && this.strucConsensus == null) { +this.strucConsensus = new jalview.datamodel.AlignmentAnnotation ("StrucConsensus", "PID", new Array (1), 0, 100, 1); +this.strucConsensus.hasText = true; +this.strucConsensus.autoCalculated = true; +if (this.showConsensus) { +this.alignment.addAnnotation (this.strucConsensus); +}}}, $fz.isPrivate = true, $fz)); +Clazz.overrideMethod (c$, "calcPanelHeight", +function () { +var anns = this.getAlignment ().getAlignmentAnnotation (); +var height = 0; +var charHeight = this.getCharHeight (); +if (anns != null) { +var graphgrp = new java.util.BitSet (); +for (var aa, $aa = 0, $$aa = anns; $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) { +if (aa == null) { +System.err.println ("Null annotation row: ignoring."); +continue; +}if (!aa.visible) { +continue; +}if (aa.graphGroup > -1) { +if (graphgrp.get (aa.graphGroup)) { +continue; +} else { +graphgrp.set (aa.graphGroup); +}}aa.height = 0; +if (aa.hasText) { +aa.height += charHeight; +}if (aa.hasIcons) { +aa.height += 16; +}if (aa.graph > 0) { +aa.height += aa.graphHeight; +}if (aa.height == 0) { +aa.height = 20; +}height += aa.height; +} +}if (height == 0) { +height = 20; +}return height; +}); +Clazz.overrideMethod (c$, "updateGroupAnnotationSettings", +function (applyGlobalSettings, preserveNewGroupSettings) { +var updateCalcs = false; +var conv = this.isShowGroupConservation (); +var cons = this.isShowGroupConsensus (); +var showprf = this.isShowSequenceLogo (); +var showConsHist = this.isShowConsensusHistogram (); +var normLogo = this.isNormaliseSequenceLogo (); +var sortg = true; +var aan = this.alignment.getAlignmentAnnotation (); +var oldrfs = new java.util.ArrayList (); +if (aan != null) { +for (var an = 0; an < aan.length; an++) { +if (aan[an].autoCalculated && aan[an].groupRef != null) { +oldrfs.add (aan[an].groupRef); +this.alignment.deleteAnnotation (aan[an], false); +}} +}if (this.alignment.getGroups () != null) { +for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { +updateCalcs = false; +if (applyGlobalSettings || (!preserveNewGroupSettings && !oldrfs.contains (sg))) { +sg.setshowSequenceLogo (showprf); +sg.setShowConsensusHistogram (showConsHist); +sg.setNormaliseSequenceLogo (normLogo); +}if (conv) { +updateCalcs = true; +this.alignment.addAnnotation (sg.getConservationRow (), 0); +}if (cons) { +updateCalcs = true; +this.alignment.addAnnotation (sg.getConsensus (), 0); +}if (updateCalcs) { +sg.recalcConservation (); +}} +}oldrfs.clear (); +}, "~B,~B"); +Clazz.defineMethod (c$, "isDisplayReferenceSeq", +function () { +return this.alignment.hasSeqrep () && this.viewStyle.isDisplayReferenceSeq (); +}); +Clazz.defineMethod (c$, "setDisplayReferenceSeq", +function (displayReferenceSeq) { +this.viewStyle.setDisplayReferenceSeq (displayReferenceSeq); +}, "~B"); +Clazz.defineMethod (c$, "isColourByReferenceSeq", +function () { +return this.alignment.hasSeqrep () && this.viewStyle.isColourByReferenceSeq (); +}); +Clazz.overrideMethod (c$, "getSequenceColour", +function (seq) { +var sqc = this.sequenceColours.get (seq); +return (sqc == null ? java.awt.Color.white : sqc); +}, "jalview.datamodel.SequenceI"); +Clazz.overrideMethod (c$, "setSequenceColour", +function (seq, col) { +if (col == null) { +this.sequenceColours.remove (seq); +} else { +this.sequenceColours.put (seq, col); +}}, "jalview.datamodel.SequenceI,java.awt.Color"); +Clazz.overrideMethod (c$, "updateSequenceIdColours", +function () { +for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) { +if (sg.idColour != null) { +for (var s, $s = sg.getSequences (this.getHiddenRepSequences ()).iterator (); $s.hasNext () && ((s = $s.next ()) || true);) { +this.sequenceColours.put (s, sg.idColour); +} +}} +}); +Clazz.overrideMethod (c$, "clearSequenceColours", +function () { +this.sequenceColours.clear (); +}); +Clazz.defineMethod (c$, "getCodingComplement", +function () { +return this.codingComplement; +}); +Clazz.defineMethod (c$, "setCodingComplement", +function (av) { +if (this === av) { +System.err.println ("Ignoring recursive setCodingComplement request"); +} else { +this.codingComplement = av; +if (av.getCodingComplement () !== this) { +av.setCodingComplement (this); +}}}, "jalview.api.AlignViewportI"); +Clazz.overrideMethod (c$, "isNucleotide", +function () { +return this.getAlignment () == null ? false : this.getAlignment ().isNucleotide (); +}); +Clazz.overrideMethod (c$, "getFeaturesDisplayed", +function () { +return this.featuresDisplayed; +}); +Clazz.overrideMethod (c$, "setFeaturesDisplayed", +function (featuresDisplayedI) { +this.featuresDisplayed = featuresDisplayedI; +}, "jalview.api.FeaturesDisplayedI"); +Clazz.overrideMethod (c$, "areFeaturesDisplayed", +function () { +return this.featuresDisplayed != null && this.featuresDisplayed.getRegisterdFeaturesCount () > 0; +}); +Clazz.defineMethod (c$, "setShowSequenceFeatures", +function (b) { +this.viewStyle.setShowSequenceFeatures (b); +}, "~B"); +Clazz.defineMethod (c$, "isShowSequenceFeatures", +function () { +return this.viewStyle.isShowSequenceFeatures (); +}); +Clazz.defineMethod (c$, "setShowSequenceFeaturesHeight", +function (selected) { +this.viewStyle.setShowSequenceFeaturesHeight (selected); +}, "~B"); +Clazz.defineMethod (c$, "isShowSequenceFeaturesHeight", +function () { +return this.viewStyle.isShowSequenceFeaturesHeight (); +}); +Clazz.defineMethod (c$, "setShowAnnotation", +function (b) { +this.viewStyle.setShowAnnotation (b); +}, "~B"); +Clazz.defineMethod (c$, "isShowAnnotation", +function () { +return this.viewStyle.isShowAnnotation (); +}); +Clazz.defineMethod (c$, "isRightAlignIds", +function () { +return this.viewStyle.isRightAlignIds (); +}); +Clazz.defineMethod (c$, "setRightAlignIds", +function (rightAlignIds) { +this.viewStyle.setRightAlignIds (rightAlignIds); +}, "~B"); +Clazz.defineMethod (c$, "getConservationSelected", +function () { +return this.viewStyle.getConservationSelected (); +}); +Clazz.defineMethod (c$, "setShowBoxes", +function (state) { +this.viewStyle.setShowBoxes (state); +}, "~B"); +Clazz.defineMethod (c$, "getTextColour", +function () { +return this.viewStyle.getTextColour (); +}); +Clazz.defineMethod (c$, "getTextColour2", +function () { +return this.viewStyle.getTextColour2 (); +}); +Clazz.defineMethod (c$, "getThresholdTextColour", +function () { +return this.viewStyle.getThresholdTextColour (); +}); +Clazz.defineMethod (c$, "isConservationColourSelected", +function () { +return this.viewStyle.isConservationColourSelected (); +}); +Clazz.defineMethod (c$, "isRenderGaps", +function () { +return this.viewStyle.isRenderGaps (); +}); +Clazz.defineMethod (c$, "isShowColourText", +function () { +return this.viewStyle.isShowColourText (); +}); +Clazz.defineMethod (c$, "setConservationColourSelected", +function (conservationColourSelected) { +this.viewStyle.setConservationColourSelected (conservationColourSelected); +}, "~B"); +Clazz.defineMethod (c$, "setShowColourText", +function (showColourText) { +this.viewStyle.setShowColourText (showColourText); +}, "~B"); +Clazz.defineMethod (c$, "setTextColour", +function (textColour) { +this.viewStyle.setTextColour (textColour); +}, "java.awt.Color"); +Clazz.defineMethod (c$, "setThresholdTextColour", +function (thresholdTextColour) { +this.viewStyle.setThresholdTextColour (thresholdTextColour); +}, "~N"); +Clazz.defineMethod (c$, "setTextColour2", +function (textColour2) { +this.viewStyle.setTextColour2 (textColour2); +}, "java.awt.Color"); +Clazz.overrideMethod (c$, "getViewStyle", +function () { +return new jalview.viewmodel.styles.ViewStyle (this.viewStyle); +}); +Clazz.overrideMethod (c$, "setViewStyle", +function (settingsForView) { +this.viewStyle = new jalview.viewmodel.styles.ViewStyle (settingsForView); +}, "jalview.api.ViewStyleI"); +Clazz.defineMethod (c$, "sameStyle", +function (them) { +return this.viewStyle.sameStyle (them); +}, "jalview.api.ViewStyleI"); +Clazz.defineMethod (c$, "getIdWidth", +function () { +return this.viewStyle.getIdWidth (); +}); +Clazz.defineMethod (c$, "setIdWidth", +function (i) { +this.viewStyle.setIdWidth (i); +}, "~N"); +Clazz.defineMethod (c$, "isCentreColumnLabels", +function () { +return this.viewStyle.isCentreColumnLabels (); +}); +Clazz.defineMethod (c$, "setCentreColumnLabels", +function (centreColumnLabels) { +this.viewStyle.setCentreColumnLabels (centreColumnLabels); +}, "~B"); +Clazz.defineMethod (c$, "setShowDBRefs", +function (showdbrefs) { +this.viewStyle.setShowDBRefs (showdbrefs); +}, "~B"); +Clazz.defineMethod (c$, "isShowDBRefs", +function () { +return this.viewStyle.isShowDBRefs (); +}); +Clazz.defineMethod (c$, "isShowNPFeats", +function () { +return this.viewStyle.isShowNPFeats (); +}); +Clazz.defineMethod (c$, "setShowNPFeats", +function (shownpfeats) { +this.viewStyle.setShowNPFeats (shownpfeats); +}, "~B"); +Clazz.defineMethod (c$, "addToHistoryList", +function (command) { +if (this.historyList != null) { +this.historyList.push (command); +this.broadcastCommand (command, false); +}}, "jalview.commands.CommandI"); +Clazz.defineMethod (c$, "broadcastCommand", +function (command, undo) { +this.getStructureSelectionManager ().commandPerformed (command, undo, this.getVamsasSource ()); +}, "jalview.commands.CommandI,~B"); +Clazz.defineMethod (c$, "addToRedoList", +function (command) { +if (this.redoList != null) { +this.redoList.push (command); +}this.broadcastCommand (command, true); +}, "jalview.commands.CommandI"); +Clazz.defineMethod (c$, "clearRedoList", +function () { +if (this.redoList != null) { +this.redoList.clear (); +}}); +Clazz.defineMethod (c$, "setHistoryList", +function (list) { +this.historyList = list; +}, "java.util.Deque"); +Clazz.defineMethod (c$, "getHistoryList", +function () { +return this.historyList; +}); +Clazz.defineMethod (c$, "setRedoList", +function (list) { +this.redoList = list; +}, "java.util.Deque"); +Clazz.defineMethod (c$, "getRedoList", +function () { +return this.redoList; +}); +Clazz.overrideMethod (c$, "getVamsasSource", +function () { +return this; +}); +Clazz.defineMethod (c$, "getSortAnnotationsBy", +function () { +return this.sortAnnotationsBy; +}); +Clazz.defineMethod (c$, "setSortAnnotationsBy", +function (sortAnnotationsBy) { +this.sortAnnotationsBy = sortAnnotationsBy; +}, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder"); +Clazz.defineMethod (c$, "isShowAutocalculatedAbove", +function () { +return this.showAutocalculatedAbove; +}); +Clazz.defineMethod (c$, "setShowAutocalculatedAbove", +function (showAutocalculatedAbove) { +this.showAutocalculatedAbove = showAutocalculatedAbove; +}, "~B"); +Clazz.defineMethod (c$, "isScaleProteinAsCdna", +function () { +return this.viewStyle.isScaleProteinAsCdna (); +}); +Clazz.defineMethod (c$, "setScaleProteinAsCdna", +function (b) { +this.viewStyle.setScaleProteinAsCdna (b); +}, "~B"); +Clazz.defineMethod (c$, "isFollowHighlight", +function () { +return this.followHighlight; +}); +Clazz.overrideMethod (c$, "setFollowHighlight", +function (b) { +this.followHighlight = b; +}, "~B"); +Clazz.defineMethod (c$, "getStartRes", +function () { +return this.startRes; +}); +Clazz.overrideMethod (c$, "getEndRes", +function () { +return this.endRes; +}); +Clazz.defineMethod (c$, "getStartSeq", +function () { +return this.startSeq; +}); +Clazz.defineMethod (c$, "setStartRes", +function (res) { +this.startRes = res; +}, "~N"); +Clazz.defineMethod (c$, "setStartSeq", +function (seq) { +this.startSeq = seq; +}, "~N"); +Clazz.defineMethod (c$, "setEndRes", +function (res) { +if (res > this.alignment.getWidth () - 1) { +res = this.alignment.getWidth () - 1; +}if (res < 0) { +res = 0; +}this.endRes = res; +}, "~N"); +Clazz.defineMethod (c$, "setEndSeq", +function (seq) { +if (seq > this.alignment.getHeight ()) { +seq = this.alignment.getHeight (); +}if (seq < 0) { +seq = 0; +}this.endSeq = seq; +}, "~N"); +Clazz.defineMethod (c$, "getEndSeq", +function () { +return this.endSeq; +}); +Clazz.defineMethod (c$, "findComplementScrollTarget", +function (sr) { +var complement = this.getCodingComplement (); +if (complement == null || !complement.isFollowHighlight ()) { +return 0; +}var iAmProtein = !this.getAlignment ().isNucleotide (); +var proteinAlignment = iAmProtein ? this.getAlignment () : complement.getAlignment (); +if (proteinAlignment == null) { +return 0; +}var mappings = proteinAlignment.getCodonFrames (); +var seqOffset = 0; +var sequence = null; +var middleColumn = this.getStartRes () + Clazz.doubleToInt ((this.getEndRes () - this.getStartRes ()) / 2); +var hiddenSequences = this.getAlignment ().getHiddenSequences (); +for (var seqNo = this.getStartSeq (); seqNo < this.getEndSeq (); seqNo++, seqOffset++) { +sequence = this.getAlignment ().getSequenceAt (seqNo); +if (hiddenSequences != null && hiddenSequences.isHidden (sequence)) { +continue; +}if (jalview.util.Comparison.isGap (sequence.getCharAt (middleColumn))) { +continue; +}var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (sequence, mappings); +if (!seqMappings.isEmpty ()) { +break; +}} +if (sequence == null) { +return 0; +}jalview.util.MappingUtils.addSearchResults (sr, sequence, sequence.findPosition (middleColumn), mappings); +return seqOffset; +}, "jalview.datamodel.SearchResults"); +});