From b8a88837ea01a9c6cfdde8bfa160d646eae5dbfe Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 23 May 2013 11:57:02 +0100 Subject: [PATCH] JAL-381 Desktop.addInternalFrame cannot be called in headless mode --- src/jalview/io/FileLoader.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 975a1a3..6f07b69 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -322,9 +322,14 @@ public class FileLoader implements Runnable if (!protocol.equals(AppletFormatAdapter.PASTE)) alignFrame.setFileName(file, format); - - Desktop.addInternalFrame(alignFrame, title, - AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); + if (raiseGUI) + { + // add the window to the GUI + // note - this actually should happen regardless of raiseGUI status in Jalview 3 + // TODO: define 'virtual desktop' for benefit of headless scripts that perform queries to find the 'current working alignment' + Desktop.addInternalFrame(alignFrame, title, + AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); + } try { -- 1.7.10.2