}
}
- final String[] pdbf = pdbfilenames.toArray(new String[pdbfilenames
- .size()]);
- final String[] id = pdbids.toArray(new String[pdbids.size()]);
- final SequenceI[][] sq = seqmaps
- .toArray(new SequenceI[seqmaps.size()][]);
- final String fileloc = newFileLoc.toString();
- final String sviewid = viewerData.getKey();
- final AlignFrame alf = af;
- final Rectangle rect = new Rectangle(svattrib.getX(),
- svattrib.getY(), svattrib.getWidth(), svattrib.getHeight());
- try
+ final String[] pdbf = pdbfilenames.toArray(new String[pdbfilenames
+ .size()]);
+ final String[] id = pdbids.toArray(new String[pdbids.size()]);
+ final SequenceI[][] sq = seqmaps
+ .toArray(new SequenceI[seqmaps.size()][]);
+ final String fileloc = newFileLoc.toString();
+ final String sviewid = viewerData.getKey();
+ final AlignFrame alf = af;
+ final Rectangle rect = new Rectangle(svattrib.getX(), svattrib.getY(),
+ svattrib.getWidth(), svattrib.getHeight());
+ try
+ {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable()
{
- javax.swing.SwingUtilities.invokeAndWait(new Runnable()
+ @Override
+ public void run()
{
- @Override
- public void run()
+ JalviewStructureDisplayI sview = null;
+ try
{
- JalviewStructureDisplayI sview = null;
- try
- {
- sview = new StructureViewer(alf.alignPanel
- .getStructureSelectionManager()).createView(
- StructureViewer.ViewerType.JMOL, pdbf, id, sq,
- alf.alignPanel, svattrib, fileloc, rect, sviewid);
- addNewStructureViewer(sview);
- } catch (OutOfMemoryError ex)
+ sview = new StructureViewer(alf.alignPanel
+ .getStructureSelectionManager()).createView(
+ StructureViewer.ViewerType.JMOL, pdbf, id, sq,
+ alf.alignPanel, svattrib, fileloc, rect, sviewid);
+ addNewStructureViewer(sview);
+ } catch (OutOfMemoryError ex)
+ {
+ new OOMWarning("restoring structure view for PDB id " + id,
+ (OutOfMemoryError) ex.getCause());
+ if (sview != null && sview.isVisible())
{
- new OOMWarning("restoring structure view for PDB id " + id,
- (OutOfMemoryError) ex.getCause());
- if (sview != null && sview.isVisible())
- {
- sview.closeViewer(false);
- sview.setVisible(false);
- sview.dispose();
- }
+ sview.closeViewer(false);
+ sview.setVisible(false);
+ sview.dispose();
}
}
- });
- } catch (InvocationTargetException ex)
- {
- warn("Unexpected error when opening Jmol view.", ex);
+ }
+ });
+ } catch (InvocationTargetException ex)
+ {
+ warn("Unexpected error when opening Jmol view.", ex);
- } catch (InterruptedException e)
- {
- // e.printStackTrace();
- }
+ } catch (InterruptedException e)
+ {
+ // e.printStackTrace();
}
+
}
/**