- 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,
+ Console.warn("Unable to save temporary session file before custom structure view export operation.");
+ }
+ }
+
+ ////
+ // Do temporary ops
+
+ sview.getBinding().setBackgroundColour(bgcolour);
+
+ sview.getBinding().executeCommands(extraCommands, false, "Executing Custom Commands");
+
+ // and export the view as an image
+ boolean success = this.checksBeforeWritingToFile(avm,
+ subVals, false, structureImageFilename,
+ "structure image", isError);
+
+ if (!success)
+ {
+ continue;
+ }
+ Console.debug(
+ "Rendering image to " + structureImageFile);
+ //
+ // TODO - extend StructureViewer / Binding with makePDBImage so we can do this with every viewer
+ //
+
+ try {
+ // We don't expect class cast exception
+ AppJmol jmol = (AppJmol) sview;
+ jmol.makePDBImage(structureImageFile, imageType,