import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
+import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
@Test(groups = { "External" })
public void testSingleSeqViewChimera()
{
+
String inFile = "examples/1gaq.txt";
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
DataSourceType.FILE);
/*
* Wait for viewer load thread to complete
*/
- while (!binding.isFinishedInit())
+ do
{
try
{
} catch (InterruptedException e)
{
}
- }
+ } while (!binding.isFinishedInit() || !chimeraViewer.isVisible());
assertTrue(binding.isViewerRunning(), "Failed to start Chimera");
assertEquals(chimeraViewer.getBinding().getPdbCount(), 1);
+ assertTrue(chimeraViewer.hasViewerActionsMenu());
+
+ // now add another sequence and bind to view
+ //
+ AlignmentI al = af.getViewport().getAlignment();
+ PDBEntry xpdb = al.getSequenceAt(0).getPDBEntry("1GAQ");
+ sq = new Sequence("1GAQ", al.getSequenceAt(0).getSequence(25, 95).toString());
+ al.addSequence(sq);
+ structureViewer.viewStructures(new PDBEntry[] { xpdb }, new SequenceI[] { sq }, af.getCurrentView().getAlignPanel());
+
+ /*
+ * Wait for viewer load thread to complete
+ */
+ do
+ {
+ try {
+ Thread.sleep(1500);
+ } catch (InterruptedException q) {};
+ } while (!binding.isLoadingFinished());
+
+ // still just one PDB structure shown
+ assertEquals(chimeraViewer.getBinding().getPdbCount(), 1);
+ // and the viewer action menu should still be visible
+ assertTrue(chimeraViewer.hasViewerActionsMenu());
+
chimeraViewer.closeViewer(true);
chimeraViewer = null;
return;