From 30f9985fc227b918dc464df28f9fc7ad4b3aa16c Mon Sep 17 00:00:00 2001 From: Charles Ofoegbu Date: Wed, 12 Nov 2014 20:07:58 +0000 Subject: [PATCH] house-keeping --- src/jalview/util/ImageMaker.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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; } -- 1.7.10.2