X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fstructure%2FStructureSelectionManager.js;h=cdbab5100c71edb0d61c942d079f8de4310627d1;hp=681a2a7e31d58f10f4769b872ce3073608fb7ded;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/structure/StructureSelectionManager.js b/bin/jalview/structure/StructureSelectionManager.js index 681a2a7..cdbab51 100644 --- a/bin/jalview/structure/StructureSelectionManager.js +++ b/bin/jalview/structure/StructureSelectionManager.js @@ -1,511 +1,511 @@ -Clazz.declarePackage ("jalview.structure"); -Clazz.load (["java.util.ArrayList", "$.HashMap", "$.LinkedHashSet", "$.Vector"], "jalview.structure.StructureSelectionManager", ["MCview.PDBfile", "jalview.analysis.AlignSeq", "jalview.commands.EditCommand", "$.OrderCommand", "jalview.datamodel.Mapping", "$.SearchResults", "jalview.io.AppletFormatAdapter", "jalview.structure.AtomSpec", "$.SecondaryStructureListener", "$.SequenceListener", "$.StructureListener", "$.StructureMapping", "$.VamsasListener", "jalview.util.MappingUtils", "$.MessageManager", "java.lang.Error", "$.NullPointerException", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.IdentityHashMap"], function () { -c$ = Clazz.decorateAsClass (function () { -this.mappings = null; -this.processSecondaryStructure = false; -this.secStructServices = false; -this.addTempFacAnnot = false; -this.seqmappings = null; -this.seqMappingRefCounts = null; -this.commandListeners = null; -this.sel_listeners = null; -this.pdbIdFileName = null; -this.pdbFileNameId = null; -this.relaySeqMappings = true; -this.listeners = null; -this.handlingVamsasMo = false; -this.lastmsg = 0; -this.view_listeners = null; -Clazz.instantialize (this, arguments); -}, jalview.structure, "StructureSelectionManager"); -Clazz.prepareFields (c$, function () { -this.mappings = new java.util.ArrayList (); -this.seqmappings = new java.util.LinkedHashSet (); -this.seqMappingRefCounts = new java.util.HashMap (); -this.commandListeners = new java.util.ArrayList (); -this.sel_listeners = new java.util.ArrayList (); -this.pdbIdFileName = new java.util.HashMap (); -this.pdbFileNameId = new java.util.HashMap (); -this.listeners = new java.util.Vector (); -this.view_listeners = new java.util.Vector (); -}); -Clazz.defineMethod (c$, "isSecStructServices", -function () { -return this.secStructServices; -}); -Clazz.defineMethod (c$, "setSecStructServices", -function (secStructServices) { -this.secStructServices = secStructServices; -}, "~B"); -Clazz.defineMethod (c$, "isAddTempFacAnnot", -function () { -return this.addTempFacAnnot; -}); -Clazz.defineMethod (c$, "setAddTempFacAnnot", -function (addTempFacAnnot) { -this.addTempFacAnnot = addTempFacAnnot; -}, "~B"); -Clazz.defineMethod (c$, "isProcessSecondaryStructure", -function () { -return this.processSecondaryStructure; -}); -Clazz.defineMethod (c$, "setProcessSecondaryStructure", -function (enable) { -this.processSecondaryStructure = enable; -}, "~B"); -Clazz.defineMethod (c$, "reportMapping", -function () { -if (this.mappings.isEmpty ()) { -System.err.println ("reportMapping: No PDB/Sequence mappings."); -} else { -System.err.println ("reportMapping: There are " + this.mappings.size () + " mappings."); -var i = 0; -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -System.err.println ("mapping " + i++ + " : " + sm.pdbfile); -} -}}); -Clazz.defineMethod (c$, "registerPDBFile", -function (idForFile, absoluteFile) { -this.pdbIdFileName.put (idForFile, absoluteFile); -this.pdbFileNameId.put (absoluteFile, idForFile); -}, "~S,~S"); -Clazz.defineMethod (c$, "findIdForPDBFile", -function (idOrFile) { -var id = this.pdbFileNameId.get (idOrFile); -return id; -}, "~S"); -Clazz.defineMethod (c$, "findFileForPDBId", -function (idOrFile) { -var id = this.pdbIdFileName.get (idOrFile); -return id; -}, "~S"); -Clazz.defineMethod (c$, "isPDBFileRegistered", -function (idOrFile) { -return this.pdbFileNameId.containsKey (idOrFile) || this.pdbIdFileName.containsKey (idOrFile); -}, "~S"); -c$.getStructureSelectionManager = Clazz.defineMethod (c$, "getStructureSelectionManager", -function (context) { -if (context == null) { -if (jalview.structure.StructureSelectionManager.nullProvider == null) { -if (jalview.structure.StructureSelectionManager.instances != null) { -throw new Error (jalview.util.MessageManager.getString ("error.implementation_error_structure_selection_manager_null"), new NullPointerException (jalview.util.MessageManager.getString ("exception.ssm_context_is_null"))); -} else { -jalview.structure.StructureSelectionManager.nullProvider = new jalview.structure.StructureSelectionManager (); -}return jalview.structure.StructureSelectionManager.nullProvider; -}}if (jalview.structure.StructureSelectionManager.instances == null) { -jalview.structure.StructureSelectionManager.instances = new java.util.IdentityHashMap (); -}var instance = jalview.structure.StructureSelectionManager.instances.get (context); -if (instance == null) { -if (jalview.structure.StructureSelectionManager.nullProvider != null) { -instance = jalview.structure.StructureSelectionManager.nullProvider; -} else { -instance = new jalview.structure.StructureSelectionManager (); -}jalview.structure.StructureSelectionManager.instances.put (context, instance); -}return instance; -}, "jalview.api.StructureSelectionManagerProvider"); -Clazz.defineMethod (c$, "setRelaySeqMappings", -function (relay) { -this.relaySeqMappings = relay; -}, "~B"); -Clazz.defineMethod (c$, "isRelaySeqMappingsEnabled", -function () { -return this.relaySeqMappings; -}); -Clazz.defineMethod (c$, "addStructureViewerListener", -function (svl) { -if (!this.listeners.contains (svl)) { -this.listeners.addElement (svl); -}}, "~O"); -Clazz.defineMethod (c$, "alreadyMappedToFile", -function (pdbid) { -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -if (sm.getPdbId ().equals (pdbid)) { -return sm.pdbfile; -}} -return null; -}, "~S"); -Clazz.defineMethod (c$, "setMapping", -function (sequence, targetChains, pdbFile, protocol) { -return this.setMapping (true, sequence, targetChains, pdbFile, protocol); -}, "~A,~A,~S,~S"); -Clazz.defineMethod (c$, "setMapping", -function (forStructureView, sequence, targetChains, pdbFile, protocol) { -var parseSecStr = this.processSecondaryStructure; -if (this.isPDBFileRegistered (pdbFile)) { -for (var sq, $sq = 0, $$sq = sequence; $sq < $$sq.length && ((sq = $$sq[$sq]) || true); $sq++) { -var ds = sq; -while (ds.getDatasetSequence () != null) { -ds = ds.getDatasetSequence (); -} -;if (ds.getAnnotation () != null) { -for (var ala, $ala = 0, $$ala = ds.getAnnotation (); $ala < $$ala.length && ((ala = $$ala[$ala]) || true); $ala++) { -if (MCview.PDBfile.isCalcIdForFile (ala, this.findIdForPDBFile (pdbFile))) { -parseSecStr = false; -}} -}} -}var pdb = null; -try { -pdb = new MCview.PDBfile (this.addTempFacAnnot, parseSecStr, this.secStructServices, pdbFile, protocol); -if (pdb.id != null && pdb.id.trim ().length > 0 && jalview.io.AppletFormatAdapter.FILE.equals (protocol)) { -this.registerPDBFile (pdb.id.trim (), pdbFile); -}} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -return null; -} else { -throw ex; -} -} -var targetChain; -for (var s = 0; s < sequence.length; s++) { -var infChain = true; -var seq = sequence[s]; -if (targetChains != null && targetChains[s] != null) { -infChain = false; -targetChain = targetChains[s]; -} else if (seq.getName ().indexOf ("|") > -1) { -targetChain = seq.getName ().substring (seq.getName ().lastIndexOf ("|") + 1); -if (targetChain.length > 1) { -if (targetChain.trim ().length == 0) { -targetChain = " "; -} else { -targetChain = ""; -}}} else { -targetChain = ""; -}var max = -10; -var maxAlignseq = null; -var maxChainId = " "; -var maxChain = null; -var first = true; -for (var chain, $chain = pdb.chains.iterator (); $chain.hasNext () && ((chain = $chain.next ()) || true);) { -if (targetChain.length > 0 && !targetChain.equals (chain.id) && !infChain) { -continue; -}var type = chain.isNa ? "dna" : "pep"; -var as = jalview.analysis.AlignSeq.doGlobalNWAlignment (seq, chain.sequence, type); -if (first || as.maxscore > max || (as.maxscore == max && chain.id.equals (targetChain))) { -first = false; -maxChain = chain; -max = as.maxscore; -maxAlignseq = as; -maxChainId = chain.id; -}} -if (maxChain == null) { -continue; -}var mappingDetails = new StringBuilder (128); -mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB Sequence is :").append (jalview.structure.StructureSelectionManager.NEWLINE).append ("Sequence = ").append (maxChain.sequence.getSequenceAsString ()); -mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("No of residues = ").append (maxChain.residues.size ()).append (jalview.structure.StructureSelectionManager.NEWLINE).append (jalview.structure.StructureSelectionManager.NEWLINE); -var ps = ((Clazz.isClassDefined ("jalview.structure.StructureSelectionManager$1") ? 0 : jalview.structure.StructureSelectionManager.$StructureSelectionManager$1$ ()), Clazz.innerTypeInstance (jalview.structure.StructureSelectionManager$1, this, Clazz.cloneFinals ("mappingDetails", mappingDetails), System.out)); -maxAlignseq.printAlignment (ps); -mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB start/end "); -mappingDetails.append (String.valueOf (maxAlignseq.seq2start)).append (" "); -mappingDetails.append (String.valueOf (maxAlignseq.seq2end)); -mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("SEQ start/end "); -mappingDetails.append (String.valueOf (maxAlignseq.seq1start + seq.getStart () - 1)).append (" "); -mappingDetails.append (String.valueOf (maxAlignseq.seq1end + seq.getEnd () - 1)); -maxChain.makeExactMapping (maxAlignseq, seq); -var sqmpping = maxAlignseq.getMappingFromS1 (false); -var omap = new jalview.datamodel.Mapping (sqmpping.getMap ().getInverse ()); -maxChain.transferRESNUMFeatures (seq, null); -var mapping = Clazz.newIntArray (seq.findPosition (seq.getLength ()) + 2, 2, 0); -var resNum = -10000; -var index = 0; -do { -var tmp = maxChain.atoms.elementAt (index); -if (resNum != tmp.resNumber && tmp.alignmentMapping != -1) { -resNum = tmp.resNumber; -mapping[tmp.alignmentMapping + 1][0] = tmp.resNumber; -mapping[tmp.alignmentMapping + 1][1] = tmp.atomIndex; -}index++; -} while (index < maxChain.atoms.size ()); -if (protocol.equals (jalview.io.AppletFormatAdapter.PASTE)) { -pdbFile = "INLINE" + pdb.id; -}var newMapping = new jalview.structure.StructureMapping (seq, pdbFile, pdb.id, maxChainId, mapping, mappingDetails.toString ()); -if (forStructureView) { -this.mappings.add (newMapping); -}maxChain.transferResidueAnnotation (newMapping, sqmpping); -} -return pdb; -}, "~B,~A,~A,~S,~S"); -Clazz.defineMethod (c$, "removeStructureViewerListener", -function (svl, pdbfiles) { -this.listeners.removeElement (svl); -if (Clazz.instanceOf (svl, jalview.structure.SequenceListener)) { -for (var i = 0; i < this.listeners.size (); i++) { -if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) { -(this.listeners.elementAt (i)).releaseReferences (svl); -}} -}if (pdbfiles == null) { -return; -}var pdbs = new java.util.ArrayList (java.util.Arrays.asList (pdbfiles)); -var sl; -for (var i = 0; i < this.listeners.size (); i++) { -if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) { -sl = this.listeners.elementAt (i); -for (var pdbfile, $pdbfile = 0, $$pdbfile = sl.getPdbFile (); $pdbfile < $$pdbfile.length && ((pdbfile = $$pdbfile[$pdbfile]) || true); $pdbfile++) { -pdbs.remove (pdbfile); -} -}} -if (pdbs.size () > 0) { -var tmp = new java.util.ArrayList (); -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -if (!pdbs.contains (sm.pdbfile)) { -tmp.add (sm); -}} -this.mappings = tmp; -}}, "~O,~A"); -Clazz.defineMethod (c$, "mouseOverStructure", -function (pdbResNum, chain, pdbfile) { -var atomSpec = new jalview.structure.AtomSpec (pdbfile, chain, pdbResNum, 0); -var atoms = java.util.Collections.singletonList (atomSpec); -this.mouseOverStructure (atoms); -}, "~N,~S,~S"); -Clazz.defineMethod (c$, "mouseOverStructure", -function (atoms) { -if (this.listeners == null) { -return; -}var hasSequenceListener = false; -for (var i = 0; i < this.listeners.size (); i++) { -if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.SequenceListener)) { -hasSequenceListener = true; -}} -if (!hasSequenceListener) { -return; -}var results = new jalview.datamodel.SearchResults (); -for (var atom, $atom = atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) { -var lastseq = null; -var lastipos = -1; -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -if (sm.pdbfile.equals (atom.getPdbFile ()) && sm.pdbchain.equals (atom.getChain ())) { -var indexpos = sm.getSeqPos (atom.getPdbResNum ()); -if (lastipos != indexpos && lastseq !== sm.sequence) { -results.addResult (sm.sequence, indexpos, indexpos); -lastipos = indexpos; -lastseq = sm.sequence; -for (var acf, $acf = this.seqmappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) { -acf.markMappedRegion (sm.sequence, indexpos, results); -} -}}} -} -for (var li, $li = this.listeners.iterator (); $li.hasNext () && ((li = $li.next ()) || true);) { -if (Clazz.instanceOf (li, jalview.structure.SequenceListener)) { -(li).highlightSequence (results); -}} -}, "java.util.List"); -Clazz.defineMethod (c$, "mouseOverSequence", -function (seq, indexpos, index, source) { -var hasSequenceListeners = this.handlingVamsasMo || !this.seqmappings.isEmpty (); -var results = null; -if (index == -1) { -index = seq.findPosition (indexpos); -}for (var i = 0; i < this.listeners.size (); i++) { -var listener = this.listeners.elementAt (i); -if (listener === source) { -continue; -}if (Clazz.instanceOf (listener, jalview.structure.StructureListener)) { -this.highlightStructure (listener, seq, index); -} else { -if (Clazz.instanceOf (listener, jalview.structure.SequenceListener)) { -var seqListener = listener; -if (hasSequenceListeners && seqListener.getVamsasSource () !== source) { -if (this.relaySeqMappings) { -if (results == null) { -results = jalview.util.MappingUtils.buildSearchResults (seq, index, this.seqmappings); -}if (this.handlingVamsasMo) { -results.addResult (seq, index, index); -}seqListener.highlightSequence (results); -}}} else if (Clazz.instanceOf (listener, jalview.structure.VamsasListener) && !this.handlingVamsasMo) { -(listener).mouseOverSequence (seq, indexpos, source); -} else if (Clazz.instanceOf (listener, jalview.structure.SecondaryStructureListener)) { -(listener).mouseOverSequence (seq, indexpos, index); -}}} -}, "jalview.datamodel.SequenceI,~N,~N,jalview.structure.VamsasSource"); -Clazz.defineMethod (c$, "highlightStructure", -function (sl, seq, index) { -if (!sl.isListeningFor (seq)) { -return; -}var atomNo; -var atoms = new java.util.ArrayList (); -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -if (sm.sequence === seq || sm.sequence === seq.getDatasetSequence ()) { -atomNo = sm.getAtomNum (index); -if (atomNo > 0) { -atoms.add ( new jalview.structure.AtomSpec (sm.pdbfile, sm.pdbchain, sm.getPDBResNum (index), atomNo)); -}}} -sl.highlightAtoms (atoms); -}, "jalview.structure.StructureListener,jalview.datamodel.SequenceI,~N"); -Clazz.defineMethod (c$, "mouseOverVamsasSequence", -function (sequenceI, position, source) { -this.handlingVamsasMo = true; -var msg = sequenceI.hashCode () * (1 + position); -if (this.lastmsg != msg) { -this.lastmsg = msg; -this.mouseOverSequence (sequenceI, position, -1, source); -}this.handlingVamsasMo = false; -}, "jalview.datamodel.SequenceI,~N,jalview.structure.VamsasSource"); -Clazz.defineMethod (c$, "colourSequenceFromStructure", -function (seq, pdbid) { -return null; -}, "jalview.datamodel.SequenceI,~S"); -Clazz.defineMethod (c$, "structureSelectionChanged", -function () { -}); -Clazz.defineMethod (c$, "sequenceSelectionChanged", -function () { -}); -Clazz.defineMethod (c$, "sequenceColoursChanged", -function (source) { -var sl; -for (var i = 0; i < this.listeners.size (); i++) { -if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) { -sl = this.listeners.elementAt (i); -sl.updateColours (source); -}} -}, "~O"); -Clazz.defineMethod (c$, "getMapping", -function (pdbfile) { -var tmp = new java.util.ArrayList (); -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -if (sm.pdbfile.equals (pdbfile)) { -tmp.add (sm); -}} -return tmp.toArray ( new Array (tmp.size ())); -}, "~S"); -Clazz.defineMethod (c$, "printMappings", -function (pdbfile, seqs) { -if (pdbfile == null || seqs == null || seqs.isEmpty ()) { -return ""; -}var sb = new StringBuilder (64); -for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { -if (sm.pdbfile.equals (pdbfile) && seqs.contains (sm.sequence)) { -sb.append (sm.mappingDetails); -sb.append (jalview.structure.StructureSelectionManager.NEWLINE); -sb.append ("====================="); -sb.append (jalview.structure.StructureSelectionManager.NEWLINE); -}} -sb.append (jalview.structure.StructureSelectionManager.NEWLINE); -return sb.toString (); -}, "~S,java.util.List"); -Clazz.defineMethod (c$, "removeMappings", -function (set) { -if (set != null) { -for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) { -this.removeMapping (acf); -} -}}, "java.util.Set"); -Clazz.defineMethod (c$, "removeMapping", -function (acf) { -if (acf != null && this.seqmappings.contains (acf)) { -var count = (this.seqMappingRefCounts.get (acf)).intValue (); -count--; -if (count > 0) { -this.seqMappingRefCounts.put (acf, new Integer (count)); -} else { -this.seqmappings.remove (acf); -this.seqMappingRefCounts.remove (acf); -}}}, "jalview.datamodel.AlignedCodonFrame"); -Clazz.defineMethod (c$, "addMappings", -function (set) { -if (set != null) { -for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) { -this.addMapping (acf); -} -}}, "java.util.Set"); -Clazz.defineMethod (c$, "addMapping", -function (acf) { -if (acf != null) { -if (this.seqmappings.contains (acf)) { -this.seqMappingRefCounts.put (acf, new Integer ((this.seqMappingRefCounts.get (acf)).intValue () + 1)); -} else { -this.seqmappings.add (acf); -this.seqMappingRefCounts.put (acf, new Integer (1)); -}}}, "jalview.datamodel.AlignedCodonFrame"); -Clazz.defineMethod (c$, "addSelectionListener", -function (selecter) { -if (!this.sel_listeners.contains (selecter)) { -this.sel_listeners.add (selecter); -}}, "jalview.structure.SelectionListener"); -Clazz.defineMethod (c$, "removeSelectionListener", -function (toremove) { -if (this.sel_listeners.contains (toremove)) { -this.sel_listeners.remove (toremove); -}}, "jalview.structure.SelectionListener"); -Clazz.defineMethod (c$, "sendSelection", -function (selection, colsel, source) { -for (var slis, $slis = this.sel_listeners.iterator (); $slis.hasNext () && ((slis = $slis.next ()) || true);) { -if (slis !== source) { -slis.selection (selection, colsel, source); -}} -}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource"); -Clazz.defineMethod (c$, "sendViewPosition", -function (source, startRes, endRes, startSeq, endSeq) { -if (this.view_listeners != null && this.view_listeners.size () > 0) { -var listeners = this.view_listeners.elements (); -while (listeners.hasMoreElements ()) { -var slis = listeners.nextElement (); -if (slis !== source) { -slis.viewPosition (startRes, endRes, startSeq, endSeq, source); -};} -}}, "jalview.api.AlignmentViewPanel,~N,~N,~N,~N"); -c$.release = Clazz.defineMethod (c$, "release", -function (jalviewLite) { -{ -if (jalview.structure.StructureSelectionManager.instances == null) { -return; -}var mnger = (jalview.structure.StructureSelectionManager.instances.get (jalviewLite)); -if (mnger != null) { -jalview.structure.StructureSelectionManager.instances.remove (jalviewLite); -try { -mnger.finalize (); -} catch (x) { -} -}}}, "jalview.api.StructureSelectionManagerProvider"); -Clazz.defineMethod (c$, "registerPDBEntry", -function (pdbentry) { -if (pdbentry.getFile () != null && pdbentry.getFile ().trim ().length > 0) { -this.registerPDBFile (pdbentry.getId (), pdbentry.getFile ()); -}}, "jalview.datamodel.PDBEntry"); -Clazz.defineMethod (c$, "addCommandListener", -function (cl) { -if (!this.commandListeners.contains (cl)) { -this.commandListeners.add (cl); -}}, "jalview.structure.CommandListener"); -Clazz.defineMethod (c$, "hasCommandListener", -function (cl) { -return this.commandListeners.contains (cl); -}, "jalview.structure.CommandListener"); -Clazz.defineMethod (c$, "removeCommandListener", -function (l) { -return this.commandListeners.remove (l); -}, "jalview.structure.CommandListener"); -Clazz.defineMethod (c$, "commandPerformed", -function (command, undo, source) { -for (var listener, $listener = this.commandListeners.iterator (); $listener.hasNext () && ((listener = $listener.next ()) || true);) { -listener.mirrorCommand (command, undo, this, source); -} -}, "jalview.commands.CommandI,~B,jalview.structure.VamsasSource"); -Clazz.defineMethod (c$, "mapCommand", -function (command, undo, mapTo, gapChar) { -if (Clazz.instanceOf (command, jalview.commands.EditCommand)) { -return jalview.util.MappingUtils.mapEditCommand (command, undo, mapTo, gapChar, this.seqmappings); -} else if (Clazz.instanceOf (command, jalview.commands.OrderCommand)) { -return jalview.util.MappingUtils.mapOrderCommand (command, undo, mapTo, this.seqmappings); -}return null; -}, "jalview.commands.CommandI,~B,jalview.datamodel.AlignmentI,~S"); -c$.$StructureSelectionManager$1$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.structure, "StructureSelectionManager$1", java.io.PrintStream); -Clazz.defineMethod (c$, "print", -function (x) { -this.f$.mappingDetails.append (x); -}, "~S"); -Clazz.defineMethod (c$, "println", -function () { -this.f$.mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE); -}); -c$ = Clazz.p0p (); -}; -c$.NEWLINE = c$.prototype.NEWLINE = System.lineSeparator (); -Clazz.defineStatics (c$, -"instances", null, -"nullProvider", null); -}); +Clazz.declarePackage ("jalview.structure"); +Clazz.load (["java.util.ArrayList", "$.HashMap", "$.LinkedHashSet", "$.Vector"], "jalview.structure.StructureSelectionManager", ["MCview.PDBfile", "jalview.analysis.AlignSeq", "jalview.commands.EditCommand", "$.OrderCommand", "jalview.datamodel.Mapping", "$.SearchResults", "jalview.io.AppletFormatAdapter", "jalview.structure.AtomSpec", "$.SecondaryStructureListener", "$.SequenceListener", "$.StructureListener", "$.StructureMapping", "$.VamsasListener", "jalview.util.MappingUtils", "$.MessageManager", "java.lang.Error", "$.NullPointerException", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.IdentityHashMap"], function () { +c$ = Clazz.decorateAsClass (function () { +this.mappings = null; +this.processSecondaryStructure = false; +this.secStructServices = false; +this.addTempFacAnnot = false; +this.seqmappings = null; +this.seqMappingRefCounts = null; +this.commandListeners = null; +this.sel_listeners = null; +this.pdbIdFileName = null; +this.pdbFileNameId = null; +this.relaySeqMappings = true; +this.listeners = null; +this.handlingVamsasMo = false; +this.lastmsg = 0; +this.view_listeners = null; +Clazz.instantialize (this, arguments); +}, jalview.structure, "StructureSelectionManager"); +Clazz.prepareFields (c$, function () { +this.mappings = new java.util.ArrayList (); +this.seqmappings = new java.util.LinkedHashSet (); +this.seqMappingRefCounts = new java.util.HashMap (); +this.commandListeners = new java.util.ArrayList (); +this.sel_listeners = new java.util.ArrayList (); +this.pdbIdFileName = new java.util.HashMap (); +this.pdbFileNameId = new java.util.HashMap (); +this.listeners = new java.util.Vector (); +this.view_listeners = new java.util.Vector (); +}); +Clazz.defineMethod (c$, "isSecStructServices", +function () { +return this.secStructServices; +}); +Clazz.defineMethod (c$, "setSecStructServices", +function (secStructServices) { +this.secStructServices = secStructServices; +}, "~B"); +Clazz.defineMethod (c$, "isAddTempFacAnnot", +function () { +return this.addTempFacAnnot; +}); +Clazz.defineMethod (c$, "setAddTempFacAnnot", +function (addTempFacAnnot) { +this.addTempFacAnnot = addTempFacAnnot; +}, "~B"); +Clazz.defineMethod (c$, "isProcessSecondaryStructure", +function () { +return this.processSecondaryStructure; +}); +Clazz.defineMethod (c$, "setProcessSecondaryStructure", +function (enable) { +this.processSecondaryStructure = enable; +}, "~B"); +Clazz.defineMethod (c$, "reportMapping", +function () { +if (this.mappings.isEmpty ()) { +System.err.println ("reportMapping: No PDB/Sequence mappings."); +} else { +System.err.println ("reportMapping: There are " + this.mappings.size () + " mappings."); +var i = 0; +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +System.err.println ("mapping " + i++ + " : " + sm.pdbfile); +} +}}); +Clazz.defineMethod (c$, "registerPDBFile", +function (idForFile, absoluteFile) { +this.pdbIdFileName.put (idForFile, absoluteFile); +this.pdbFileNameId.put (absoluteFile, idForFile); +}, "~S,~S"); +Clazz.defineMethod (c$, "findIdForPDBFile", +function (idOrFile) { +var id = this.pdbFileNameId.get (idOrFile); +return id; +}, "~S"); +Clazz.defineMethod (c$, "findFileForPDBId", +function (idOrFile) { +var id = this.pdbIdFileName.get (idOrFile); +return id; +}, "~S"); +Clazz.defineMethod (c$, "isPDBFileRegistered", +function (idOrFile) { +return this.pdbFileNameId.containsKey (idOrFile) || this.pdbIdFileName.containsKey (idOrFile); +}, "~S"); +c$.getStructureSelectionManager = Clazz.defineMethod (c$, "getStructureSelectionManager", +function (context) { +if (context == null) { +if (jalview.structure.StructureSelectionManager.nullProvider == null) { +if (jalview.structure.StructureSelectionManager.instances != null) { +throw new Error (jalview.util.MessageManager.getString ("error.implementation_error_structure_selection_manager_null"), new NullPointerException (jalview.util.MessageManager.getString ("exception.ssm_context_is_null"))); +} else { +jalview.structure.StructureSelectionManager.nullProvider = new jalview.structure.StructureSelectionManager (); +}return jalview.structure.StructureSelectionManager.nullProvider; +}}if (jalview.structure.StructureSelectionManager.instances == null) { +jalview.structure.StructureSelectionManager.instances = new java.util.IdentityHashMap (); +}var instance = jalview.structure.StructureSelectionManager.instances.get (context); +if (instance == null) { +if (jalview.structure.StructureSelectionManager.nullProvider != null) { +instance = jalview.structure.StructureSelectionManager.nullProvider; +} else { +instance = new jalview.structure.StructureSelectionManager (); +}jalview.structure.StructureSelectionManager.instances.put (context, instance); +}return instance; +}, "jalview.api.StructureSelectionManagerProvider"); +Clazz.defineMethod (c$, "setRelaySeqMappings", +function (relay) { +this.relaySeqMappings = relay; +}, "~B"); +Clazz.defineMethod (c$, "isRelaySeqMappingsEnabled", +function () { +return this.relaySeqMappings; +}); +Clazz.defineMethod (c$, "addStructureViewerListener", +function (svl) { +if (!this.listeners.contains (svl)) { +this.listeners.addElement (svl); +}}, "~O"); +Clazz.defineMethod (c$, "alreadyMappedToFile", +function (pdbid) { +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +if (sm.getPdbId ().equals (pdbid)) { +return sm.pdbfile; +}} +return null; +}, "~S"); +Clazz.defineMethod (c$, "setMapping", +function (sequence, targetChains, pdbFile, protocol) { +return this.setMapping (true, sequence, targetChains, pdbFile, protocol); +}, "~A,~A,~S,~S"); +Clazz.defineMethod (c$, "setMapping", +function (forStructureView, sequence, targetChains, pdbFile, protocol) { +var parseSecStr = this.processSecondaryStructure; +if (this.isPDBFileRegistered (pdbFile)) { +for (var sq, $sq = 0, $$sq = sequence; $sq < $$sq.length && ((sq = $$sq[$sq]) || true); $sq++) { +var ds = sq; +while (ds.getDatasetSequence () != null) { +ds = ds.getDatasetSequence (); +} +;if (ds.getAnnotation () != null) { +for (var ala, $ala = 0, $$ala = ds.getAnnotation (); $ala < $$ala.length && ((ala = $$ala[$ala]) || true); $ala++) { +if (MCview.PDBfile.isCalcIdForFile (ala, this.findIdForPDBFile (pdbFile))) { +parseSecStr = false; +}} +}} +}var pdb = null; +try { +pdb = new MCview.PDBfile (this.addTempFacAnnot, parseSecStr, this.secStructServices, pdbFile, protocol); +if (pdb.id != null && pdb.id.trim ().length > 0 && jalview.io.AppletFormatAdapter.FILE.equals (protocol)) { +this.registerPDBFile (pdb.id.trim (), pdbFile); +}} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +return null; +} else { +throw ex; +} +} +var targetChain; +for (var s = 0; s < sequence.length; s++) { +var infChain = true; +var seq = sequence[s]; +if (targetChains != null && targetChains[s] != null) { +infChain = false; +targetChain = targetChains[s]; +} else if (seq.getName ().indexOf ("|") > -1) { +targetChain = seq.getName ().substring (seq.getName ().lastIndexOf ("|") + 1); +if (targetChain.length > 1) { +if (targetChain.trim ().length == 0) { +targetChain = " "; +} else { +targetChain = ""; +}}} else { +targetChain = ""; +}var max = -10; +var maxAlignseq = null; +var maxChainId = " "; +var maxChain = null; +var first = true; +for (var chain, $chain = pdb.chains.iterator (); $chain.hasNext () && ((chain = $chain.next ()) || true);) { +if (targetChain.length > 0 && !targetChain.equals (chain.id) && !infChain) { +continue; +}var type = chain.isNa ? "dna" : "pep"; +var as = jalview.analysis.AlignSeq.doGlobalNWAlignment (seq, chain.sequence, type); +if (first || as.maxscore > max || (as.maxscore == max && chain.id.equals (targetChain))) { +first = false; +maxChain = chain; +max = as.maxscore; +maxAlignseq = as; +maxChainId = chain.id; +}} +if (maxChain == null) { +continue; +}var mappingDetails = new StringBuilder (128); +mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB Sequence is :").append (jalview.structure.StructureSelectionManager.NEWLINE).append ("Sequence = ").append (maxChain.sequence.getSequenceAsString ()); +mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("No of residues = ").append (maxChain.residues.size ()).append (jalview.structure.StructureSelectionManager.NEWLINE).append (jalview.structure.StructureSelectionManager.NEWLINE); +var ps = ((Clazz.isClassDefined ("jalview.structure.StructureSelectionManager$1") ? 0 : jalview.structure.StructureSelectionManager.$StructureSelectionManager$1$ ()), Clazz.innerTypeInstance (jalview.structure.StructureSelectionManager$1, this, Clazz.cloneFinals ("mappingDetails", mappingDetails), System.out)); +maxAlignseq.printAlignment (ps); +mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB start/end "); +mappingDetails.append (String.valueOf (maxAlignseq.seq2start)).append (" "); +mappingDetails.append (String.valueOf (maxAlignseq.seq2end)); +mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("SEQ start/end "); +mappingDetails.append (String.valueOf (maxAlignseq.seq1start + seq.getStart () - 1)).append (" "); +mappingDetails.append (String.valueOf (maxAlignseq.seq1end + seq.getEnd () - 1)); +maxChain.makeExactMapping (maxAlignseq, seq); +var sqmpping = maxAlignseq.getMappingFromS1 (false); +var omap = new jalview.datamodel.Mapping (sqmpping.getMap ().getInverse ()); +maxChain.transferRESNUMFeatures (seq, null); +var mapping = Clazz.newIntArray (seq.findPosition (seq.getLength ()) + 2, 2, 0); +var resNum = -10000; +var index = 0; +do { +var tmp = maxChain.atoms.elementAt (index); +if (resNum != tmp.resNumber && tmp.alignmentMapping != -1) { +resNum = tmp.resNumber; +mapping[tmp.alignmentMapping + 1][0] = tmp.resNumber; +mapping[tmp.alignmentMapping + 1][1] = tmp.atomIndex; +}index++; +} while (index < maxChain.atoms.size ()); +if (protocol.equals (jalview.io.AppletFormatAdapter.PASTE)) { +pdbFile = "INLINE" + pdb.id; +}var newMapping = new jalview.structure.StructureMapping (seq, pdbFile, pdb.id, maxChainId, mapping, mappingDetails.toString ()); +if (forStructureView) { +this.mappings.add (newMapping); +}maxChain.transferResidueAnnotation (newMapping, sqmpping); +} +return pdb; +}, "~B,~A,~A,~S,~S"); +Clazz.defineMethod (c$, "removeStructureViewerListener", +function (svl, pdbfiles) { +this.listeners.removeElement (svl); +if (Clazz.instanceOf (svl, jalview.structure.SequenceListener)) { +for (var i = 0; i < this.listeners.size (); i++) { +if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) { +(this.listeners.elementAt (i)).releaseReferences (svl); +}} +}if (pdbfiles == null) { +return; +}var pdbs = new java.util.ArrayList (java.util.Arrays.asList (pdbfiles)); +var sl; +for (var i = 0; i < this.listeners.size (); i++) { +if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) { +sl = this.listeners.elementAt (i); +for (var pdbfile, $pdbfile = 0, $$pdbfile = sl.getPdbFile (); $pdbfile < $$pdbfile.length && ((pdbfile = $$pdbfile[$pdbfile]) || true); $pdbfile++) { +pdbs.remove (pdbfile); +} +}} +if (pdbs.size () > 0) { +var tmp = new java.util.ArrayList (); +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +if (!pdbs.contains (sm.pdbfile)) { +tmp.add (sm); +}} +this.mappings = tmp; +}}, "~O,~A"); +Clazz.defineMethod (c$, "mouseOverStructure", +function (pdbResNum, chain, pdbfile) { +var atomSpec = new jalview.structure.AtomSpec (pdbfile, chain, pdbResNum, 0); +var atoms = java.util.Collections.singletonList (atomSpec); +this.mouseOverStructure (atoms); +}, "~N,~S,~S"); +Clazz.defineMethod (c$, "mouseOverStructure", +function (atoms) { +if (this.listeners == null) { +return; +}var hasSequenceListener = false; +for (var i = 0; i < this.listeners.size (); i++) { +if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.SequenceListener)) { +hasSequenceListener = true; +}} +if (!hasSequenceListener) { +return; +}var results = new jalview.datamodel.SearchResults (); +for (var atom, $atom = atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) { +var lastseq = null; +var lastipos = -1; +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +if (sm.pdbfile.equals (atom.getPdbFile ()) && sm.pdbchain.equals (atom.getChain ())) { +var indexpos = sm.getSeqPos (atom.getPdbResNum ()); +if (lastipos != indexpos && lastseq !== sm.sequence) { +results.addResult (sm.sequence, indexpos, indexpos); +lastipos = indexpos; +lastseq = sm.sequence; +for (var acf, $acf = this.seqmappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) { +acf.markMappedRegion (sm.sequence, indexpos, results); +} +}}} +} +for (var li, $li = this.listeners.iterator (); $li.hasNext () && ((li = $li.next ()) || true);) { +if (Clazz.instanceOf (li, jalview.structure.SequenceListener)) { +(li).highlightSequence (results); +}} +}, "java.util.List"); +Clazz.defineMethod (c$, "mouseOverSequence", +function (seq, indexpos, index, source) { +var hasSequenceListeners = this.handlingVamsasMo || !this.seqmappings.isEmpty (); +var results = null; +if (index == -1) { +index = seq.findPosition (indexpos); +}for (var i = 0; i < this.listeners.size (); i++) { +var listener = this.listeners.elementAt (i); +if (listener === source) { +continue; +}if (Clazz.instanceOf (listener, jalview.structure.StructureListener)) { +this.highlightStructure (listener, seq, index); +} else { +if (Clazz.instanceOf (listener, jalview.structure.SequenceListener)) { +var seqListener = listener; +if (hasSequenceListeners && seqListener.getVamsasSource () !== source) { +if (this.relaySeqMappings) { +if (results == null) { +results = jalview.util.MappingUtils.buildSearchResults (seq, index, this.seqmappings); +}if (this.handlingVamsasMo) { +results.addResult (seq, index, index); +}seqListener.highlightSequence (results); +}}} else if (Clazz.instanceOf (listener, jalview.structure.VamsasListener) && !this.handlingVamsasMo) { +(listener).mouseOverSequence (seq, indexpos, source); +} else if (Clazz.instanceOf (listener, jalview.structure.SecondaryStructureListener)) { +(listener).mouseOverSequence (seq, indexpos, index); +}}} +}, "jalview.datamodel.SequenceI,~N,~N,jalview.structure.VamsasSource"); +Clazz.defineMethod (c$, "highlightStructure", +function (sl, seq, index) { +if (!sl.isListeningFor (seq)) { +return; +}var atomNo; +var atoms = new java.util.ArrayList (); +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +if (sm.sequence === seq || sm.sequence === seq.getDatasetSequence ()) { +atomNo = sm.getAtomNum (index); +if (atomNo > 0) { +atoms.add ( new jalview.structure.AtomSpec (sm.pdbfile, sm.pdbchain, sm.getPDBResNum (index), atomNo)); +}}} +sl.highlightAtoms (atoms); +}, "jalview.structure.StructureListener,jalview.datamodel.SequenceI,~N"); +Clazz.defineMethod (c$, "mouseOverVamsasSequence", +function (sequenceI, position, source) { +this.handlingVamsasMo = true; +var msg = sequenceI.hashCode () * (1 + position); +if (this.lastmsg != msg) { +this.lastmsg = msg; +this.mouseOverSequence (sequenceI, position, -1, source); +}this.handlingVamsasMo = false; +}, "jalview.datamodel.SequenceI,~N,jalview.structure.VamsasSource"); +Clazz.defineMethod (c$, "colourSequenceFromStructure", +function (seq, pdbid) { +return null; +}, "jalview.datamodel.SequenceI,~S"); +Clazz.defineMethod (c$, "structureSelectionChanged", +function () { +}); +Clazz.defineMethod (c$, "sequenceSelectionChanged", +function () { +}); +Clazz.defineMethod (c$, "sequenceColoursChanged", +function (source) { +var sl; +for (var i = 0; i < this.listeners.size (); i++) { +if (Clazz.instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) { +sl = this.listeners.elementAt (i); +sl.updateColours (source); +}} +}, "~O"); +Clazz.defineMethod (c$, "getMapping", +function (pdbfile) { +var tmp = new java.util.ArrayList (); +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +if (sm.pdbfile.equals (pdbfile)) { +tmp.add (sm); +}} +return tmp.toArray ( new Array (tmp.size ())); +}, "~S"); +Clazz.defineMethod (c$, "printMappings", +function (pdbfile, seqs) { +if (pdbfile == null || seqs == null || seqs.isEmpty ()) { +return ""; +}var sb = new StringBuilder (64); +for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) { +if (sm.pdbfile.equals (pdbfile) && seqs.contains (sm.sequence)) { +sb.append (sm.mappingDetails); +sb.append (jalview.structure.StructureSelectionManager.NEWLINE); +sb.append ("====================="); +sb.append (jalview.structure.StructureSelectionManager.NEWLINE); +}} +sb.append (jalview.structure.StructureSelectionManager.NEWLINE); +return sb.toString (); +}, "~S,java.util.List"); +Clazz.defineMethod (c$, "removeMappings", +function (set) { +if (set != null) { +for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) { +this.removeMapping (acf); +} +}}, "java.util.Set"); +Clazz.defineMethod (c$, "removeMapping", +function (acf) { +if (acf != null && this.seqmappings.contains (acf)) { +var count = (this.seqMappingRefCounts.get (acf)).intValue (); +count--; +if (count > 0) { +this.seqMappingRefCounts.put (acf, new Integer (count)); +} else { +this.seqmappings.remove (acf); +this.seqMappingRefCounts.remove (acf); +}}}, "jalview.datamodel.AlignedCodonFrame"); +Clazz.defineMethod (c$, "addMappings", +function (set) { +if (set != null) { +for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) { +this.addMapping (acf); +} +}}, "java.util.Set"); +Clazz.defineMethod (c$, "addMapping", +function (acf) { +if (acf != null) { +if (this.seqmappings.contains (acf)) { +this.seqMappingRefCounts.put (acf, new Integer ((this.seqMappingRefCounts.get (acf)).intValue () + 1)); +} else { +this.seqmappings.add (acf); +this.seqMappingRefCounts.put (acf, new Integer (1)); +}}}, "jalview.datamodel.AlignedCodonFrame"); +Clazz.defineMethod (c$, "addSelectionListener", +function (selecter) { +if (!this.sel_listeners.contains (selecter)) { +this.sel_listeners.add (selecter); +}}, "jalview.structure.SelectionListener"); +Clazz.defineMethod (c$, "removeSelectionListener", +function (toremove) { +if (this.sel_listeners.contains (toremove)) { +this.sel_listeners.remove (toremove); +}}, "jalview.structure.SelectionListener"); +Clazz.defineMethod (c$, "sendSelection", +function (selection, colsel, source) { +for (var slis, $slis = this.sel_listeners.iterator (); $slis.hasNext () && ((slis = $slis.next ()) || true);) { +if (slis !== source) { +slis.selection (selection, colsel, source); +}} +}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource"); +Clazz.defineMethod (c$, "sendViewPosition", +function (source, startRes, endRes, startSeq, endSeq) { +if (this.view_listeners != null && this.view_listeners.size () > 0) { +var listeners = this.view_listeners.elements (); +while (listeners.hasMoreElements ()) { +var slis = listeners.nextElement (); +if (slis !== source) { +slis.viewPosition (startRes, endRes, startSeq, endSeq, source); +};} +}}, "jalview.api.AlignmentViewPanel,~N,~N,~N,~N"); +c$.release = Clazz.defineMethod (c$, "release", +function (jalviewLite) { +{ +if (jalview.structure.StructureSelectionManager.instances == null) { +return; +}var mnger = (jalview.structure.StructureSelectionManager.instances.get (jalviewLite)); +if (mnger != null) { +jalview.structure.StructureSelectionManager.instances.remove (jalviewLite); +try { +mnger.finalize (); +} catch (x) { +} +}}}, "jalview.api.StructureSelectionManagerProvider"); +Clazz.defineMethod (c$, "registerPDBEntry", +function (pdbentry) { +if (pdbentry.getFile () != null && pdbentry.getFile ().trim ().length > 0) { +this.registerPDBFile (pdbentry.getId (), pdbentry.getFile ()); +}}, "jalview.datamodel.PDBEntry"); +Clazz.defineMethod (c$, "addCommandListener", +function (cl) { +if (!this.commandListeners.contains (cl)) { +this.commandListeners.add (cl); +}}, "jalview.structure.CommandListener"); +Clazz.defineMethod (c$, "hasCommandListener", +function (cl) { +return this.commandListeners.contains (cl); +}, "jalview.structure.CommandListener"); +Clazz.defineMethod (c$, "removeCommandListener", +function (l) { +return this.commandListeners.remove (l); +}, "jalview.structure.CommandListener"); +Clazz.defineMethod (c$, "commandPerformed", +function (command, undo, source) { +for (var listener, $listener = this.commandListeners.iterator (); $listener.hasNext () && ((listener = $listener.next ()) || true);) { +listener.mirrorCommand (command, undo, this, source); +} +}, "jalview.commands.CommandI,~B,jalview.structure.VamsasSource"); +Clazz.defineMethod (c$, "mapCommand", +function (command, undo, mapTo, gapChar) { +if (Clazz.instanceOf (command, jalview.commands.EditCommand)) { +return jalview.util.MappingUtils.mapEditCommand (command, undo, mapTo, gapChar, this.seqmappings); +} else if (Clazz.instanceOf (command, jalview.commands.OrderCommand)) { +return jalview.util.MappingUtils.mapOrderCommand (command, undo, mapTo, this.seqmappings); +}return null; +}, "jalview.commands.CommandI,~B,jalview.datamodel.AlignmentI,~S"); +c$.$StructureSelectionManager$1$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.structure, "StructureSelectionManager$1", java.io.PrintStream); +Clazz.defineMethod (c$, "print", +function (x) { +this.f$.mappingDetails.append (x); +}, "~S"); +Clazz.defineMethod (c$, "println", +function () { +this.f$.mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE); +}); +c$ = Clazz.p0p (); +}; +c$.NEWLINE = c$.prototype.NEWLINE = System.lineSeparator (); +Clazz.defineStatics (c$, +"instances", null, +"nullProvider", null); +});