From b29af5fd04101b37e81fa247be34dcbbaec2b9eb Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 13 Jun 2013 16:53:33 +0100 Subject: [PATCH] fix for JAL-1315 --- src/jalview/gui/AlignmentPanel.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); } -- 1.7.10.2