- AppJmol jmol = (AppJmol) sview;
- JalviewJmolBinding jmb = (JalviewJmolBinding) jmol
- .getBinding();
- String state = new StringBuilder()
- .append("JalviewCommandsStructureState_")
- .append(viewerType.name()).toString();
- jmb.executeCommand(jc.saveState(state), false);
- for (StructureCommandI scmd : extraCommands)
- {
- jmb.executeCommand(scmd, false);
- }
- try
- {
- boolean success = this.checksBeforeWritingToFile(avm,
- subVals, false, structureImageFilename,
- "structure image", isError);
- if (!success)
- {
- continue;
- }
-
- Console.debug(
- "Rendering image to " + structureImageFile);
- jmol.makePDBImage(structureImageFile, imageType,
- renderer, userBis);
- Console.debug("Finished Rendering image to "
- + structureImageFile);
-
- } catch (ImageOutputException ioexc)
- {
- addError("Unexpected error whilst exporting image to "
- + structureImageFile, ioexc);
- isError = true;
- continue;
- } finally
- {
- jmb.executeCommand(jc.restoreState(state), false);
- }
+ Console.debug(
+ "Restoring session from " + sessionToRestore);
+
+ sview.getBinding().restoreSession(
+ sessionToRestore.getAbsolutePath());