.getColourScheme(af);
this.colourAlignFrame(af, imageColour);
+ List<String> extraCommands = new ArrayList<>();
+
+ String bgcolour = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.BGCOLOUR,
+ structureImageSubVals);
+ if (bgcolour != null && bgcolour.length() > 0)
+ {
+ if (bgcolour.charAt(0) == '#')
+ {
+ bgcolour = "[x" + bgcolour.substring(1) + "]";
+ }
+ extraCommands.add("background " + bgcolour);
+ }
+
// TODO MAKE THIS VIEWER INDEPENDENT!!
switch (StructureViewer.getViewerType())
{
Console.debug(
"Rendering image to " + structureImageFile);
jmol.makePDBImage(structureImageFile, imageType,
- renderer, userBis);
+ renderer, userBis, extraCommands);
Console.debug("Finished Rendering image to "
+ structureImageFile);
+ " (or none) will apply. Valid values are the same as "
+ Arg.COLOUR.argString() + ".",
Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWMULTIID),
+ BGCOLOUR(Type.IMAGE, "bgcolor", // being a bit soft on the Americans!
+ "Applies a background colour to the structure image. Valid values are named colours or #RRGGBB.",
+ Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWMULTIID),
/*
STRUCTUREIMAGETYPE(Type.IMAGE,
"Set the structure image format for the preceding --structureimage. Valid values are:\n"
}
jmb.executeCommand(new StructureCommand(command), false);
jmb.executeCommand(new StructureCommand("set hoverDelay=0.1"), false);
+ jmb.executeCommand(new StructureCommand("set antialiasdisplay on"),
+ false);
jmb.setFinishedInit(true);
}
try
{
makePDBImage(null, type, null,
- BitmapImageSizing.defaultBitmapImageSizing());
+ BitmapImageSizing.defaultBitmapImageSizing(), null);
} catch (ImageOutputException ioex)
{
Console.error("Unexpected error whilst writing " + type.toString(),
}
public void makePDBImage(File file, ImageMaker.TYPE type, String renderer,
- BitmapImageSizing userBis) throws ImageOutputException
+ BitmapImageSizing userBis, List<String> extraCommands)
+ throws ImageOutputException
{
int width = getWidth();
int height = getHeight();
}
}
- jmb.jmolViewer.antialiased = true;
+ String saveStateNameTemp = "JalviewSaveStateTemp";
+ jmb.executeCommand(
+ new StructureCommand("save STATE " + saveStateNameTemp),
+ false);
+
+ if (extraCommands != null)
+ {
+ for (String cmd : extraCommands)
+ {
+ jmb.executeCommand(new StructureCommand(cmd), false);
+ }
+ }
+
jmb.jmolViewer.requestRepaintAndWait("image export");
jmb.jmolViewer.renderScreenImage(ig2, usewidth, useheight);
+ jmb.executeCommand(
+ new StructureCommand("restore STATE " + saveStateNameTemp),
+ false);
}
};
String view = MessageManager.getString("action.view")