Merge branch 'bug/JAL-2154projectMappings' into develop
authorJim Procter <jprocter@issues.jalview.org>
Mon, 1 Aug 2016 14:40:24 +0000 (15:40 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 1 Aug 2016 14:40:24 +0000 (15:40 +0100)
1  2 
src/jalview/gui/Jalview2XML.java

@@@ -2276,21 -2377,16 +2377,24 @@@ public class Jalview2XM
            if (true) // !skipViewport(object))
            {
              _af = loadFromObject(object, file, true, jprovider);
 -            if (object.getJalviewModelSequence().getViewportCount() > 0)
 +            if (_af != null
 +                    && object.getJalviewModelSequence().getViewportCount() > 0)
              {
 -              af = _af;
 -              if (af.viewport.isGatherViewsHere())
 +              if (af == null)
                {
 -                gatherToThisFrame.put(af.viewport.getSequenceSetId(), af);
 +                // store a reference to the first view
 +                af = _af;
 +              }
 +              if (_af.viewport.isGatherViewsHere())
 +              {
 +                // if this is a gathered view, keep its reference since
 +                // after gathering views, only this frame will remain
 +                af = _af;
 +                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++;