try
{
+ // create list to store references for any new Jmol viewers created
+ newStructureViewers=new Vector<AppJmol>();
// UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING
// Workaround is to make sure caller implements the JarInputStreamProvider
// interface
jarInputStreamProvider jprovider = createjarInputStreamProvider(file);
af = LoadJalviewAlign(jprovider);
+ setLoadingFinishedForNewStructureViewers();
} catch (MalformedURLException e)
{
errorMessage = "Invalid URL format for '" + file + "'";
sview = new AppJmol(pdbf, id, sq, alf.alignPanel,
useinJmolsuperpos, usetoColourbyseq,
jmolColouring, fileloc, rect, vid);
+ addNewStructureViewer(sview);
} catch (OutOfMemoryError ex)
{
new OOMWarning("restoring structure view for PDB id "
// and finally return.
return af;
}
+ Vector<AppJmol> newStructureViewers=null;
+ protected void addNewStructureViewer(AppJmol sview)
+ {
+ if (newStructureViewers!=null)
+ {
+ sview.jmb.setFinishedLoadingFromArchive(false);
+ newStructureViewers.add(sview);
+ }
+ }
+ protected void setLoadingFinishedForNewStructureViewers()
+ {
+ if (newStructureViewers!=null)
+ {
+ for (AppJmol sview:newStructureViewers)
+ {
+ sview.jmb.setFinishedLoadingFromArchive(true);
+ }
+ newStructureViewers.clear();
+ newStructureViewers=null;
+ }
+ }
AlignFrame loadViewport(String file, JSeq[] JSEQ, Vector hiddenSeqs,
Alignment al, JalviewModelSequence jms, Viewport view,