+ 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()
+ + boarderBottomOffset, file, imageTitle,
+ alignFrame, pSessionId, headless);
+ if (av.getWrapAlignment())
+ {
+ if (im.getGraphics() != null)
+ {
+ printWrappedAlignment(aDimension.getWidth(),
+ aDimension.getHeight() + boarderBottomOffset, 0,
+ im.getGraphics());
+ im.writeImage();
+ }
+ }
+ else
+ {
+ if (im.getGraphics() != null)
+ {
+ printUnwrapped(aDimension.getWidth(), aDimension.getHeight(),
+ 0, im.getGraphics());
+ 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
+ {
+
+ }
+ }
+
+ public AlignmentDimension getAlignmentDimension()
+ {