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(),
e.printStackTrace();
}
- if (Desktop.instance != null)
- {
- Desktop.instance.stopLoading();
- }
-
/*
* Regather multiple views (with the same sequence set id) to the frame (if
* any) that is flagged as the one to gather to, i.e. convert them to tabbed
{
reportErrors();
}
+
+ if (Desktop.instance != null)
+ {
+ Desktop.instance.stopLoading();
+ }
+
return af;
}