Merge branch 'develop' into features/JAL-4134_use_annotation_row_for_colours_and_groups
authorJames Procter <j.procter@dundee.ac.uk>
Mon, 29 May 2023 13:56:22 +0000 (14:56 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Mon, 29 May 2023 13:56:22 +0000 (14:56 +0100)
src/jalview/bin/Jalview.java
src/jalview/bin/argparser/Arg.java
src/jalview/bin/argparser/ArgParser.java
src/jalview/bin/argparser/BootstrapArgs.java
src/jalview/gui/Desktop.java
src/jalview/gui/QuitHandler.java
test/jalview/bin/CommandsTest.java
test/jalview/bin/CommandsTest2.java

index 615e318..7535f60 100755 (executable)
@@ -53,6 +53,7 @@ import java.util.stream.Collectors;
 
 import javax.swing.JDialog;
 import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
 import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
@@ -78,6 +79,7 @@ import jalview.gui.Desktop;
 import jalview.gui.PromptUserConfig;
 import jalview.gui.QuitHandler;
 import jalview.gui.QuitHandler.QResponse;
+import jalview.gui.StructureViewerBase;
 import jalview.io.AppletFormatAdapter;
 import jalview.io.BioJsHTMLOutput;
 import jalview.io.DataSourceType;
@@ -444,11 +446,29 @@ public class Jalview
       public void run()
       {
         Console.debug("Running shutdown hook");
+        QuitHandler.startForceQuit();
+        boolean closeExternal = Cache
+                .getDefault("DEFAULT_CLOSE_EXTERNAL_VIEWERS", false)
+                || Cache.getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false);
+        StructureViewerBase.setQuitClose(closeExternal);
+        if (desktop != null)
+        {
+          for (JInternalFrame frame : Desktop.desktop.getAllFrames())
+          {
+            if (frame instanceof StructureViewerBase)
+            {
+              ((StructureViewerBase) frame).closeViewer(closeExternal);
+            }
+          }
+        }
+
         if (QuitHandler.gotQuitResponse() == QResponse.CANCEL_QUIT)
         {
           // Got to here by a SIGTERM signal.
           // Note we will not actually cancel the quit from here -- it's too
-          // late -- but we can wait for saving files.
+          // late -- but we can wait for saving files and close external viewers
+          // if configured.
+          // Close viewers/Leave viewers open
           Console.debug("Checking for saving files");
           QuitHandler.getQuitResponse(false);
         }
@@ -515,17 +535,17 @@ public class Jalview
         Jalview.exit(null, 0);
       }
 
-      if (bootstrapArgs.contains(Arg.HEADLESS))
+      // new CLI
+      headlessArg = isHeadless(bootstrapArgs);
+      if (headlessArg)
       {
         System.setProperty("java.awt.headless", "true");
-        // new
-        headlessArg = bootstrapArgs.getBoolean(Arg.HEADLESS);
       }
+      // old CLI
       if (aparser.contains("nodisplay") || aparser.contains("nogui")
               || aparser.contains("headless"))
       {
         System.setProperty("java.awt.headless", "true");
-        // old
         headless = true;
       }
       // anything else!
@@ -1866,4 +1886,26 @@ public class Jalview
     System.out.println("[TESTOUTPUT] arg "
             + (yes ? a.argString() : a.negateArgString()) + " was set");
   }
+
+  private static boolean isHeadless(BootstrapArgs bootstrapArgs)
+  {
+    if (bootstrapArgs == null)
+    {
+      return false;
+    }
+    boolean isHeadless = false;
+    if (bootstrapArgs.contains(Arg.GUI))
+    {
+      isHeadless = !bootstrapArgs.getBoolean(Arg.GUI);
+    }
+    else if (bootstrapArgs.contains(Arg.HEADLESS))
+    {
+      isHeadless = bootstrapArgs.getBoolean(Arg.HEADLESS);
+    }
+    else if (bootstrapArgs.argsHaveOption(Opt.OUTPUTFILE))
+    {
+      isHeadless = true;
+    }
+    return isHeadless;
+  }
 }
index 8bac623..c502eec 100644 (file)
@@ -28,7 +28,11 @@ public enum Arg
                   + ChannelProperties.getProperty("app_name"),
           Opt.UNARY, Opt.BOOTSTRAP),
   HEADLESS(Type.CONFIG,
-          "Run Jalview in headless mode. No GUI interface will be created and Jalview will quit after all arguments have been processed.",
+          "Run Jalview in headless mode. No GUI interface will be created and Jalview will quit after all arguments have been processed. "
+                  + "Headless mode is assumed if an output file is to be generated, this can be overridden with --noheadless or --gui.",
+          Opt.BOOLEAN, Opt.BOOTSTRAP),
+  GUI(Type.CONFIG,
+          "Do not run Jalview in headless mode.  This overrides the assumption of headless mode when an output file is to be generated.",
           Opt.UNARY, Opt.BOOTSTRAP),
   JABAWS(Type.CONFIG, "Set a different URL to connect to a JABAWS server.",
           Opt.STRING, Opt.BOOTSTRAP),
@@ -140,7 +144,7 @@ public enum Arg
           "Output an image of the open alignment window. Format is specified by the subval modifier, a following --type argument or guessed from the file extension. Valid formats/extensions are:\n"
                   + "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
           Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
-          Opt.REQUIREINPUT, Opt.OUTPUT, Opt.PRIMARY),
+          Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.PRIMARY),
   TYPE(Type.IMAGE,
           "Set the image format for the preceding --image. Valid values are:\n"
                   + "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
@@ -160,7 +164,7 @@ public enum Arg
           Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
   STRUCTUREIMAGE(Type.STRUCTUREIMAGE,
           "Export an image of a 3D structure opened in JMOL", Opt.STRING,
-          Opt.LINKED, Opt.MULTI),
+          Opt.LINKED, Opt.MULTI, Opt.OUTPUTFILE),
   STRUCTUREIMAGETYPE(Type.STRUCTUREIMAGE,
           "Set the structure image format for the preceding --structureimage. Valid values are:\n"
                   + "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
@@ -188,7 +192,7 @@ public enum Arg
                   + "clustal (aln),\n" + "phylip (phy),\n"
                   + "jalview (jvp, jar).",
           Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
-          Opt.REQUIREINPUT, Opt.OUTPUT, Opt.PRIMARY),
+          Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.PRIMARY),
   FORMAT(Type.OUTPUT,
           "Sets the format for the preceding --output file. Valid formats are:\n"
                   + "fasta,\n" + "pfam,\n" + "stockholm,\n" + "pir,\n"
@@ -325,8 +329,9 @@ public enum Arg
     INPUT, // This Arg counts as an input for REQUIREINPUT
     REQUIREINPUT, // This Arg can only be applied via --all if there is an
                   // input (i.e. --open or --append)
-    OUTPUT, // This Arg provides an output filename. With Opt.ALLOWALL *.ext is
-            // shorthand for --all --output={basename}.ext
+    OUTPUTFILE, // This Arg provides an output filename. With Opt.ALLOWALL *.ext
+                // is
+    // shorthand for --all --output={basename}.ext
     STORED, // This Arg resets and creates a new set of "opened" linkedIds
     HELP, // This Arg is a --help type arg
     PRIMARY, // This Arg is the main Arg for its type
@@ -489,6 +494,11 @@ public enum Arg
     return true;
   }
 
+  protected Opt[] getOptions()
+  {
+    return argOptions;
+  }
+
   protected void setOptions(Opt... options)
   {
     this.argOptions = options;
index 0a8b8d3..f08e678 100644 (file)
@@ -453,7 +453,7 @@ public class ArgParser
         {
           if (linkedId == null)
           {
-            if (a.hasOption(Opt.OUTPUT) && a.hasOption(Opt.ALLOWALL)
+            if (a.hasOption(Opt.OUTPUTFILE) && a.hasOption(Opt.ALLOWALL)
                     && val.startsWith(MATCHALLLINKEDIDS))
             {
               // --output=*.ext is shorthand for --all --output {basename}.ext
@@ -464,7 +464,7 @@ public class ArgParser
               val = LINKEDIDDIRNAME + File.separator + LINKEDIDBASENAME
                       + val.substring(MATCHALLLINKEDIDS.length());
             }
-            else if (a.hasOption(Opt.OUTPUT) && a.hasOption(Opt.ALLOWALL)
+            else if (a.hasOption(Opt.OUTPUTFILE) && a.hasOption(Opt.ALLOWALL)
                     && val.startsWith(MATCHOPENEDLINKEDIDS))
             {
               // --output=open*.ext is shorthand for --opened --output
index faa4a43..a6bad24 100644 (file)
@@ -23,6 +23,8 @@ public class BootstrapArgs
 
   private Set<File> argFiles = new HashSet<>();
 
+  private Set<Opt> argsOptions = new HashSet<>();
+
   public static BootstrapArgs getBootstrapArgs(String[] args)
   {
     List<String> argList = new ArrayList<>(Arrays.asList(args));
@@ -111,6 +113,17 @@ public class BootstrapArgs
 
         Arg a = ArgParser.argMap.get(argName);
 
+        if (a != null)
+        {
+          for (Opt opt : a.getOptions())
+          {
+            if (!argsOptions.contains(opt))
+            {
+              argsOptions.add(opt);
+            }
+          }
+        }
+
         if (a == null || !a.hasOption(Opt.BOOTSTRAP))
         {
           // not a valid bootstrap arg
@@ -284,8 +297,17 @@ public class BootstrapArgs
       return false;
     }
     if (bootstrapArgMap.containsKey(a))
+    {
       return Boolean.parseBoolean(get(a));
+    }
     else
+    {
       return a.getDefaultBoolValue();
+    }
+  }
+
+  public boolean argsHaveOption(Opt opt)
+  {
+    return argsOptions.contains(opt);
   }
 }
index 8eebfc1..6f2faae 100644 (file)
@@ -1610,7 +1610,7 @@ public class Desktop extends jalview.jbgui.GDesktop
       }
     }
     Jalview.setCurrentAlignFrame(null);
-    System.out.println("ALL CLOSED");
+    jalview.bin.Console.info("ALL CLOSED");
 
     /*
      * reset state of singleton objects as appropriate (clear down session state
index 5d628ff..ad7684e 100644 (file)
@@ -2,6 +2,7 @@ package jalview.gui;
 
 import java.io.File;
 import java.util.List;
+import java.util.Locale;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -16,6 +17,7 @@ import javax.swing.JOptionPane;
 import javax.swing.JTextPane;
 
 import com.formdev.flatlaf.extras.FlatDesktop;
+import com.formdev.flatlaf.extras.FlatDesktop.QuitResponse;
 
 import jalview.api.AlignmentViewPanel;
 import jalview.bin.Cache;
@@ -35,6 +37,8 @@ public class QuitHandler
 
   private static boolean interactive = true;
 
+  private static QuitResponse flatlafResponse = null;
+
   public static enum QResponse
   {
     NULL, QUIT, CANCEL_QUIT, FORCE_QUIT
@@ -54,26 +58,17 @@ public class QuitHandler
 
   private static ExecutorService executor = Executors.newFixedThreadPool(3);
 
-  public static QResponse setQuitHandler()
+  public static void setQuitHandler()
   {
     FlatDesktop.setQuitHandler(response -> {
-      Runnable performQuit = () -> {
-        response.performQuit();
-        setResponse(QResponse.QUIT);
-      };
-      Runnable performForceQuit = () -> {
-        response.performQuit();
-        setResponse(QResponse.FORCE_QUIT);
-      };
-      Runnable cancelQuit = () -> {
-        response.cancelQuit();
-        // reset
-        setResponse(QResponse.NULL);
-      };
-      getQuitResponse(true, performQuit, performForceQuit, cancelQuit);
+      flatlafResponse = response;
+      Desktop.instance.desktopQuit();
     });
+  }
 
-    return gotQuitResponse();
+  public static void startForceQuit()
+  {
+    setResponse(QResponse.FORCE_QUIT);
   }
 
   private static QResponse gotQuitResponse = QResponse.NULL;
@@ -81,6 +76,11 @@ public class QuitHandler
   protected static QResponse setResponse(QResponse qresponse)
   {
     gotQuitResponse = qresponse;
+    if ((qresponse == QResponse.CANCEL_QUIT || qresponse == QResponse.NULL)
+            && flatlafResponse != null)
+    {
+      flatlafResponse.cancelQuit();
+    }
     return qresponse;
   }
 
@@ -162,8 +162,7 @@ public class QuitHandler
       qd.showDialogOnTopAsync(
               new StringBuilder(
                       MessageManager.getString("label.quit_jalview"))
-                              .append("\n").append(messageString)
-                              .toString(),
+                      .append("\n").append(messageString).toString(),
               MessageManager.getString("action.quit"),
               JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
               new Object[]
@@ -180,6 +179,8 @@ public class QuitHandler
       int count = Desktop.instance.structureViewersStillRunningCount();
       if (count > 0)
       {
+        String alwaysCloseExternalViewers = Cache
+                .getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", "ask");
         String prompt = MessageManager
                 .formatMessage(count == 1 ? "label.confirm_quit_viewer"
                         : "label.confirm_quit_viewers");
@@ -190,11 +191,22 @@ public class QuitHandler
         String[] buttonsText = { MessageManager.getString("action.yes"),
             MessageManager.getString("action.no"), cancelQuitText };
 
-        int confirmResponse = JvOptionPane.showOptionDialog(
-                Desktop.instance, prompt, title,
-                JvOptionPane.YES_NO_CANCEL_OPTION,
-                JvOptionPane.WARNING_MESSAGE, null, buttonsText,
-                cancelQuit);
+        int confirmResponse = -1;
+        if (alwaysCloseExternalViewers == null || "ask".equals(
+                alwaysCloseExternalViewers.toLowerCase(Locale.ROOT)))
+        {
+          confirmResponse = JvOptionPane.showOptionDialog(Desktop.instance,
+                  prompt, title, JvOptionPane.YES_NO_CANCEL_OPTION,
+                  JvOptionPane.WARNING_MESSAGE, null, buttonsText,
+                  cancelQuit);
+        }
+        else
+        {
+          confirmResponse = Cache
+                  .getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false)
+                          ? JvOptionPane.YES_OPTION
+                          : JvOptionPane.NO_OPTION;
+        }
 
         if (confirmResponse == JvOptionPane.CANCEL_OPTION)
         {
index 7ed1ea3..b4c927b 100644 (file)
@@ -70,7 +70,7 @@ public class CommandsTest
   public void commandsOpenTest(String cmdLine, boolean cmdArgs,
           int numFrames, String[] sequences)
   {
-    String[] args = cmdLine.split("\\s+");
+    String[] args = (cmdLine + " --gui").split("\\s+");
     Jalview.main(args);
     Commands cmds = Jalview.getInstance().getCommands();
     Assert.assertNotNull(cmds);
@@ -110,7 +110,7 @@ public class CommandsTest
           throws IOException
   {
     cleanupFiles(filenames);
-    String[] args = cmdLine.split("\\s+");
+    String[] args = (cmdLine + " --gui").split("\\s+");
     Jalview.main(args);
     Commands cmds = Jalview.getInstance().getCommands();
     Assert.assertNotNull(cmds);
@@ -138,7 +138,7 @@ public class CommandsTest
           String[] filenames) throws IOException
   {
     cleanupFiles(filenames);
-    String[] args = cmdLine.split("\\s+");
+    String[] args = (cmdLine + " --gui").split("\\s+");
     Jalview.main(args);
     Commands cmds = Jalview.getInstance().getCommands();
     Assert.assertNotNull(cmds);
@@ -166,7 +166,7 @@ public class CommandsTest
   {
     return new Object[][] {
         //
-        { "--nonews --nosplash --open=./examples/test_fab41.result/sample.a2m "
+        { "--gui --nonews --nosplash --open=./examples/test_fab41.result/sample.a2m "
                 + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
                 + "--structureimage=" + testfiles + "/structureimage1.png "
                 + "--open=./examples/test_fab41.result/sample.a2m "
@@ -208,18 +208,18 @@ public class CommandsTest
   {
     return new Object[][] {
         //
-        { "--argfile=" + testfiles + "/**/*.txt", new String[]
+        { "--gui --argfile=" + testfiles + "/**/*.txt", new String[]
         { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png",
             testfiles + "/dir3/subdir/test0.png" } },
-        { "--argfile=" + testfiles + "/**/argfile.txt", new String[]
+        { "--gui --argfile=" + testfiles + "/**/argfile.txt", new String[]
         { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png" } },
-        { "--argfile=" + testfiles + "/dir*/argfile.txt", new String[]
+        { "--gui --argfile=" + testfiles + "/dir*/argfile.txt", new String[]
         { testfiles + "/dir1/test1.png", testfiles + "/dir2/test1.png" } },
-        { "--initsubstitutions --append examples/uniref50.fa --image "
+        { "--gui --initsubstitutions --append examples/uniref50.fa --image "
                 + testfiles + "/{basename}.png",
             new String[]
             { testfiles + "/uniref50.png" } },
-        { "--append examples/uniref50.fa --nosubstitutions --image "
+        { "--gui --append examples/uniref50.fa --nosubstitutions --image "
                 + testfiles + "/{basename}.png",
             new String[]
             { testfiles + "/{basename}.png" } }
@@ -252,11 +252,11 @@ public class CommandsTest
         { "examples/uniref50.fa " + testfiles + "/test1.fa", true, 2,
             ArrayUtils.concatArrays(someUniref50Seqs, t1) },
         { "examples/uniref50.fa " + testfiles + "/test1.fa", true, 2, t1 },
-        { "--argfile=" + testfiles + "/argfile0.txt", true, 1,
+        { "--gui --argfile=" + testfiles + "/argfile0.txt", true, 1,
             ArrayUtils.concatArrays(t1, t3) },
-        { "--argfile=" + testfiles + "/argfile*.txt", true, 5,
+        { "--gui --argfile=" + testfiles + "/argfile*.txt", true, 5,
             ArrayUtils.concatArrays(t1, t2, t3) },
-        { "--argfile=" + testfiles + "/argfile.autocounter", true, 3,
+        { "--gui --argfile=" + testfiles + "/argfile.autocounter", true, 3,
             ArrayUtils.concatArrays(t1, t2) } };
 
   }
@@ -296,7 +296,7 @@ public class CommandsTest
   public void allLinkedIdsTest(String cmdLine, String[] filenames,
           String[] nonfilenames)
   {
-    String[] args = cmdLine.split("\\s+");
+    String[] args = (cmdLine + " --gui").split("\\s+");
     Jalview.main(args);
     Commands cmds = Jalview.getInstance().getCommands();
     Assert.assertNotNull(cmds);
@@ -324,19 +324,19 @@ public class CommandsTest
         //
         /*
          */
-        { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --output={dirname}/{basename}.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --output={dirname}/{basename}.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/test1.stk",
                 "test/jalview/bin/argparser/testfiles/test2.stk",
                 "test/jalview/bin/argparser/testfiles/test3.stk", },
             null },
-        { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/test1.png",
                 "test/jalview/bin/argparser/testfiles/test2.png",
                 "test/jalview/bin/argparser/testfiles/test3.png", },
             null },
-        { "--open=test/jalview/bin/argparser/testfiles/*.fa --all --output={dirname}/{basename}.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/*.fa --all --output={dirname}/{basename}.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/test1.stk",
                 "test/jalview/bin/argparser/testfiles/test2.stk",
@@ -351,7 +351,7 @@ public class CommandsTest
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, },
-        { "--open=test/jalview/bin/argparser/**/*.fa --all --output={dirname}/{basename}.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/**/*.fa --all --output={dirname}/{basename}.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/test1.stk",
                 "test/jalview/bin/argparser/testfiles/test2.stk",
@@ -366,7 +366,7 @@ public class CommandsTest
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", },
             null },
-        { "--open=test/jalview/bin/argparser/**/*.fa --output=*.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/**/*.fa --output=*.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/test1.stk",
                 "test/jalview/bin/argparser/testfiles/test2.stk",
@@ -381,7 +381,7 @@ public class CommandsTest
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", },
             null },
-        { "--open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=*.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=*.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/dir1/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir1/test2.stk",
@@ -396,7 +396,7 @@ public class CommandsTest
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, },
-        { "--open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=open*.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=open*.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/dir2/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir2/test2.stk",
@@ -411,7 +411,7 @@ public class CommandsTest
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, },
-        { "--open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --opened --output={dirname}/{basename}.stk --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --opened --output={dirname}/{basename}.stk --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/dir2/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir2/test2.stk",
@@ -426,7 +426,7 @@ public class CommandsTest
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test2.stk",
                 "test/jalview/bin/argparser/testfiles/dir3/subdir/test3.stk", }, },
-        { "--open=test/jalview/bin/argparser/testfiles/dir1/*.fa --output open*.stk --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=open*.aln --close",
+        { "--gui --open=test/jalview/bin/argparser/testfiles/dir1/*.fa --output open*.stk --open=test/jalview/bin/argparser/testfiles/dir2/*.fa --output=open*.aln --close",
             new String[]
             { "test/jalview/bin/argparser/testfiles/dir1/test1.stk",
                 "test/jalview/bin/argparser/testfiles/dir1/test2.stk",
index a31b77d..0a47700 100644 (file)
@@ -137,58 +137,64 @@ public class CommandsTest2
         //
         /*
          */
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
                 + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 7, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
                 + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--props=test/jalview/bin/commandsTest2.jvprops2 ",
             15, 4, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
                 + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--noshowssannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 4, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
                 + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--noshowannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 3, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
                 + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--noshowannotations " + "--noshowssannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 0, 1 },
-        { "--nonews --nosplash --debug " + "--append=examples/uniref50.fa "
+        { "--gui --nonews --nosplash --debug "
+                + "--append=examples/uniref50.fa "
                 + "--colour=gecos-flower "
                 + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
                 + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
                 + "--noshowannotations " + "--noshowssannotations "
                 + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
             15, 0, 1 },
-        { "--nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile1 ",
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile1 ",
             16, 19, 3 },
-        { "--nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile2 ",
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile2 ",
             16, 0, 2 },
-        { "--nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
                 + "--allstructures "
                 + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
                 + "--structureviewer=none "
                 + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_2_model_4.pdb "
                 + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_3_model_2.pdb",
             16, 10, 0 },
-        { "--nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
+        { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
                 + "--allstructures "
                 + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
                 + "--noallstructures " + "--structureviewer=none "