From: gmungoc Date: Mon, 5 Oct 2015 14:23:31 +0000 (+0100) Subject: JAL-1812 set/return currentAlFrame for Groovy in headless mode X-Git-Tag: Release_2_10_0~369 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd2f8500d0130b3e695086259912bac873a3c9e8;p=jalview.git JAL-1812 set/return currentAlFrame for Groovy in headless mode --- 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)