1 package jalview.ext.rbvi.chimera;
3 import static org.junit.Assert.*;
4 import jalview.datamodel.PDBEntry;
5 import jalview.datamodel.SequenceI;
6 import jalview.gui.AlignFrame;
7 import jalview.gui.StructureViewer;
8 import jalview.gui.StructureViewer.Viewer;
9 import jalview.io.FormatAdapter;
11 import java.awt.Desktop;
14 import org.junit.After;
15 import org.junit.AfterClass;
16 import org.junit.Before;
17 import org.junit.BeforeClass;
18 import org.junit.Test;
20 public class JalviewChimeraView
24 * @throws java.lang.Exception
27 public static void setUpBeforeClass() throws Exception
29 jalview.bin.Jalview.main(new String[]
30 { "-noquestionnaire -nonews -props", "test/src/jalview/ext/rbvi/chimera/testProps.jvprops" });
34 * @throws java.lang.Exception
37 public static void tearDownAfterClass() throws Exception
39 jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
45 public void testSingleSeqView()
47 String inFile = "examples/1gaq.txt";
48 AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
49 inFile, FormatAdapter.FILE);
50 assertTrue("Didn't read input file " + inFile, af != null);
51 for (SequenceI sq:af.getViewport().getAlignment().getSequences())
53 SequenceI dsq=sq.getDatasetSequence();
54 while (dsq.getDatasetSequence()!=null)
56 dsq=dsq.getDatasetSequence();
58 if (dsq.getPDBId()!=null && dsq.getPDBId().size()>0) {
59 for (int q=0;q<dsq.getPDBId().size();q++)
61 new StructureViewer(af.getViewport().getStructureSelectionManager()).viewStructures(Viewer.JMOL,
62 af.getCurrentView().getAlignPanel(),
63 new PDBEntry[] { (PDBEntry)dsq.getPDBId().elementAt(q) },
64 new SequenceI[][] { new SequenceI[] { sq } });
66 new StructureViewer(af.getViewport().getStructureSelectionManager()).viewStructures(Viewer.CHIMERA,
67 af.getCurrentView().getAlignPanel(),
68 new PDBEntry[] { (PDBEntry)dsq.getPDBId().elementAt(q) },
69 new SequenceI[][] { new SequenceI[] { sq } });
77 } catch (InterruptedException q)