X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FImageMaker.java;h=9323d0dbc266bd73a5a1725c18ca1f950a89ae9f;hb=bc39ee8df9694f820a8a8bd2430f527b87c07f31;hp=02427f2cb4a08f783d54b4e18ef6cb9e97784a74;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index 02427f2..9323d0d 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -1,6 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ package jalview.util; -import java.awt.event.ActionEvent; import java.awt.RenderingHints; import javax.imageio.ImageIO; import org.jibble.epsgraphics.EpsGraphics2D; @@ -49,19 +66,22 @@ public class ImageMaker } } - try + if(file!=null) { - out = new FileOutputStream(file); + try + { + out = new FileOutputStream(file); - if (type == EPS) - setupEPS(width, height, EPStitle); - else - setupPNG(width, height); - } - catch (Exception ex) - { - System.out.println("Error creating " + (type == EPS ? "EPS" : "PNG") + - " file."); + if (type == EPS) + setupEPS(width, height, EPStitle); + else + setupPNG(width, height); + } + catch (Exception ex) + { + System.out.println("Error creating " + (type == EPS ? "EPS" : "PNG") + + " file."); + } } }