+ Integer idwidth = null;
+ if (onscreen
+ || (idwidth = Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH")) == null)
+ {
+ return (getIdPanel().getWidth() > 0 ? getIdPanel().getWidth()
+ : calculateIdWidth().width + 4);
+ }
+ return idwidth.intValue() + 4;
+ }
+
+ void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file)
+ {
+ long pSessionId = System.currentTimeMillis();
+ headless = (System.getProperty("java.awt.headless") != null && System
+ .getProperty("java.awt.headless").equals("true"));
+ if (alignFrame != null && !headless)
+ {
+ if (file != null)
+ {
+ alignFrame.setProgressBar(MessageManager.formatMessage(
+ "status.saving_file", new Object[] { type.getLabel() }),
+ pSessionId);
+ }
+ }
+ 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, alignFrame, pSessionId, headless);
+ 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
+ {
+