+ try
+ {
+ AlignmentDimension aDimension = getAlignmentDimension();
+ try
+ {
+ jalview.util.ImageMaker im;
+ final String imageAction, imageTitle;
+ if (type == jalview.util.ImageMaker.TYPE.PNG)
+ {
+ imageAction = "Create PNG image from alignment";
+ imageTitle = null;
+ }
+ else if (type == jalview.util.ImageMaker.TYPE.EPS)
+ {
+ imageAction = "Create EPS file from alignment";
+ imageTitle = alignFrame.getTitle();
+ }
+ else
+ {
+ imageAction = "Create SVG file from alignment";
+ imageTitle = alignFrame.getTitle();
+ }
+
+ im = new jalview.util.ImageMaker(this, type, imageAction,
+ aDimension.getWidth(), aDimension.getHeight(), file,
+ imageTitle);
+ if (av.getWrapAlignment())
+ {
+ if (im.getGraphics() != null)
+ {
+ printWrappedAlignment(im.getGraphics(), aDimension.getWidth(),
+ aDimension.getHeight(), 0);
+ im.writeImage();
+ }
+ }
+ else
+ {
+ if (im.getGraphics() != null)
+ {
+ printUnwrapped(im.getGraphics(), aDimension.getWidth(),
+ aDimension.getHeight(), 0);
+ im.writeImage();
+ }
+ }
+ } catch (OutOfMemoryError err)
+ {
+ // Be noisy here.
+ System.out.println("########################\n" + "OUT OF MEMORY "
+ + file + "\n" + "########################");
+ new OOMWarning("Creating Image for " + file, err);
+ // System.out.println("Create IMAGE: " + err);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ } finally
+ {
+ if (alignFrame != null && !headless)
+ {
+ alignFrame.setProgressBar(MessageManager.getString("status.export_complete"), progress);
+ }