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;
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();
}
}
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;
}