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);
}
}
}
import jalview.gui.Jalview2XML;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.ColourSchemeI;
-import jalview.structure.StructureImportSettings;
-import jalview.structure.StructureImportSettings.StructureParser;
import jalview.viewmodel.AlignmentViewport;
import java.io.File;
Boolean.TRUE.toString());
Cache.applicationProperties.setProperty("ADD_SS_ANN",
Boolean.TRUE.toString());
- StructureImportSettings.setDefaultStructureFileFormat("PDB");
- StructureImportSettings
- .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", FormatAdapter.FILE);
assertTrue("Didn't read in the example file correctly.", af != null);
}
/**
- * test store and recovery of expanded views - currently this is disabled
- * since the Desktop.explodeViews method doesn't seem to result in the views
- * being expanded to distinct align frames when executed programmatically.
+ * test store and recovery of expanded views
*
* @throws Exception
*/
@Test(groups = { "Functional" }, enabled = true)
public void testStoreAndRecoverExpandedviews() throws Exception
{
- StructureImportSettings
- .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
- StructureImportSettings.setDefaultStructureFileFormat("PDB");
+
AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", FormatAdapter.FILE);
assertTrue("Didn't read in the example file correctly.", af != null);
String afid = af.getViewport().getSequenceSetId();
- {
- final AlignFrame xaf = af;
- af = null;
- new Thread(new Runnable()
- {
- @Override
- public void run()
- {
- Desktop.instance.explodeViews(xaf);
- }
- }).start();
- Thread.sleep(1000);
- }
- // int times = 0;
- // while (++times < 5 && Desktop.getAlignFrames().length < )
- // {
- // Thread.sleep(300);
- // }
+
+ // check FileLoader returned a reference to the one alignFrame that is
+ // actually on the Desktop
+ assertTrue(
+ "Jalview2XML.loadAlignFrame() didn't return correct AlignFrame reference for multiple view window",
+ af == Desktop.getAlignFrameFor(af.getViewport()));
+
+ Desktop.explodeViews(af);
+
int oldviews = Desktop.getAlignFrames().length;
Assert.assertEquals(Desktop.getAlignFrames().length,
Desktop.getAlignmentPanels(afid).length);
public void testStoreAndRecoverReferenceSeqSettings() throws Exception
{
Desktop.instance.closeAll_actionPerformed(null);
- StructureImportSettings.setDefaultStructureFileFormat("PDB");
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", FormatAdapter.FILE);
assertTrue("Didn't read in the example file correctly.", af != null);