house-keeping
authorCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 12 Nov 2014 20:07:58 +0000 (20:07 +0000)
committerCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 12 Nov 2014 20:07:58 +0000 (20:07 +0000)
src/jalview/util/ImageMaker.java

index 1953a60..61ef34f 100755 (executable)
@@ -38,14 +38,6 @@ import org.jibble.epsgraphics.EpsGraphics2D;
 
 public class ImageMaker
 {
-  // public static final int EPS = 0;
-  //
-  // public static final int PNG = 1;
-  //
-  // public static final int SVG = 2;
-  //
-  // int type = -1;
-
   EpsGraphics2D pg;
 
   SVGGraphics2D g2;
@@ -103,20 +95,16 @@ public class ImageMaker
     if (file == null)
     {
       JalviewFileChooser chooser;
-      // chooser = type == EPS ? getEPSChooser() : getPNGChooser();
       chooser = type.getChooser();
-
       chooser.setFileView(new jalview.io.JalviewFileView());
       chooser.setDialogTitle(title);
       chooser.setToolTipText(MessageManager.getString("action.save"));
-
       int value = chooser.showSaveDialog(parent);
 
       if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
       {
         jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
                 .getSelectedFile().getParent());
-
         file = chooser.getSelectedFile();
       }
     }
@@ -165,12 +153,14 @@ public class ImageMaker
         pg.close();
         break;
       case SVG:
-        String svg = ((SVGGraphics2D) getGraphics()).getSVGDocument();
-        out.write(svg.getBytes());
+        String svgData = ((SVGGraphics2D) getGraphics()).getSVGDocument();
+        out.write(svgData.getBytes());
+        out.flush();
         out.close();
         break;
       case PNG:
         ImageIO.write(bi, "png", out);
+        out.flush();
         out.close();
         break;
       }