JAL-629 --close individually for each AlignFrame opened now allows batch processing...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 8 Mar 2023 15:56:02 +0000 (15:56 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 8 Mar 2023 15:56:02 +0000 (15:56 +0000)
src/jalview/bin/ArgParser.java
src/jalview/bin/Commands.java

index ae87001..65d0026 100644 (file)
@@ -68,7 +68,8 @@ public class ArgParser
     USAGESTATS, OPEN, OPEN2, PROPS, QUESTIONNAIRE, SETPROP, TREE, VDOC,
     VSESS, OUTPUT, OUTPUTTYPE, SSANNOTATION, NOTEMPFAC, TEMPFAC,
     TEMPFAC_LABEL, TEMPFAC_DESC, TEMPFAC_SHADING, TITLE, PAEMATRIX, WRAP,
-    NOSTRUCTURE, STRUCTURE, IMAGE, QUIT, DEBUG("d"), QUIET("q"), ARGFILE;
+    NOSTRUCTURE, STRUCTURE, IMAGE, QUIT, CLOSE, DEBUG("d"), QUIET("q"),
+    ARGFILE;
 
     static
     {
@@ -120,6 +121,7 @@ public class ArgParser
       WRAP.setOptions(Opt.BOOLEAN, Opt.LINKED);
       IMAGE.setOptions(Opt.STRING, Opt.LINKED);
       QUIT.setOptions(Opt.UNARY);
+      CLOSE.setOptions(Opt.UNARY, Opt.LINKED);
       DEBUG.setOptions(Opt.BOOLEAN, Opt.BOOTSTRAP);
       QUIET.setOptions(Opt.UNARY, Opt.MULTI, Opt.BOOTSTRAP);
       ARGFILE.setOptions(Opt.STRING, Opt.MULTI, Opt.BOOTSTRAP);
index b42f08e..001e32e 100644 (file)
@@ -77,6 +77,7 @@ public class Commands
     {
       for (String id : argParser.linkedIds())
       {
+        ArgValuesMap avm = argParser.linkedArgs(id);
         Commands cmds = new Commands();
         if (id == null)
         {
@@ -90,6 +91,17 @@ public class Commands
         }
         cmds.processImages(id);
         argsWereParsed &= cmds.wereParsed();
+
+        // close ap
+        if (avm.getBoolean(Arg.CLOSE))
+        {
+          AlignFrame af = cmds.afMap.get(id);
+          if (af != null)
+          {
+            af.closeMenuItem_actionPerformed(true);
+          }
+        }
+
       }
 
     }