From: Jim Procter Date: Thu, 13 Jun 2013 15:53:33 +0000 (+0100) Subject: fix for JAL-1315 X-Git-Tag: Jalview_2_9~243^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b29af5fd04101b37e81fa247be34dcbbaec2b9eb;p=jalview.git fix for JAL-1315 --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 5f20808..4a679b6 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1094,7 +1094,9 @@ public class AlignmentPanel extends GAlignmentPanel implements void makeAlignmentImage(int type, File file) { long progress = System.currentTimeMillis(); - if (alignFrame != null) + boolean headless = (System.getProperty("java.awt.headless") != null + && System.getProperty("java.awt.headless").equals("true")); + if (alignFrame != null && !headless) { alignFrame.setProgressBar("Saving " + (type == jalview.util.ImageMaker.PNG ? "PNG image" @@ -1115,8 +1117,7 @@ public class AlignmentPanel extends GAlignmentPanel implements if (av.getWrapAlignment()) { height = getWrappedHeight(); - if (System.getProperty("java.awt.headless") != null - && System.getProperty("java.awt.headless").equals("true")) + if (headless) { // need to obtain default alignment width and then add in any // additional allowance for id margin @@ -1184,7 +1185,7 @@ public class AlignmentPanel extends GAlignmentPanel implements } } finally { - if (alignFrame != null) + if (alignFrame != null && !headless) { alignFrame.setProgressBar("Export complete.", progress); }