From cd2f8500d0130b3e695086259912bac873a3c9e8 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 5 Oct 2015 15:23:31 +0100 Subject: [PATCH] JAL-1812 set/return currentAlFrame for Groovy in headless mode --- src/jalview/bin/Jalview.java | 2 +- src/jalview/gui/Desktop.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index dfd0924..462f5a7 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -387,7 +387,7 @@ public class Jalview } else { - + Desktop.setCurrentAlignFrame(af); data = aparser.getValue("colour", true); if (data != null) { diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index c957444..d3b8afc 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -23,6 +23,7 @@ package jalview.gui; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; import jalview.bin.Cache; +import jalview.bin.Jalview; import jalview.io.FileLoader; import jalview.io.FormatAdapter; import jalview.io.IdentifyFile; @@ -2381,6 +2382,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements */ public static AlignFrame[] getAlignFrames() { + if (Jalview.isHeadlessMode()) + { + // Desktop.desktop is null in headless mode + return new AlignFrame[] { currentAlignFrame }; + } + JInternalFrame[] frames = Desktop.desktop.getAllFrames(); if (frames == null) -- 1.7.10.2