From: Charles Ofoegbu Date: Wed, 12 Nov 2014 20:07:58 +0000 (+0000) Subject: house-keeping X-Git-Tag: Jalview_2_9~146^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=30f9985fc227b918dc464df28f9fc7ad4b3aa16c;p=jalview.git house-keeping --- diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index 1953a60..61ef34f 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -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; }