JAL-3364 revisions to split frame image export
[jalview.git] / src / jalview / util / ImageMaker.java
index 099bcee..4438de4 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.util;
 
+import jalview.bin.Cache;
 import jalview.bin.Jalview;
 import jalview.gui.EPSOptions;
 import jalview.gui.IProgressIndicator;
@@ -60,8 +61,6 @@ public class ImageMaker
 
   EpsGraphics2D pg;
 
-  SVGGraphics2D g2;
-
   Graphics graphics;
 
   FileOutputStream out;
@@ -291,15 +290,13 @@ public class ImageMaker
 
   void setupSVG(int width, int height, String title)
   {
+    Graphics2D svgGraphics = new SVGGraphics2D(width, height);
 
-    g2 = new SVGGraphics2D(width, height);
-    Graphics2D ig2 = g2;
-
-    String renderStyle = jalview.bin.Cache.getDefault("SVG_RENDERING",
+    String renderStyle = Cache.getDefault("SVG_RENDERING",
             "Prompt each time");
 
     // If we need to prompt, and if the GUI is visible then
-    // Prompt for EPS rendering style
+    // Prompt for SVG rendering style
     if (renderStyle.equalsIgnoreCase("Prompt each time")
             && !(System.getProperty("java.awt.headless") != null && System
                     .getProperty("java.awt.headless").equals("true")))
@@ -317,13 +314,13 @@ public class ImageMaker
 
     if (renderStyle.equalsIgnoreCase("Lineart"))
     {
-      ig2.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
+      svgGraphics.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
               SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR);
     }
 
     setProgressMessage(MessageManager
             .formatMessage("status.export_complete", type.getName()));
-    graphics = g2;
+    graphics = svgGraphics;
   }
 
   static JalviewFileChooser getPNGChooser()