- @Test
- public void testSingleSeqViewJMol()
- {
- String inFile = "examples/1gaq.txt";
- AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
- inFile, FormatAdapter.FILE);
- assertTrue("Didn't read input file " + inFile, af != null);
- for (SequenceI sq : af.getViewport().getAlignment().getSequences())
- {
- SequenceI dsq = sq.getDatasetSequence();
- while (dsq.getDatasetSequence() != null)
- {
- dsq = dsq.getDatasetSequence();
- }
- if (dsq.getPDBId() != null && dsq.getPDBId().size() > 0)
- {
- for (int q = 0; q < dsq.getPDBId().size(); q++)
- {
- final StructureViewer structureViewer = new StructureViewer(af
- .getViewport().getStructureSelectionManager());
- structureViewer.setViewerType(ViewerType.JMOL);
- JalviewStructureDisplayI jmolViewer = structureViewer
- .viewStructures(dsq.getPDBId().elementAt(q),
- new SequenceI[]
- { sq }, af.getCurrentView().getAlignPanel());
- /*
- * Wait for viewer thread to start
- */
- try
- {
- Thread.sleep(1000);
- } catch (InterruptedException e)
- {
- }
-
- jmolViewer.closeViewer(true);
- // todo: break here means only once through this loop?
- break;
- }
- break;
- }
- }
- }
-
- @Test