From: Jim Procter Date: Fri, 29 Jul 2016 14:02:03 +0000 (+0100) Subject: JAL-2154 register any new dataset codon frames only when all data imported X-Git-Tag: Release_2_10_0~125^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=270072611e8fb78f0e2df6205778a93a03c7199c;p=jalview.git JAL-2154 register any new dataset codon frames only when all data imported --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 094fa7a..3e1359d 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -2349,6 +2349,7 @@ public class Jalview2XML initSeqRefs(); } AlignFrame af = null, _af = null; + IdentityHashMap importedDatasets = new IdentityHashMap(); Map gatherToThisFrame = new HashMap(); final String file = jprovider.getFilename(); try @@ -2383,6 +2384,9 @@ public class Jalview2XML { gatherToThisFrame.put(af.viewport.getSequenceSetId(), af); } + // Save dataset to register mappings once all resolved + importedDatasets.put(af.viewport.getAlignment().getDataset(), + af.viewport.getAlignment().getDataset()); } } entryCount++; @@ -2456,7 +2460,14 @@ public class Jalview2XML } restoreSplitFrames(); - + for (AlignmentI ds : importedDatasets.keySet()) + { + if (ds.getCodonFrames() != null) + { + StructureSelectionManager.getStructureSelectionManager( + Desktop.instance).registerMappings(ds.getCodonFrames()); + } + } if (errorMessage != null) { reportErrors();