Merge branch 'develop' into features/JAL-4134_use_annotation_row_for_colours_and_groups
authorJames Procter <j.procter@dundee.ac.uk>
Fri, 26 May 2023 11:57:41 +0000 (12:57 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Fri, 26 May 2023 11:57:41 +0000 (12:57 +0100)
 Conflicts:
src/jalview/gui/AnnotationLabels.java

75 files changed:
build.gradle
getdown/lib/FJVL_VERSION
getdown/lib/JVL_VERSION
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/ant/pom.xml
getdown/src/getdown/core/pom.xml
getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/LaunchUtil.java
getdown/src/getdown/core/src/main/java/jalview/bin/HiDPISetting.java
getdown/src/getdown/core/src/main/java/jalview/bin/MemorySetting.java
getdown/src/getdown/core/src/main/java/jalview/bin/ScreenInfo.java
getdown/src/getdown/core/src/main/java/jalview/util/ChannelProperties.java
getdown/src/getdown/core/src/main/java/jalview/util/LaunchUtils.java
getdown/src/getdown/core/src/main/java/jalview/util/StringUtils.java
getdown/src/getdown/launcher/pom.xml
getdown/src/getdown/mvn_cmd
getdown/src/getdown/pom.xml
help/help/help.jhm
help/help/helpTOC.xml
help/help/html/features/clarguments-advanced.html
help/help/html/features/clarguments-argfiles.html
help/help/html/features/clarguments-basic.html
help/help/html/features/clarguments-intro.html [deleted file]
help/help/html/features/clarguments-old.html
help/help/html/features/clarguments-reference.html [new file with mode: 0644]
help/help/html/features/clarguments.html
j11lib/flatlaf-3.1.1.jar [moved from j8lib/flatlaf-3.0.jar with 54% similarity]
j11lib/flatlaf-extras-3.1.1.jar [moved from j8lib/flatlaf-extras-3.0.jar with 60% similarity]
j11lib/getdown-core.jar
j8lib/flatlaf-3.1.1.jar [new file with mode: 0644]
j8lib/flatlaf-extras-3.1.1.jar [new file with mode: 0644]
j8lib/getdown-core.jar
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/appletgui/AlignFrame.java
src/jalview/bin/Commands.java
src/jalview/bin/Jalview.java
src/jalview/bin/Launcher.java
src/jalview/bin/argparser/Arg.java
src/jalview/bin/argparser/ArgParser.java
src/jalview/bin/argparser/ArgValue.java
src/jalview/bin/argparser/ArgValuesMap.java
src/jalview/bin/argparser/SubVals.java
src/jalview/gui/AlignExportOptions.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AppJmol.java
src/jalview/gui/Desktop.java
src/jalview/gui/EditNameDialog.java
src/jalview/gui/FeatureEditor.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/ImageExporter.java
src/jalview/gui/JvOptionPane.java
src/jalview/gui/LineartOptions.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/QuitHandler.java
src/jalview/gui/StructureChooser.java
src/jalview/gui/StructureViewer.java
src/jalview/gui/TextColourChooser.java
src/jalview/gui/UserDefinedColours.java
src/jalview/io/HtmlSvgOutput.java
src/jalview/io/JalviewFileChooser.java
src/jalview/util/ImageMaker.java
src/jalview/util/dialogrunner/DialogRunnerI.java
src/jalview/util/imagemaker/BitmapImageSizing.java [new file with mode: 0644]
test/jalview/bin/CommandsTest.java
test/jalview/bin/CommandsTest2.java
test/jalview/bin/argparser/ArgParserTest.java
test/jalview/gui/QuitHandlerTest.java
utils/getdown/bin/jalview.ps1
utils/getdown/bin/jalview.sh
utils/install4j/install4j10_template.install4j

index ad7c94f..ca599a8 100644 (file)
@@ -2787,6 +2787,7 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) {
     'WRAPPER_LINK': getdownWrapperLink,
     'BASH_WRAPPER_SCRIPT': getdown_bash_wrapper_script,
     'POWERSHELL_WRAPPER_SCRIPT': getdown_powershell_wrapper_script,
+    'BATCH_WRAPPER_SCRIPT': getdown_batch_wrapper_script,
     'WRAPPER_SCRIPT_BIN_DIR': getdown_wrapper_script_dir,
     'INSTALLER_NAME': install4jInstallerName,
     'INSTALL4J_UTILS_DIR': install4j_utils_dir,
index 1a5992a..35bd812 100644 (file)
@@ -1 +1 @@
-1.8.3-1.2.13_FJVL
+1.8.3-1.2.14_FJVL
index 60daf6c..0a14c3b 100644 (file)
@@ -1 +1 @@
-1.8.3-1.2.13_JVL
+1.8.3-1.2.14_JVL
index 5c98d23..7c99c93 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index b022d9f..c6901ae 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index b9e3c6b..24e3eb2 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index ed0f34a..b0c54e2 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.2.13_FJVL</version>
+    <version>1.8.3-1.2.14_FJVL</version>
   </parent>
 
   <artifactId>getdown-ant</artifactId>
index a7dfa07..5dd429d 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.2.13_FJVL</version>
+    <version>1.8.3-1.2.14_FJVL</version>
   </parent>
 
   <artifactId>getdown-core</artifactId>
index 31a69c3..0781a11 100644 (file)
@@ -233,12 +233,47 @@ public class LaunchUtil
     public static final boolean isLinux () { return _isLinux; }
 
     /**
+     * Check if a symlink (or file) points to a JVM
+     */
+    private static boolean checkJVMSymlink(String testBin)
+    {
+      File testBinFile = new File(testBin);
+      if (!testBinFile.exists())
+      {
+        return false;
+      }
+      File targetFile = null;
+      try
+      {
+        targetFile = testBinFile.getCanonicalFile();
+      } catch (IOException e)
+      {
+        return false;
+      }
+      if (targetFile != null && ("java".equals(targetFile.getName())
+            || "java.exe".equals(targetFile.getName())))
+      {
+        return true;
+      }
+      return false;
+    }
+
+    /**
      * Checks whether a Java Virtual Machine can be located in the supplied path.
      */
     protected static String checkJVMPath (String vmhome, boolean windebug)
     {
         String vmbase = vmhome + File.separator + "bin" + File.separator;
-        String vmpath = vmbase + "java";
+        String appName = System.getProperty("channel.app_name", "Jalview");
+        String vmpath = vmbase + appName;
+        if (checkJVMSymlink(vmpath)) {
+          return vmpath;
+        }
+        vmpath = vmbase + "Jalview";
+        if (checkJVMSymlink(vmpath)) {
+          return vmpath;
+        }
+        vmpath = vmbase + "java";
         if (new File(vmpath).exists()) {
             return vmpath;
         }
index 75106cc..2bce673 100644 (file)
@@ -1,8 +1,28 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.bin;
 
-import java.awt.HeadlessException;
 import java.util.Locale;
 
+import java.awt.HeadlessException;
 
 public class HiDPISetting
 {
@@ -36,6 +56,8 @@ public class HiDPISetting
 
   public static int scale = 0;
 
+  public final static int MAX_SCALE = 8;
+
   private static boolean doneInit = false;
 
   private static boolean allowScalePropertyArg = false;
@@ -68,8 +90,17 @@ public class HiDPISetting
 
     // get and use command line property values first
     String setHiDPIProperty = System.getProperty(setHiDPIPropertyName);
-    setHiDPI = setHiDPIProperty != null
-            && setHiDPIProperty.equalsIgnoreCase("true");
+    boolean setHiDPIPropertyBool = Boolean.parseBoolean(setHiDPIProperty);
+
+    // allow -DsetHiDPI=false to turn off HiDPI scaling
+    if (setHiDPIProperty != null && !setHiDPIPropertyBool)
+    {
+      clear();
+      doneInit = true;
+      return;
+    }
+
+    setHiDPI = setHiDPIProperty != null && setHiDPIPropertyBool;
 
     String setHiDPIScaleProperty = System
             .getProperty(setHiDPIScalePropertyName);
@@ -78,6 +109,12 @@ public class HiDPISetting
       try
       {
         setHiDPIScale = Integer.parseInt(setHiDPIScaleProperty);
+        // if setHiDPIScale property is validly set and setHiDPI property wasn't
+        // attempted to be set we assume setHiDPIScale to be true
+        if (setHiDPIProperty == null)
+        {
+          setHiDPI = true;
+        }
       } catch (NumberFormatException e)
       {
         System.err.println(setHiDPIScalePropertyName + " property give ("
@@ -151,6 +188,16 @@ public class HiDPISetting
 
     int dimensionScale = 1 + (mindimension / bigScreenThreshold);
 
+    // reject outrageous values -- dpiScale in particular could be mistaken
+    if (dpiScale > MAX_SCALE)
+    {
+      dpiScale = 1;
+    }
+    if (dimensionScale > MAX_SCALE)
+    {
+      dimensionScale = 1;
+    }
+
     // choose larger of dimensionScale or dpiScale (most likely dimensionScale
     // as dpiScale often misreported)
     int autoScale = Math.max(dpiScale, dimensionScale);
index f5f0196..bb545cb 100644 (file)
@@ -22,6 +22,8 @@
  */
 package jalview.bin;
 
+import java.util.Locale;
+
 /**
  * Methods to decide on appropriate memory setting for Jalview based on two
  * optionally provided values: jvmmempc - the maximum percentage of total
@@ -33,8 +35,6 @@ package jalview.bin;
  * @author bsoares
  *
  */
-import java.util.Locale;
-
 public class MemorySetting
 {
   public static final String MAX_HEAPSIZE_PERCENT_PROPERTY_NAME = "jvmmempc";
@@ -363,7 +363,7 @@ public class MemorySetting
 
   public static String memoryLongToString(long mem)
   {
-    return memoryLongToString(mem, "%.1f");
+    return memoryLongToString(mem, "%.3f");
   }
 
   public static String memoryLongToString(long mem, String format)
@@ -409,4 +409,4 @@ public class MemorySetting
     return ADJUSTMENT_MESSAGE;
   }
 
-}
\ No newline at end of file
+}
index 899bf94..18ef79e 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.bin;
 
 import java.awt.Toolkit;
index 40f6110..4832588 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.util;
 
 import java.awt.Image;
@@ -57,6 +77,7 @@ public class ChannelProperties
     defaultProps.put("default_appbase",
             "https://www.jalview.org/getdown/release/1.8");
     defaultProps.put("preferences.filename", ".jalview_properties");
+    defaultProps.put("channel", "none");
 
     // load channel_properties
     Properties tryChannelProps = new Properties();
index 3302dba..ee3b2c6 100644 (file)
@@ -1,9 +1,32 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.util;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Properties;
 
 public class LaunchUtils
@@ -53,4 +76,102 @@ public class LaunchUtils
   {
     return Boolean.parseBoolean(getUserPreference(key));
   }
+
+  public static int JAVA_COMPILE_VERSION = 0;
+
+  public static int getJavaCompileVersion()
+  {
+    if (JAVA_COMPILE_VERSION > 0)
+    {
+      return JAVA_COMPILE_VERSION;
+    }
+    String buildDetails = "jar:".concat(LaunchUtils.class
+            .getProtectionDomain().getCodeSource().getLocation().toString()
+            .concat("!" + "/.build_properties"));
+    try
+    {
+      URL localFileURL = new URL(buildDetails);
+      InputStream in = localFileURL.openStream();
+      Properties buildProperties = new Properties();
+      buildProperties.load(in);
+      in.close();
+      String JCV = buildProperties.getProperty("JAVA_COMPILE_VERSION",
+              null);
+      if (JCV == null)
+      {
+        System.out.println(
+                "Could not obtain JAVA_COMPILE_VERSION for comparison");
+        return -2;
+      }
+      JAVA_COMPILE_VERSION = Integer.parseInt(JCV);
+    } catch (MalformedURLException e)
+    {
+      System.err.println("Could not find " + buildDetails);
+      return -3;
+    } catch (IOException e)
+    {
+      System.err.println("Could not load " + buildDetails);
+      return -4;
+    } catch (NumberFormatException e)
+    {
+      System.err.println("Could not parse JAVA_COMPILE_VERSION");
+      return -5;
+    }
+
+    return JAVA_COMPILE_VERSION;
+  }
+
+  public static int JAVA_VERSION = 0;
+
+  public static int getJavaVersion()
+  {
+    if (JAVA_VERSION > 0)
+    {
+      return JAVA_VERSION;
+    }
+    try
+    {
+      String JV = System.getProperty("java.version");
+      if (JV == null)
+      {
+        System.out.println("Could not obtain java.version for comparison");
+        return -2;
+      }
+      if (JV.startsWith("1."))
+      {
+        JV = JV.substring(2);
+      }
+      JAVA_VERSION = JV.indexOf(".") == -1 ? Integer.parseInt(JV)
+              : Integer.parseInt(JV.substring(0, JV.indexOf(".")));
+    } catch (NumberFormatException e)
+    {
+      System.err.println("Could not parse java.version");
+      return -3;
+    }
+    return JAVA_VERSION;
+  }
+
+  public static boolean checkJavaVersion()
+  {
+    String buildDetails = "jar:".concat(LaunchUtils.class
+            .getProtectionDomain().getCodeSource().getLocation().toString()
+            .concat("!" + "/.build_properties"));
+
+    int java_compile_version = getJavaCompileVersion();
+    int java_version = getJavaVersion();
+
+    if (java_compile_version <= 0 || java_version <= 0)
+    {
+      System.out.println("Could not make Java version check");
+      return true;
+    }
+    // Warn if these java.version and JAVA_COMPILE_VERSION conditions exist
+    // Usually this means a Java 11 compiled JAR being run by a Java 11 JVM
+    if (java_version >= 11 && java_compile_version < 11)
+    {
+      return false;
+    }
+
+    return true;
+  }
 }
index afb9c89..1c67c92 100644 (file)
@@ -25,6 +25,7 @@ import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 public class StringUtils
@@ -412,7 +413,8 @@ public class StringUtils
     {
       return s.toUpperCase(Locale.ROOT);
     }
-    return s.substring(0, 1).toUpperCase(Locale.ROOT) + s.substring(1).toLowerCase(Locale.ROOT);
+    return s.substring(0, 1).toUpperCase(Locale.ROOT)
+            + s.substring(1).toLowerCase(Locale.ROOT);
   }
 
   /**
@@ -583,4 +585,54 @@ public class StringUtils
     }
     return min < text.length() + 1 ? min : -1;
   }
+
+  public static int indexOfFirstWhitespace(String text)
+  {
+    int index = -1;
+    Pattern pat = Pattern.compile("\\s");
+    Matcher m = pat.matcher(text);
+    if (m.find())
+    {
+      index = m.start();
+    }
+    return index;
+  }
+
+  /*
+   * implementation of String.replaceLast.
+   * Replaces only the last occurrence of toReplace in string with replacement.
+   */
+  public static String replaceLast(String string, String toReplace,
+          String replacement)
+  {
+    int pos = string.lastIndexOf(toReplace);
+    if (pos > -1)
+    {
+      return new StringBuilder().append(string.substring(0, pos))
+              .append(replacement)
+              .append(string.substring(pos + toReplace.length()))
+              .toString();
+    }
+    else
+    {
+      return string;
+    }
+
+  }
+
+  /* 
+   * return the maximum length of a List of Strings
+   */
+  public static int maxLength(List<String> l)
+  {
+    int max = 0;
+    for (String s : l)
+    {
+      if (s == null)
+        continue;
+      if (s.length() > max)
+        max = s.length();
+    }
+    return max;
+  }
 }
index 6cf40a8..ea3b6ef 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.2.13_FJVL</version>
+    <version>1.8.3-1.2.14_FJVL</version>
   </parent>
 
   <artifactId>getdown-launcher</artifactId>
index 36bc298..b30194f 100755 (executable)
@@ -3,7 +3,7 @@
 if [ x$JVLVERSION != x ]; then
   export VERSION=$JVLVERSION
 else
-  export VERSION=1.8.3-1.2.13_JVL
+  export VERSION=1.8.3-1.2.14_JVL
 fi
 
 if [ x${VERSION%_JVL} = x$VERSION ]; then
index dc12610..ef8c811 100644 (file)
@@ -10,7 +10,7 @@
   <groupId>com.threerings.getdown</groupId>
   <artifactId>getdown</artifactId>
   <packaging>pom</packaging>
-  <version>1.8.3-1.2.13_FJVL</version>
+  <version>1.8.3-1.2.14_FJVL</version>
 
   <name>getdown</name>
   <description>An application installer and updater.</description>
index 0c39a52..a2094f7 100755 (executable)
    <mapID target="commandline" url="html/features/commandline.html"/>
    <mapID target="jalviewcltool" url="html/features/commandline.html#script"/>
    <mapID target="clarguments" url="html/features/clarguments.html"/>
-   <mapID target="clarguments-intro" url="html/features/clarguments-intro.html"/>
    <mapID target="clarguments-basic" url="html/features/clarguments-basic.html"/>
    <mapID target="clarguments-advanced" url="html/features/clarguments-advanced.html"/>
    <mapID target="clarguments-argfiles" url="html/features/clarguments-argfiles.html"/>
+   <mapID target="clarguments-reference" url="html/features/clarguments-reference.html"/>
    <mapID target="clarguments-old" url="html/features/clarguments-old.html"/>
    <mapID target="jvlfiles" url="html/features/jvlfiles.html"/>
    <mapID target="io" url="html/io/index.html"/>
index f6bb7c7..d7ff3d4 100755 (executable)
                        <tocitem text="Groovy Features Counter example" target="groovy.featurescounter"/>
                </tocitem>
                <tocitem text="Command Line" target="commandline" expand="false">
-                       <tocitem text="Command Line: summary" target="clarguments" />
-                       <tocitem text="Command Line: introduction" target="clarguments-intro" />
+                       <tocitem text="Command Line: introduction and reference" target="clarguments" />
                        <tocitem text="Command Line: basic usage" target="clarguments-basic" />
                        <tocitem text="Command Line: advanced usage" target="clarguments-advanced" />
                        <tocitem text="Command Line: argument files" target="clarguments-argfiles" />
+                       <tocitem text="Command Line: reference" target="clarguments-reference" />
                        <tocitem text="Command Line: old command line arguments" target="clarguments-old" />
                </tocitem>
                <tocitem text="Memory Settings" target="memory" expand="false"/>
index db818d8..a235727 100644 (file)
   <h1>Command Line: advanced usage</h1>
 
   <p>
-  <a href="clarguments.html">Command Line: summary</a>
-  <br/>
-  <a href="clarguments-intro.html">Command Line: introduction</a>
+  <a href="clarguments.html">Command Line: introduction</a>
   <br/>
   <a href="clarguments-basic.html">Command Line: basic usage</a>
   <br/>
   Command Line: advanced usage
   <br/>
   <a href="clarguments-argfiles.html">Command Line: argument files</a>
+  <br/>
+  <a href="clarguments-reference.html">Command Line: reference</a>
   </p>
 
   <hr/>
   <hr/>
   Continue to <a href="clarguments-argfiles.html">Command Line: argument files</a>.
   <br/>
-  Return to <a href="clarguments.html">Command Line: summary</a>.
-
+  <a href="clarguments-reference.html">Command Line: reference</a>
 
 </body>
 </html>
index f4741ee..5c71d16 100644 (file)
   <h1>Command Line: argument files</h1>
 
   <p>
-  <a href="clarguments.html">Command Line: summary</a>
-  <br/>
-  <a href="clarguments-intro.html">Command Line: introduction</a>
+  <a href="clarguments.html">Command Line: introduction</a>
   <br/>
   <a href="clarguments-basic.html">Command Line: basic usage</a>
   <br/>
   <a href="clarguments-advanced.html">Command Line: advanced usage</a>
   <br/>
-  Command Line: argument files
+  <a href="clarguments-argfiles.html">Command Line: argument files</a>
+  <br/>
+  <a href="clarguments-reference.html">Command Line: reference</a>
   </p>
 
   <hr/>
@@ -58,7 +58,7 @@
   <br/>
   Because the argument file is read by the application and not read by the shell, you do not need to escape any values -- all spaces will be read as part of the value until the end of the line.
   <br/>
-  You can add comments to a line by starting the line with an octothorpe (hash, pound-sign '#').
+  You can add comments to a line by starting the line with an hash (octothorpe, pound-sign '#').
   <br/>
   e.g.
   <table border="1">
   </p>
 
   <p>
-  If a "loop" of argument files is detected then Jalview will refuse to play (which is a Good Thing).
+  If an argument file that has already been read is found in a firther argument file, then Jalview will exit with a warning.  This is to avoid loops of argument files.
   </p>
 
 
   <h2><a name="evenmoresubstitutions"></a>Even more substitutions</h2>
 
   <p>
-  When adding values that can use substitutions within argument files, there are two additional substitutions that are made:
+  When adding values that can use substitutions within argument files, there are two additional substitutions that can be made:
   <br/>
   <code>{argfilebasename}</code> - replaced with the base of the filename of the argument file (i.e. without directory path or file extension).
   <br/>
   </p>
 
   <p>
-  Another amusing substitution you can make in argument files is the <code>{n}</code> substitution, combined with an <code>-npp</code> increment at the start (or end) of the argument file, which gives the potential of having multiple argument files with the exact same content, or even re-using the same argument file multiple times. e.g.
+  Another substitution you can make in argument files is the <code>{n}</code> substitution.  Combined with an <code>-npp</code> increment at the start (or end) of the argument file gives the potential to reuse an argument files in the same command but referring to different files, e.g.
 
   <table border="1">
   <tr><td>File <code>alignment.argfile</code></td></tr>
   <pre>
   jalview --argfile alignment.argfile --argfile alignment.argfile --headless
   </pre>
-  would be processed like
+  would be processed the same as
   <pre>
   jalview --open=alignment-0.fa --wrap --output=alignment-0.stk --close --open=alignment-1.fa --wrap --output=alignment-1.stk --close --headless
   </pre>
 
 
   <hr/>
-  Return to <a href="clarguments.html">Command Line: summary</a>.
+  <a href="clarguments-reference.html">Command Line: reference</a>
 
 
 </body>
index edee480..626fb8c 100644 (file)
   <h1>Command Line: basic usage</h1>
 
   <p>
-  <a href="clarguments.html">Command Line: summary</a>
-  <br/>
-  <a href="clarguments-intro.html">Command Line: introduction</a>
+  <a href="clarguments.html">Command Line: introduction</a>
   <br/>
   Command Line: basic usage
   <br/>
   <a href="clarguments-advanced.html">Command Line: advanced usage</a>
   <br/>
   <a href="clarguments-argfiles.html">Command Line: argument files</a>
+  <br/>
+  <a href="clarguments-reference.html">Command Line: reference</a>
   </p>
 
   <hr/>
   <hr/>
   Continue to <a href="clarguments-advanced.html">Command Line: advanced usage</a>.
   <br/>
-  Return to <a href="clarguments.html">Command Line: summary</a>.
-
+  <a href="clarguments-reference.html">Command Line: reference</a>
 
 </body>
 </html>
diff --git a/help/help/html/features/clarguments-intro.html b/help/help/html/features/clarguments-intro.html
deleted file mode 100644 (file)
index 6fddf0c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<html>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *  
- * Jalview is distributed in the hope that it will be useful, but 
- * WITHOUT ANY WARRANTY; without even the implied warranty 
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
- * PURPOSE.  See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- -->
-<title>Command Line: introduction</title>
-<body>
-
-  <h1>Command Line: introduction</h1>
-
-  <p>
-  <a href="clarguments.html">Command Line: summary</a>
-  <br/>
-  Command Line: introduction
-  <br/>
-  <a href="clarguments-basic.html">Command Line: basic usage</a>
-  <br/>
-  <a href="clarguments-advanced.html">Command Line: advanced usage</a>
-  <br/>
-  <a href="clarguments-argfiles.html">Command Line: argument files</a>
-  </p>
-
-  <hr/>
-
-  <p>
-  From version 2.11.3.0 Jalview processes a new set of command line arguments
-  which allow more powerful and flexible combinations of arguments, though can
-  also be used for very simple use cases too.
-  </p>
-
-  <p>
-  These new arguments are all accessed with a <code>--doubledash</code> form of
-  command line argument (with the one exception where simply opening one or more
-  files can be performed without any arguments other than the filenames).
-  </p>
-
-  <p>
-  The old command line arguments can still be used (see
-  <a href="clarguments-old.html">the old page on command line arguments</a>) so
-  existing scripts utilising them should not break.
-  <br/>
-  <strong>These are now deprecated and will be removed</strong> in a future version of Jalview.
-  </p>
-
-  <p>
-  However, you cannot mix old and new style arguments, so if you use any
-  <code>-singledash</code> arguments (with the exception of <code>-help</code> or <code>-h</code>), they will all be interpreted as
-  old style arguments with the new <code>--doubledash</code>
-  arguments being ignored.  If you have a script
-  that uses the old arguments without any dashes, and uses the bare-word
-  <code>open</code> then these will also be interpreted as old style arguments.
-  </p>
-  <p>
-  <strong>Warning!</strong> If you use command line arguments without any dashes and
-  <em>don't</em> use the bare-word argument <code>open</code> then all
-  your arguments will be interpreted as alignment files to be opened by the
-  new command line argument process!
-  </p>
-
-  <p>
-  To launch Jalview from the command line, see
-  <a href="commandline.html">running Jalview from the command line</a>.
-  </p>
-
-  <hr/>
-  Continue to <a href="clarguments-basic.html">Command Line: basic usage</a>.
-  <br/>
-  Return to <a href="clarguments.html">Command Line: summary</a>.
-
-
-</body>
-</html>
index 3d90a9e..8346401 100644 (file)
  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  -->
-<title>Jalview Command Line Arguments (pre 2.11.3.0)</title>
+<title>Jalview Command Line Arguments (pre 2.11.3.0) - DEPRECATED</title>
 <body>
   <p>
-    <strong>The Jalview Executable's Command Line Arguments (pre 2.11.3.0)</strong>
+    <strong>The Jalview Executable's Command Line Arguments (pre 2.11.3.0) - DEPRECATED</strong>
   </p>
 
   <table border="1">
diff --git a/help/help/html/features/clarguments-reference.html b/help/help/html/features/clarguments-reference.html
new file mode 100644 (file)
index 0000000..6d65033
--- /dev/null
@@ -0,0 +1,803 @@
+<html>
+<!--
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<title>Command Line: reference</title>
+<body>
+
+  <h1>Command Line: reference</h1>
+
+  <p>
+  <a href="clarguments.html">Command Line: introduction</a>
+  <br/>
+  <a href="clarguments-basic.html">Command Line: basic usage</a>
+  <br/>
+  <a href="clarguments-advanced.html">Command Line: advanced usage</a>
+  <br/>
+  <a href="clarguments-argfiles.html">Command Line: argument files</a>
+  <br/>
+  Command Line: reference
+  </p>
+
+  <hr/>
+
+  <ul>
+  <li><a href="#initialisingarguments">Initialising arguments</a></li>
+  <li><a href="#openinganalignment">Opening an alignment</a></li>
+  <li><a href="#adding3dstructure">Adding 3D structure</a></li>
+  <li><a href="#processingalignments">Processing alignments</a></li>
+  <li><a href="#outputtingalignmentfiles">Outputting alignment files</a></li>
+  <li><a href="#exportingimagefiles">Exporting image files</a></li>
+  <li><a href="#exporting3dstructureimagefiles">Exporting 3D structure image files</a></li>
+  <li><a href="#controllingflowofarguments">Controlling flow of arguments</a></li>
+  </ul>
+
+
+  <h2><a name="initialisingarguments"></a>Initialising arguments</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;help / -h</code>
+    </td>
+    <td>Display a help statement.</td>
+    </tr>
+
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;config</code></td><td>Help for arguments used to configure Jalview from startup</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;opening</code></td><td>Help for arguments used to open and format alignments</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;structure</code></td><td>Help for arguments used to add and format 3D structure data</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;process</code></td><td>Help for arguments used to process an alignment once opened</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;output</code></td><td>Help for arguments used to save data from a processed alignment</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;image</code></td><td>Help for arguments used to export an image of an alignment</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;structureimage</code></td><td>Help for arguments used to export an image of an structure</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;flow</code></td><td>Help for arguments that control processing of the other arguments</td></tr>
+    <tr valign="top"><td><code>&#8209;&#8209;help&#8209;all</code></td><td>Help for all arguments</td></tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;headless</code></td>
+    <td>Run Jalview in headless mode.  No GUI interface will be created and Jalview will quit after all arguments have been processed.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;jabaws&nbsp;<em>URL</em></code></td>
+    <td>Set a different URL to connect to a JABAWS server.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;news / &#8209;&#8209;nonews</code></td>
+    <td>Show (or don't show) the news feed.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;splash / &#8209;&#8209;nosplash</code></td>
+    <td>Show (or don't show) the About Jalview splash screen.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;questionnaire / &#8209;&#8209;noquestionnaire</code></td>
+    <td>Show (or don't show) the questionnaire if one is available.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;usagestats / &#8209;&#8209;nousagestats</code></td>
+    <td>Send (or don't send) initial launch usage stats. <em>Note: usage stats are useful for future funding for Jalview!</em></td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;webservicediscovery / &#8209;&#8209;nowebservicediscovery</code></td>
+    <td>Attempt (or don't attempt) to connect to JABAWS web services.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;props&nbsp;<em>filename</em></code></td>
+    <td>Use file <em>filename</em> as the preferences file <em>instead</em> of the usual <code>~/.jalview_properties</code> file.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;debug</code></td>
+    <td>Start Jalview in debug log level.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;quiet</code></td>
+    <td>Stop all output to STDOUT (after the Java Virtual Machine has started).  Use <code>&#8209;&#8209;quiet</code> a second time to stop all output to STDERR.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;initsubstitutions / &#8209;&#8209;noinitsubstitutions</code></td>
+    <td>Set <code>&#8209;&#8209;substitutions</code> to be initially enabled (or initially disabled).</td>
+    </tr>
+
+<!--
+    <tr valign="top">
+    <td><code>&#8209;&#8209;threads <em>NUMBER</em></code></td>
+    <td>When opening multiple alignment windows, set a limit of <em>NUMBER</em> alignments being processed at one time.  The default is 3.</td>
+-->
+
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;jvmmempc=<em>PERCENT</em></code></td>
+    <td>
+      Limit maximum heap size (memory) to <em>PERCENT</em>% of total physical memory detected.
+      This defaults to 90 if total physical memory can be detected.
+      <br/>
+      The equals sign ("=") separator must be used with no spaces.
+      <br/>
+      See <a href="../memory.html">Memory usage settings for Jalview</a> for more details.
+    </td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;jvmmemmax=<em>MAXMEMORY</em></code></td>
+    <td>
+      Limit maximum heap size (memory) to <em>MAXMEMORY</em>. <em>MAXMEMORY</em> can be specified in bytes, kilobytes(k), megabytes(m),
+      gigabytes(g) or if you're lucky enough, terabytes(t).
+      This defaults to 32g if total physical memory can be detected, or to 8g if total physical memory cannot be detected.
+      <br/>
+      The equals sign ("=") separator must be used with no spaces.
+      <br/>
+      See <a href="../memory.html">Memory usage settings for Jalview</a> for more details.
+    </td>
+    </tr>
+
+  </table>
+
+
+  <h2><a name="openinganalignment"></a>Opening an alignment</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    <td><strong>sub-value modifiers</strong> (optional)</td>
+    <td><strong>linked</strong> (optional)</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;open&nbsp;<em>filename/URL ...</em></code></td>
+    <td>
+    Opens one or more alignment files <em>filename</em> or URLs <em>URL</em> in new alignment windows.
+    </td>
+    <td>
+      <code>
+        colour=<em>name</em>,
+        <br/>
+        title=<em>string</em>,
+        <br/>
+        features=<em>filename</em>,
+        <br/>
+        annotations=<em>filename</em>,
+        <br/>
+        tree=<em>filename</em>,
+        <br/>
+        showannotations,
+        <br/>
+        showssannotations,
+        <br/>
+        sortbytree,
+        <br/>
+        wrap
+      </code>
+    </td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;append&nbsp;<em>filename/URL ...</em></code></td>
+    <td>Appends one or more alignment files <em>filename</em> or URLs <em>URL</em> to the open alignment window (or opens a new alignment if none already open).</td>
+    <td>
+    <code>
+        colour=<em>name</em>,
+        <br/>
+        title=<em>string</em>,
+        <br/>
+        features=<em>filename</em>,
+        <br/>
+        annotations=<em>filename</em>,
+        <br/>
+        tree=<em>filename</em>,
+        <br/>
+        showannotations,
+        <br/>
+        showssannotations,
+        <br/>
+        sortbytree,
+        <br/>
+        wrap
+      </code>
+    </td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;title&nbsp;<em>"string""</em></code></td>
+    <td>Specifies the title for the open alignment window as <em>string</em>.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;colour&nbsp;<em>name</em></code></td>
+    <td>Applies the colour scheme <em>name</em> to the open alignment window.  Valid values for <em>name</em> are:
+    <br/>
+    <code>clustal</code>,
+    <br/>
+    <code>blosum62</code>,
+    <br/>
+    <code>pc-identity</code>,
+    <br/>
+    <code>zappo</code>,
+    <br/>
+    <code>taylor</code>,
+    <br/>
+    <code>gecos-flower</code>,
+    <br/>
+    <code>gecos-blossom</code>,
+    <br/>
+    <code>gecos-sunset</code>,
+    <br/>
+    <code>gecos-ocean</code>,
+    <br/>
+    <code>hydrophobic</code>,
+    <br/>
+    <code>helix-propensity</code>,
+    <br/>
+    <code>strand-propensity</code>,
+    <br/>
+    <code>turn-propensity</code>,
+    <br/>
+    <code>buried-index</code>,
+    <br/>
+    <code>nucleotide</code>,
+    <br/>
+    <code>nucleotide-ambiguity</code>,
+    <br/>
+    <code>purine-pyrimidine</code>,
+    <br/>
+    <code>rna-helices</code>,
+    <br/>
+    <code>t-coffee-scores</code>,
+    <br/>
+    <code>sequence-id</code>.
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;features&nbsp;<em>filename/URL</em></code></td>
+    <td>Add a feature file <em>filename</em> or URL <em>URL</em> to the open alignment.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;tree&nbsp;<em>filename/URL</em></code></td>
+    <td>Add a tree file <em>filename</em> or URL <em>URL</em> to the open alignment.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;sortbytree / &#8209;&#8209;nosortbytree</code></td>
+    <td>Enforces sorting (or not sorting) the alignment in the order of an attached phylogenetic tree.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;annotations&nbsp;<em>filename/URL</em></code></td>
+    <td>Add an annotations file <em>filename</em> or URL <em>URL</em> to the open alignment.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;showannotations / &#8209;&#8209;noshowannotations</code></td>
+    <td>Enforces showing (or not showing) alignment annotations.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;wrap / &#8209;&#8209;nowrap</code></td>
+    <td>Enforces wrapped (or not wrapped) alignment formatting.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;nostructure</code></td>
+    <td>Do not open or process any 3D structure in the <code>&#8209;&#8209;open</code> or <code>&#8209;&#8209;append</code> files.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+  </table>
+
+
+  <h2><a name="adding3dstructure"></a>Adding 3D structure</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    <td><strong>sub-value modifiers</strong> (optional)</td>
+    <td><strong>linked</strong> (optional)</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structure&nbsp;<em>filename/URL</em></code></td>
+    <td>Load a structure file <em>filename</em> or URL <em>URL</em> associated with a sequence in the open alignment.  The sequence to be associated with can be specified with a following <code>&#8209;&#8209;seqid</code> argument, or the sub-value modifier <code>seqid=<em>ID</em></code> can be used.  A sub-value <em>INDEX</em> can also be used to specify the <em>INDEX-th</em> sequence in the open alignment.</td>
+    <td>
+      <code>
+        seqid=<em>id</em></code> or <code><em>INDEX</em>,
+        <br/>
+        paefile=<em>filename</em>,
+        <br/>
+        tempfac=<em>name</em>,
+        <br/>
+        showssannotations,
+        <!--
+        <br/>
+        notempfac,
+        -->
+        <br/>
+        structureviewer=<em>name</em>
+      </code></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;seqid&nbsp;<em>ID</em></code></td>
+    <td>Specify the sequence name for the preceding <code>&#8209;&#8209;structure</code> to be associated with.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;paematrix&nbsp;<em>filename</em></code></td>
+    <td>Add a PAE json matrix file <em>filename</em> to the preceding <code>&#8209;&#8209;structure</code>.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;tempfac&nbsp;<em>name</em></code></td>
+    <td>Set the type of temperature factor.  Valid values for <em>name</em> are:
+      <br/>
+      <code>default</code>,
+      <br/>
+      <code>plddt</code>
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureviewer&nbsp;<em>name</em></code></td>
+    <td>Set the structure viewer to use to open the 3d structure file specified in previous <code>&#8209;&#8209;structure</code> to <em>name</em>.  Valid values of <em>name</em> are:
+    <br/>
+    <code>none</code>,
+    <br/>
+    <code>jmol</code>,
+    <br/>
+    <code>chimera</code> <em>- requires installation, might need configuring in Preferences</em>,
+    <br/>
+    <code>chimerax</code> <em>- requires installation, might need configuring in Preferences</em>,
+    <br/>
+    <code>pymol</code> <em>- requires installation, might need configuring in Preferences</em>
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+
+    <!--
+    <tr valign="top">
+    <td><code>&#8209;&#8209;notempfac</code></td>
+    <td>Do not show the temperature factor annotation for the preceding <code>&#8209;&#8209;structure</code></td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+    -->
+
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;showssannotations / &#8209;&#8209;noshowssannotations</code></td>
+    <td>Do not show secondary structure annotations for the preceding <code>&#8209;&#8209;structure</code></td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;close</code></td>
+    <td>Close the open alignment window.  This occurs after other output, processing and image export arguments.  This applies to the current open alignment -- to apply to all <code>&#8209;&#8209;output</code> and <code>&#8209;&#8209;image</code> files, use after <code>&#8209;&#8209;all</code>.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+  </table>
+
+
+  <h2><a name="processingalignments"></a>Processing alignments</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    <td><strong>sub-value modifiers</strong> (optional)</td>
+    <td><strong>linked</strong> (optional)</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;groovy&nbsp;<em>filename</em></code></td>
+    <td>Process a groovy script in the file for the open alignment.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+  </table>
+
+
+  <h2><a name="outputtingalignmentfiles"></a>Outputting alignment files</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    <td><strong>sub-value modifiers</strong> (optional)</td>
+    <td><strong>linked</strong> (optional)</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;output&nbsp;<em>filename</em></code></td>
+    <td>Export the open alignment to file <em>filename</em>.  The format <em>name</em> is specified by the sub-value modifier <code>format=<em>name</em></code>, a following <code>&#8209;&#8209;format <em>name</em></code> argument or guessed from the file extension.  Valid format names (and file extensions) are:
+    <br/>
+    <code>fasta</code> (<code>fa, fasta, mfa, fastq</code>),
+    <br/>
+    <code>pfam</code> (<code>pfam</code>),
+    <br/>
+    <code>stockholm</code> (<code>sto, stk</code>),
+    <br/>
+    <code>pir</code> (<code>pir</code>),
+    <br/>
+    <code>blc</code> (<code>blc</code>),
+    <br/>
+    <code>amsa</code> (<code>amsa</code>),
+    <br/>
+    <code>json</code> (<code>json</code>),
+    <br/>
+    <code>pileup</code> (<code>pileup</code>),
+    <br/>
+    <code>msf</code> (<code>msf</code>),
+    <br/>
+    <code>clustal</code> (<code>aln</code>),
+    <br/>
+    <code>phylip</code> (<code>phy</code>),
+    <br/>
+    <code>jalview</code> (<code>jvp, jar</code>).
+    </td>
+    <td><code>format=<em>name</em></code></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;format&nbsp;<em>name</em></code></td>
+    <td>Sets the format for the preceding <code>&#8209;&#8209;output</code> file.  Valid formats are:
+    <br/>
+    <code>fasta</code>,
+    <br/>
+    <code>pfam</code>,
+    <br/>
+    <code>stockholm</code>,
+    <br/>
+    <code>pir</code>,
+    <br/>
+    <code>blc</code>,
+    <br/>
+    <code>amsa</code>,
+    <br/>
+    <code>json</code>,
+    <br/>
+    <code>pileup</code>,
+    <br/>
+    <code>msf</code>,
+    <br/>
+    <code>clustal</code>,
+    <br/>
+    <code>phylip</code>,
+    <br/>
+    <code>jalview</code>.
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;backups / &#8209;&#8209;nobackups</code></td>
+    <td>Enable (or disable) writing backup files when saving an <code>&#8209;&#8209;output</code> file.  This applies to the current open alignment -- to apply to all <code>&#8209;&#8209;output</code> and <code>&#8209;&#8209;image</code> files, use after <code>&#8209;&#8209;all</code>.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;overwrite / &#8209;&#8209;nooverwrite</code></td>
+    <td>Enable (or disable) overwriting of output files without backups enabled.  This applies to the current open alignment -- to apply to all <code>&#8209;&#8209;output</code> and <code>&#8209;&#8209;image</code> files, use after <code>&#8209;&#8209;all</code>.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+  </table>
+
+
+  <h2><a name="exportingimagefiles"></a>Exporting image files</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    <td><strong>sub-value modifiers</strong> (optional)</td>
+    <td><strong>linked</strong> (optional)</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;image&nbsp;<em>filename</em></code></td>
+    <td>Output an image of the open alignment window.  Format is specified by the sub-value modifier, a following <code>&#8209;&#8209;type</code> argument or guessed from the file extension.  Valid formats/extensions are:
+    <br/>
+    <code>svg</code>,
+    <br/>
+    <code>png</code>,
+    <br/>
+    <code>eps</code>,
+    <br/>
+    <code>html</code>,
+    <br/>
+    <code>biojs</code>.
+    </td>
+    <td>
+      <code>type=<em>name</em>,
+      <code>textrenderer=<em>name</em>,
+      <code>scale=<em>number</em>,
+      <code>width=<em>number</em>,
+      <code>height=<em>number</em>
+    </td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;type&nbsp;<em>name</em></code></td>
+    <td>Set the image format for the preceding <code>&#8209;&#8209;image</code> to <em>name</em>.  Valid values for <em>name</em> are:
+    <br/>
+    <code>svg</code>,
+    <br/>
+    <code>png</code>,
+    <br/>
+    <code>eps</code>,
+    <br/>
+    <code>html</code>,
+    <br/>
+    <code>biojs</code>.
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;textrenderer&nbsp;<em>name</em></code></td>
+    <td>Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art.  Valid values for <em>name</em> are:
+    <br/>
+    <code>text</code>,
+    <br/>
+    <code>lineart</code>.
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;scale&nbsp;<em>number</em></code></td>
+    <td>Sets a scaling for bitmap image format (PNG).  Should be given as a floating point number.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--width</code> and <code>--height</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;width&nbsp;<em>number</em></code></td>
+    <td>Sets a width for bitmap image format (PNG) with the height maintaining the aspect ratio.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--scale</code> and <code>--height</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;height&nbsp;<em>number</em></code></td>
+    <td>Sets a height for bitmap image format (PNG) with the width maintaining the aspect ratio.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--scale</code> and <code>--width</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;groovy&nbsp;<em>filename</em></code></td>
+    <td>Process a groovy script in the file for the open alignment.</td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+  </table>
+
+
+  <h2><a name="exporting3dstructureimagefiles"></a>Exporting 3D structure image files (<code>jmol</code> only)</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    <td><strong>sub-value modifiers</strong> (optional)</td>
+    <td><strong>linked</strong> (optional)</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimage&nbsp;<em>filename</em></code></td>
+    <td>Export an image of a 3D structure opened in JMOL.  Image formats can be:
+    <br/>
+    <code>svg</code>,
+    <br/>
+    <code>png</code>,
+    <br/>
+    <code>eps</code>.
+    </td>
+    <td>
+      <code>structureimagetype=<em>name</em>,
+      <code>structureimagetextrenderer=<em>name</em>,
+      <code>structureimagescale=<em>number</em>,
+      <code>structureimagewidth=<em>number</em>,
+      <code>structureimageheight=<em>number</em>
+    </td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimagetype&nbsp;<em>name</em></code></td>
+    <td>Set the structure image format for the preceding --structureimage. Valid values are:
+    <br/>
+    <code>svg</code>,
+    <br/>
+    <code>png</code>,
+    <br/>
+    <code>eps</code>.
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimagetextrenderer&nbsp;<em>name</em></code></td>
+    <td>Sets whether text in a vector structure image format (SVG, EPS) should be rendered as text or vector line-art. Possible values are:
+    <br/>
+    <code>text</code>,
+    <br/>
+    <code>lineart</code>.
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimagescale&nbsp;<em>number</em></code></td>
+    <td>Sets a scaling for bitmap structure image format (PNG). Should be given as a floating point number. If used in conjunction with --structureimagewidth and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimagewidth&nbsp;<em>number</em></code></td>
+    <td>Sets a width for bitmap structure image format (PNG) with the height maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;structureimageheight&nbsp;<em>number</em></code></td>
+    <td>Sets a height for bitmap structure image format (PNG) with the width maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimagewidth then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).
+    </td>
+    <td></td>
+    <td align="center">&#x2713;</td>
+    </tr>
+
+  </table>
+
+
+  <h2><a name="controllingflowofarguments"></a>Controlling flow of arguments</h2>
+
+  <table border="1" cellpadding="3">
+    <tr valign="top">
+    <td><strong>argument</strong></td>
+    <td><strong>action</strong></td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;new</code></td>
+    <td>
+    Move on to a new alignment window.  This will ensure <code>&#8209;&#8209;append</code> will start a new alignment window and other linked arguments will apply to the new alignment window.
+    <br/>
+    <em>Note</em> that <code>--open</code> already starts a new alignment window for each file it opens.
+    </td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;substitutions / &#8209;&#8209;nosubstitutions</code></td>
+    <td>The following argument values allow (or don't allow) subsituting filename parts.  This is initially true.  Valid substitutions are
+    <code>{basename}</code> - the filename-without-extension of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
+    <br/>
+    <code>{dirname}</code>, - the directory (folder) name of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
+    <br/>
+    <code>{argfilebasename}</code> - the filename-without-extension of the current <code>&#8209;&#8209;argfile</code>,
+    <br/>
+    <code>{argfiledirname}</code> - the directory (folder) name of the current <code>&#8209;&#8209;argfile</code>,
+    <br/>
+    <code>{n}</code> - the value of the index counter (starting at 0).
+    <br/>
+    <code>{++n}</code> - increase and substitute the value of the index counter,
+    <br/>
+    <code>{}</code> - the value of the current alignment window <em>default</em> index.
+    </td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;argfile&nbsp;<em>filename</em></code></td>
+    <td>
+    Open one or more files <em>filename</em> and read, line-by-line, as arguments to Jalview.
+    <br/>
+    Values in an argfile should be given with an equals sign ("=") separator with no spaces.
+    <br/>
+    <strong>Note</strong> that if you use one or more <code>&#8209;&#8209;argfile</code> arguments then all other non-initialising arguments will be ignored.
+    </td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;npp</code></td>
+    <td>Increase the index counter used in argument value substitutions.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;all / &#8209;&#8209;noall</code></td>
+    <td>Apply (or stop applying) the following output arguments to <em>all</em> sets of linked arguments.</td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;allstructures / &#8209;&#8209;noallstructures</code></td>
+    <td>
+        Apply (or stop applying) the following 3D structure formatting arguments to all structures <em>within the current open alignment</em>.  Whilst <code>--allstructures</code> will continue to operate for a <code>--new</code> alignment, the structure formatting arguments must be set again for each new alignment.
+    </td>
+    </tr>
+
+    <tr valign="top">
+    <td><code>&#8209;&#8209;quit</code></td>
+    <td>After all files have been opened, appended and output, quit Jalview.  In <code>&#8209;&#8209;headless</code> mode this already happens.</td>
+    </tr>
+
+  </table>
+
+</body>
+</html>
index 437392f..20bcd10 100644 (file)
  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  -->
-<title>Command Line: summary</title>
+<title>Command Line: introduction and reference</title>
 <body>
 
-  <h1>Command Line: summary</h1>
+  <h1>Command Line: introduction and reference</h1>
 
   <p>
-  Command Line: summary
-  <br/>
-  <a href="clarguments-intro.html">Command Line: introduction</a>
+  Command Line: introduction
   <br/>
   <a href="clarguments-basic.html">Command Line: basic usage</a>
   <br/>
   <a href="clarguments-advanced.html">Command Line: advanced usage</a>
   <br/>
   <a href="clarguments-argfiles.html">Command Line: argument files</a>
+  <br/>
+  <a href="clarguments-reference.html">Command Line: reference</a>
   </p>
 
-  <hr/>
-
-
-  <h2>Initialising arguments</h2>
-
-  <table border="1" cellpadding="3">
-    <tr valign="top">
-    <td><strong>argument</strong></td>
-    <td><strong>action</strong></td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;help / -h</code></td>
-    <td>Display a help statement</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;headless</code></td>
-    <td>Run Jalview in headless mode.  No GUI interface will be created and Jalview will quit after all arguments have been processed.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;jabaws&nbsp;<em>URL</em></code></td>
-    <td>Set a different URL to connect to a JABAWS server.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;news / &#8209;&#8209;nonews</code></td>
-    <td>Show (or don't show) the news feed.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;splash / &#8209;&#8209;nosplash</code></td>
-    <td>Show (or don't show) the About Jalview splash screen.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;questionnaire / &#8209;&#8209;noquestionnaire</code></td>
-    <td>Show (or don't show) the questionnaire if one is available.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;usagestats / &#8209;&#8209;nousagestats</code></td>
-    <td>Send (or don't send) initial launch usage stats. <em>Note: usage stats are useful for future funding for Jalview!</em></td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;webservicediscovery / &#8209;&#8209;nowebservicediscovery</code></td>
-    <td>Attempt (or don't attempt) to connect to JABAWS web services.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;props&nbsp;<em>filename</em></code></td>
-    <td>Use file <em>filename</em> as the preferences file <em>instead</em> of the usual <code>~/.jalview_properties</code> file.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;debug</code></td>
-    <td>Start Jalview in debug log level.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;quiet</code></td>
-    <td>Stop all output to STDOUT (after the Java Virtual Machine has started).  Use <code>&#8209;&#8209;quiet</code> a second time to stop all output to STDERR.</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;initsubstitutions / &#8209;&#8209;noinitsubstitutions</code></td>
-    <td>Set <code>&#8209;&#8209;substitutions</code> to be initially enabled (or initially disabled).</td>
-    </tr>
-
-<!--
-    <tr valign="top">
-    <td><code>&#8209;&#8209;threads <em>NUMBER</em></code></td>
-    <td>When opening multiple alignment windows, set a limit of <em>NUMBER</em> alignments being processed at one time.  The default is 3.</td>
--->
-
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;jvmmempc=<em>PERCENT</em></code></td>
-    <td>
-      Limit maximum heap size (memory) to <em>PERCENT</em>% of total physical memory detected.
-      This defaults to 90 if total physical memory can be detected.
-      <br/>
-      The equals sign ("=") separator must be used with no spaces.
-      <br/>
-      See <a href="../memory.html">Memory usage settings for Jalview</a> for more details.
-    </td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;jvmmemmax=<em>MAXMEMORY</em></code></td>
-    <td>
-      Limit maximum heap size (memory) to <em>MAXMEMORY</em>. <em>MAXMEMORY</em> can be specified in bytes, kilobytes(k), megabytes(m),
-      gigabytes(g) or if you're lucky enough, terabytes(t).
-      This defaults to 32g if total physical memory can be detected, or to 8g if total physical memory cannot be detected.
-      <br/>
-      The equals sign ("=") separator must be used with no spaces.
-      <br/>
-      See <a href="../memory.html">Memory usage settings for Jalview</a> for more details.
-    </td>
-    </tr>
-
-  </table>
-
-
-  <h2>Opening an alignment</h2>
-
-  <table border="1" cellpadding="3">
-    <tr valign="top">
-    <td><strong>argument</strong></td>
-    <td><strong>action</strong></td>
-    <td><strong>sub-value modifiers</strong> (optional)</td>
-    <td><strong>linked</strong> (optional)</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;open&nbsp;<em>filename/URL ...</em></code></td>
-    <td>
-    Opens one or more alignment files <em>filename</em> or URLs <em>URL</em> in new alignment windows.
-    </td>
-    <td>
-      <code>
-        colour=<em>name</em>,
-        <br/>
-        title=<em>string</em>,
-        <br/>
-        features=<em>filename</em>,
-        <br/>
-        annotations=<em>filename</em>,
-        <br/>
-        tree=<em>filename</em>,
-        <br/>
-        showannotations,
-        <br/>
-        showssannotations,
-        <br/>
-        sortbytree,
-        <br/>
-        wrap
-      </code>
-    </td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;append&nbsp;<em>filename/URL ...</em></code></td>
-    <td>Appends one or more alignment files <em>filename</em> or URLs <em>URL</em> to the open alignment window (or opens a new alignment if none already open).</td>
-    <td>
-    <code>
-        colour=<em>name</em>,
-        <br/>
-        title=<em>string</em>,
-        <br/>
-        features=<em>filename</em>,
-        <br/>
-        annotations=<em>filename</em>,
-        <br/>
-        tree=<em>filename</em>,
-        <br/>
-        showannotations,
-        <br/>
-        showssannotations,
-        <br/>
-        sortbytree,
-        <br/>
-        wrap
-      </code>
-    </td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;title&nbsp;<em>"string""</em></code></td>
-    <td>Specifies the title for the open alignment window as <em>string</em>.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;colour&nbsp;<em>name</em></code></td>
-    <td>Applies the colour scheme <em>name</em> to the open alignment window.  Valid values for <em>name</em> are:
-    <br/>
-    <code>clustal</code>,
-    <br/>
-    <code>blosum62</code>,
-    <br/>
-    <code>pc-identity</code>,
-    <br/>
-    <code>zappo</code>,
-    <br/>
-    <code>taylor</code>,
-    <br/>
-    <code>gecos-flower</code>,
-    <br/>
-    <code>gecos-blossom</code>,
-    <br/>
-    <code>gecos-sunset</code>,
-    <br/>
-    <code>gecos-ocean</code>,
-    <br/>
-    <code>hydrophobic</code>,
-    <br/>
-    <code>helix-propensity</code>,
-    <br/>
-    <code>strand-propensity</code>,
-    <br/>
-    <code>turn-propensity</code>,
-    <br/>
-    <code>buried-index</code>,
-    <br/>
-    <code>nucleotide</code>,
-    <br/>
-    <code>nucleotide-ambiguity</code>,
-    <br/>
-    <code>purine-pyrimidine</code>,
-    <br/>
-    <code>rna-helices</code>,
-    <br/>
-    <code>t-coffee-scores</code>,
-    <br/>
-    <code>sequence-id</code>.
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;features&nbsp;<em>filename/URL</em></code></td>
-    <td>Add a feature file <em>filename</em> or URL <em>URL</em> to the open alignment.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;tree&nbsp;<em>filename/URL</em></code></td>
-    <td>Add a tree file <em>filename</em> or URL <em>URL</em> to the open alignment.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;sortbytree / &#8209;&#8209;nosortbytree</code></td>
-    <td>Enforces sorting (or not sorting) the alignment in the order of an attached phylogenetic tree.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;annotations&nbsp;<em>filename/URL</em></code></td>
-    <td>Add an annotations file <em>filename</em> or URL <em>URL</em> to the open alignment.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;showannotations / &#8209;&#8209;noshowannotations</code></td>
-    <td>Enforces showing (or not showing) alignment annotations.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;wrap / &#8209;&#8209;nowrap</code></td>
-    <td>Enforces wrapped (or not wrapped) alignment formatting.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;nostructure</code></td>
-    <td>Do not open or process any 3D structure in the <code>&#8209;&#8209;open</code> or <code>&#8209;&#8209;append</code> files.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
 
-  </table>
-
-
-  <h2>Adding a 3D structure</h2>
-
-  <table border="1" cellpadding="3">
-    <tr valign="top">
-    <td><strong>argument</strong></td>
-    <td><strong>action</strong></td>
-    <td><strong>sub-value modifiers</strong> (optional)</td>
-    <td><strong>linked</strong> (optional)</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structure&nbsp;<em>filename/URL</em></code></td>
-    <td>Load a structure file <em>filename</em> or URL <em>URL</em> associated with a sequence in the open alignment.  The sequence to be associated with can be specified with a following <code>&#8209;&#8209;seqid</code> argument, or the sub-value modifier <code>seqid=<em>ID</em></code> can be used.  A sub-value <em>INDEX</em> can also be used to specify the <em>INDEX-th</em> sequence in the open alignment.</td>
-    <td>
-      <code>
-        seqid=<em>id</em></code> or <code><em>INDEX</em>,
-        <br/>
-        paefile=<em>filename</em>,
-        <br/>
-        tempfac=<em>name</em>,
-        <br/>
-        showssannotations,
-        <!--
-        <br/>
-        notempfac,
-        -->
-        <br/>
-        structureviewer=<em>name</em>
-      </code></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;seqid&nbsp;<em>ID</em></code></td>
-    <td>Specify the sequence name for the preceding <code>&#8209;&#8209;structure</code> to be associated with.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;paematrix&nbsp;<em>filename</em></code></td>
-    <td>Add a PAE json matrix file <em>filename</em> to the preceding <code>&#8209;&#8209;structure</code>.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;tempfac&nbsp;<em>name</em></code></td>
-    <td>Set the type of temperature factor.  Valid values for <em>name</em> are:
-      <br/>
-      <code>default</code>,
-      <br/>
-      <code>plddt</code>
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;structureviewer&nbsp;<em>name</em></code></td>
-    <td>Set the structure viewer to use to open the 3d structure file specified in previous <code>&#8209;&#8209;structure</code> to <em>name</em>.  Valid values of <em>name</em> are:
-    <br/>
-    <code>none</code>,
-    <br/>
-    <code>jmol</code>,
-    <br/>
-    <code>chimera</code> <em>- requires installation, might need configuring in Preferences</em>,
-    <br/>
-    <code>chimerax</code> <em>- requires installation, might need configuring in Preferences</em>,
-    <br/>
-    <code>pymol</code> <em>- requires installation, might need configuring in Preferences</em>
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-
-    <!--
-    <tr valign="top">
-    <td><code>&#8209;&#8209;notempfac</code></td>
-    <td>Do not show the temperature factor annotation for the preceding <code>&#8209;&#8209;structure</code></td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-    -->
-
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;showssannotations / &#8209;&#8209;noshowssannotations</code></td>
-    <td>Do not show secondary structure annotations for the preceding <code>&#8209;&#8209;structure</code></td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-  </table>
-
-
-  <h2>Outputting files</h2>
-
-  <table border="1" cellpadding="3">
-    <tr valign="top">
-    <td><strong>argument</strong></td>
-    <td><strong>action</strong></td>
-    <td><strong>sub-value modifiers</strong> (optional)</td>
-    <td><strong>linked</strong> (optional)</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;output&nbsp;<em>filename</em></code></td>
-    <td>Export the open alignment to file <em>filename</em>.  The format <em>name</em> is specified by the sub-value modifier <code>format=<em>name</em></code>, a following <code>&#8209;&#8209;format <em>name</em></code> argument or guessed from the file extension.  Valid format names (and file extensions) are:
-    <br/>
-    <code>fasta</code> (<code>fa, fasta, mfa, fastq</code>),
-    <br/>
-    <code>pfam</code> (<code>pfam</code>),
-    <br/>
-    <code>stockholm</code> (<code>sto, stk</code>),
-    <br/>
-    <code>pir</code> (<code>pir</code>),
-    <br/>
-    <code>blc</code> (<code>blc</code>),
-    <br/>
-    <code>amsa</code> (<code>amsa</code>),
-    <br/>
-    <code>json</code> (<code>json</code>),
-    <br/>
-    <code>pileup</code> (<code>pileup</code>),
-    <br/>
-    <code>msf</code> (<code>msf</code>),
-    <br/>
-    <code>clustal</code> (<code>aln</code>),
-    <br/>
-    <code>phylip</code> (<code>phy</code>),
-    <br/>
-    <code>jalview</code> (<code>jvp, jar</code>).
-    </td>
-    <td><code>format=<em>name</em></code></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;format&nbsp;<em>name</em></code></td>
-    <td>Sets the format for the preceding <code>&#8209;&#8209;output</code> file.  Valid formats are:
-    <br/>
-    <code>fasta</code>,
-    <br/>
-    <code>pfam</code>,
-    <br/>
-    <code>stockholm</code>,
-    <br/>
-    <code>pir</code>,
-    <br/>
-    <code>blc</code>,
-    <br/>
-    <code>amsa</code>,
-    <br/>
-    <code>json</code>,
-    <br/>
-    <code>pileup</code>,
-    <br/>
-    <code>msf</code>,
-    <br/>
-    <code>clustal</code>,
-    <br/>
-    <code>phylip</code>,
-    <br/>
-    <code>jalview</code>.
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;image&nbsp;<em>filename</em></code></td>
-    <td>Output an image of the open alignment window.  Format is specified by the sub-value modifier, a following <code>&#8209;&#8209;type</code> argument or guessed from the file extension.  Valid formats/extensions are:
-    <br/>
-    <code>svg</code>,
-    <br/>
-    <code>png</code>,
-    <br/>
-    <code>eps</code>,
-    <br/>
-    <code>html</code>,
-    <br/>
-    <code>biojs</code>.
-    </td>
-    <td>
-      <code>type=<em>name</em>,
-      <code>textrenderer=<em>name</em>,
-      <code>scale=<em>number</em>,
-      <code>width=<em>number</em>,
-      <code>height=<em>number</em>
-    </td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;type&nbsp;<em>name</em></code></td>
-    <td>Set the image format for the preceding <code>&#8209;&#8209;image</code> to <em>name</em>.  Valid values for <em>name</em> are:
-    <br/>
-    <code>svg</code>,
-    <br/>
-    <code>png</code>,
-    <br/>
-    <code>eps</code>,
-    <br/>
-    <code>html</code>,
-    <br/>
-    <code>biojs</code>.
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;textrenderer&nbsp;<em>name</em></code></td>
-    <td>Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art.  Valid values for <em>name</em> are:
-    <br/>
-    <code>text</code>,
-    <br/>
-    <code>lineart</code>.
-    </td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;scale&nbsp;<em>number</em></code></td>
-    <td>Sets a scaling for bitmap image format (PNG).  Should be given as a floating point number.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--width</code> and <code>--height</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;width&nbsp;<em>number</em></code></td>
-    <td>Sets a width for bitmap image format (PNG) with the height maintaining the aspect ratio.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--scale</code> and <code>--height</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
-
-    <tr valign="top">
-    <td><code>&#8209;&#8209;height&nbsp;<em>number</em></code></td>
-    <td>Sets a height for bitmap image format (PNG) with the width maintaining the aspect ratio.  Should be given as a positive integer.  This can also be set as a sub-value modifier to the <code>--image</code> value.  If used in conjunction with <code>--scale</code> and <code>--width</code> then the smallest scaling will be used (<code>scale</code>, <code>width</code> and <code>height</code> provide bounds for the image).</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
+  <hr/>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;groovy&nbsp;<em>filename</em></code></td>
-    <td>Process a groovy script in the file for the open alignment.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
+  <ul>
+  <li><a href="#introduction">Introduction</a></li>
+  <li><a href="#syntax">Syntax</a></li>
+  </ul>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;backups / &#8209;&#8209;nobackups</code></td>
-    <td>Enable (or disable) writing backup files when saving an <code>&#8209;&#8209;output</code> file.  This applies to the current open alignment -- to apply to all <code>&#8209;&#8209;output</code> and <code>&#8209;&#8209;image</code> files, use after <code>&#8209;&#8209;all</code>.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
+  <h2><a name="introduction"></a>Introduction</h2>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;overwrite / &#8209;&#8209;nooverwrite</code></td>
-    <td>Enable (or disable) overwriting of output files without backups enabled.  This applies to the current open alignment -- to apply to all <code>&#8209;&#8209;output</code> and <code>&#8209;&#8209;image</code> files, use after <code>&#8209;&#8209;all</code>.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
+  <p>
+  From version 2.11.3.0 Jalview has a new set of command line arguments
+  which allow more powerful and flexible combinations of arguments, though can
+  also be used for simple use cases too.
+  </p>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;close</code></td>
-    <td>Close the current open alignment window.  This occurs after other output arguments.  This applies to the current open alignment -- to apply to all <code>&#8209;&#8209;output</code> and <code>&#8209;&#8209;image</code> files, use after <code>&#8209;&#8209;all</code>.</td>
-    <td></td>
-    <td align="center">&#x2713;</td>
-    </tr>
+  <p>
+  These new arguments are all accessed with a <code>--doubledash</code> form of
+  command line argument (with the one exception where simply opening one or more
+  files can be performed without any arguments other than the filenames).
+  </p>
 
-  </table>
+  <p>
+  The old command line arguments can still be used (see
+  <a href="clarguments-old.html">the old page on command line arguments</a>) so
+  existing scripts utilising them should not break.
+  <br/>
+  <strong>These are now deprecated and will be removed</strong> in a future version of Jalview.
+  </p>
 
+  <p>
+  However, you cannot mix old and new style arguments, so if you use any
+  <code>-singledash</code> arguments (with the exception of <code>-help</code> or <code>-h</code>), they will all be interpreted as
+  old style arguments with the new <code>--doubledash</code>
+  arguments being ignored.  If you have a script
+  that uses the old arguments without any dashes, and uses the bare-word
+  <code>open</code> then these will also be interpreted as old style arguments.
+  </p>
 
-  <h2>Controlling flow of arguments</h2>
+  <p>
+  <strong>Warning!</strong> If you use command line arguments without any dashes and
+  <em>don't</em> use the bare-word argument <code>open</code> then all
+  your arguments will be interpreted as alignment files to be opened by the
+  new command line argument process!
+  </p>
 
-  <table border="1" cellpadding="3">
-    <tr valign="top">
-    <td><strong>argument</strong></td>
-    <td><strong>action</strong></td>
-    </tr>
+  <p>
+  To launch Jalview from the command line, see
+  <a href="commandline.html">running Jalview from the command line</a>.
+  </p>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;new</code></td>
-    <td>
-    Move on to a new alignment window.  This will ensure <code>&#8209;&#8209;append</code> will start a new alignment window and other linked arguments will apply to the new alignment window.
-    <br/>
-    <em>Note</em> that <code>--open</code> already starts a new alignment window for each file it opens.
-    </td>
-    </tr>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;substitutions / &#8209;&#8209;nosubstitutions</code></td>
-    <td>The following argument values allow (or don't allow) subsituting filename parts.  This is initially true.  Valid substitutions are
-    <code>{basename}</code> - the filename-without-extension of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
-    <br/>
-    <code>{dirname}</code>, - the directory (folder) name of the currently <code>&#8209;&#8209;open</code>ed file (or first <code>&#8209;&#8209;append</code>ed file),
-    <br/>
-    <code>{argfilebasename}</code> - the filename-without-extension of the current <code>&#8209;&#8209;argfile</code>,
-    <br/>
-    <code>{argfiledirname}</code> - the directory (folder) name of the current <code>&#8209;&#8209;argfile</code>,
-    <br/>
-    <code>{n}</code> - the value of the index counter (starting at 0).
-    <br/>
-    <code>{++n}</code> - increase and substitute the value of the index counter,
-    <br/>
-    <code>{}</code> - the value of the current alignment window <em>default</em> index.
-    </td>
-    </tr>
+  <h2><a name="syntax"></a>Syntax</h2>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;argfile&nbsp;<em>filename</em></code></td>
-    <td>
-    Open one or more files <em>filename</em> and read, line-by-line, as arguments to Jalview.
-    <br/>
-    Values in an argfile should be given with an equals sign ("=") separator with no spaces.
-    <br/>
-    <strong>Note</strong> that if you use one or more <code>&#8209;&#8209;argfile</code> arguments then all other non-initialising arguments will be ignored.
-    </td>
-    </tr>
+  <p>
+  The new command line argument parser can group certain labelled arguments together, or give them a default label based on their position in the list of arguments (in which case you won't ever need to know what the label is).  All arguments are read before any alignment actions are performed.  For basic usage without additional syntax, please see the <a href="clarguments-basic.html">Command Line: basic usage</a> explanatory page.
+  </p>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;npp</code></td>
-    <td>Increase the index counter used in argument value substitutions.</td>
-    </tr>
+  <h3>
+  Parts of Jalview's command line arguments
+  </h3>
+  <pre>jalview --argname[linkedId]=[subvalues]value --switch --noswitch --argname[linkedId] [subvalues]filename1 filename2 ...</pre>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;all / &#8209;&#8209;noall</code></td>
-    <td>Apply (or stop applying) the following output arguments to <em>all</em> sets of linked arguments.</td>
-    </tr>
+  <p>
+  Different arguments can take one or more values, others take no value and act like a switch (some can be set on and off and others are only on, depending on the use).
+  <br/>
+  <ul>
+    <li>
+        For arguments that require a value, the value can be given after an equals-sign ('=') or a space (' ').
+        <br/>
+        <code>--arg value</code>
+        <br/>
+        <code>--arg=value</code>
+    </li>
+    <li>
+        For arguments that can take multiple values (these will be filenames), the multiple filenames should appear after a space. If you use a filename wildcard you can put this after a space (which will be expanded by the shell unto multiple filenames before they reach Jalview), or you can put it after an equals-sign, which will be used by Jalview to find a list of files.  You cannot use an equals-sign and value followed by further values.
+        <br/>
+        <code>--arg file1.fa otherfile.stk</code>
+        <br/>
+        <code>--arg filename*.fa</code> <em>(expanded by shell)</em>
+        <br/>
+        <code>--arg=filename*.fa</code> <em>(expanded by Jalview)</em>
+    </li>
+    <li>
+        For arguments that act as a switch, most can be negated by preceding the argument name with <code>no</code>.
+        <br/>
+        <code>--switch</code>
+        <br/>
+        <code>--noswitch</code>
+    </li>
+    <li>
+        Some values can be modified, or may need additional information (for instance an <code>--image</code> output can be modified with a <code>--scale=number</code> factor, or a <code>--structure</code> can refer to a sequence with a <code>--seqid=ID</code>).  This additional information can be added in a number of different ways.
+        <ul>
+          <li>
+              An argument immediately following the main argument.
+              <br/>
+              <code>--image output.png --scale 2.5</code>
+          </li>
+          <li>
+              A <em>sub-value modifier</em>, which is where one or more (comma-separated) values are added to the start of the main value, placed in square brackets.
+              <br/>
+              <code>--open=[nowrap,colour=gecos-blossom]uniref50.fa</code>
+              <br/>
+              Sub-value modifiers with a value must use an equals-sign separator, and those that act as a switch can simply be included without an equals-sign or value, and can be preceded with <code>no</code> to negate the value, as with the argument name.
+          </li>
+          <li>
+              Another argument with the same <em>linked ID</em>.  A linked ID is an optional identifier for a particular open alignment, placed in square brackets immediately following the argument name (before the equals-sign or space).  If linked IDs are specified they do not need to be near to each other.
+              <br/>
+              <code>--image[MYID]=output.png --other --args --scale[MYID]=2.5</code>
+          </li>
+          <li>
+              An argument that is designated as applying to <em>all linked IDs</em>
+              <br/>
+              <code>--image=output.png --other --args --all --scale=2.5</code>
+              <br/>
+              <code>--image=output.png --other --args --scale[*]=2.5</code>
+          </li>
+        </ul>
+    </li>
+  </ul>
+  </p>
 
-    <tr valign="top">
-    <td><code>&#8209;&#8209;quit</code></td>
-    <td>After all files have been opened, appended and output, quit Jalview.  In <code>&#8209;&#8209;headless</code> mode this already happens.</td>
-    </tr>
+  <p>
+  This may sound complicated, but nearly everything can be done just with plain command line arguments, though in this case the ordering of the arguments is more important.
+  </p>
 
-  </table>
+  <hr/>
+  Continue to <a href="clarguments-basic.html">Command Line: basic usage</a>.
+  <br/>
+  <a href="clarguments-reference.html">Command Line: reference</a>
 
 </body>
 </html>
similarity index 54%
rename from j8lib/flatlaf-3.0.jar
rename to j11lib/flatlaf-3.1.1.jar
index 75d90d3..2b13cdd 100644 (file)
Binary files a/j8lib/flatlaf-3.0.jar and b/j11lib/flatlaf-3.1.1.jar differ
similarity index 60%
rename from j8lib/flatlaf-extras-3.0.jar
rename to j11lib/flatlaf-extras-3.1.1.jar
index 1f6bbc3..9d91bd0 100644 (file)
Binary files a/j8lib/flatlaf-extras-3.0.jar and b/j11lib/flatlaf-extras-3.1.1.jar differ
index 5c98d23..7c99c93 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
diff --git a/j8lib/flatlaf-3.1.1.jar b/j8lib/flatlaf-3.1.1.jar
new file mode 100644 (file)
index 0000000..2b13cdd
Binary files /dev/null and b/j8lib/flatlaf-3.1.1.jar differ
diff --git a/j8lib/flatlaf-extras-3.1.1.jar b/j8lib/flatlaf-extras-3.1.1.jar
new file mode 100644 (file)
index 0000000..9d91bd0
Binary files /dev/null and b/j8lib/flatlaf-extras-3.1.1.jar differ
index 5c98d23..7c99c93 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ
index 36572ed..d20f63c 100644 (file)
@@ -703,7 +703,7 @@ label.sequence_details_for = Sequence Details for {0}
 label.sequence_name = Sequence Name
 label.sequence_description = Sequence Description
 label.edit_sequence_name_description = Edit Sequence Name/Description
-label.spaces_converted_to_underscores = Spaces have been converted to _
+label.spaces_converted_to_underscores = Spaces have been converted to underscores (_)
 label.no_spaces_allowed_sequence_name = No spaces allowed in Sequence Name
 label.select_outline_colour = Select Outline Colour
 label.web_browser_not_found_unix = Unixers\: Couldn't find default web browser.\nAdd the full path to your browser in Preferences."
index 4ac298f..b3c6988 100644 (file)
@@ -640,7 +640,7 @@ label.sequence_details_for = Detalles de la secuencia para {0}
 label.sequence_name = Nombre de la secuencia
 label.sequence_description = Descripción de la secuencia
 label.edit_sequence_name_description = Editar el nombre/descripción de la secuencia
-label.spaces_converted_to_underscores = Los espacios se han convertido en _
+label.spaces_converted_to_underscores = Los espacios se han convertido en guión bajos (_)
 label.no_spaces_allowed_sequence_name = No se permiten espacios en el nombre de la secuencia
 label.select_outline_colour = Seleccionar el color del límite
 label.web_browser_not_found_unix = Unixers\: No es posible encontrar el navegador web por defecto.\nA\u00F1ada la ruta completa de su navegador en la pesta\u00F1a de Preferencias.
index 2a2fc70..0159bc7 100644 (file)
  */
 package jalview.appletgui;
 
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.CheckboxMenuItem;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Label;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
+import java.awt.Panel;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.Arrays;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import org.jmol.viewer.Viewer;
+
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.analysis.TreeBuilder;
@@ -81,45 +120,6 @@ import jalview.util.MessageManager;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.ViewportRanges;
 
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.CheckboxMenuItem;
-import java.awt.Color;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.Label;
-import java.awt.Menu;
-import java.awt.MenuBar;
-import java.awt.MenuItem;
-import java.awt.Panel;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.Arrays;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.jmol.viewer.Viewer;
-
 public class AlignFrame extends EmbmenuFrame implements ActionListener,
         ItemListener, KeyListener, AlignViewControllerGuiI
 {
index dcdb4c0..753ded2 100644 (file)
@@ -14,11 +14,11 @@ import java.util.Locale;
 import java.util.Map;
 
 import jalview.analysis.AlignmentUtils;
+import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.argparser.Arg;
 import jalview.bin.argparser.ArgParser;
 import jalview.bin.argparser.ArgParser.Position;
 import jalview.bin.argparser.ArgValue;
-import jalview.bin.argparser.ArgValues;
 import jalview.bin.argparser.ArgValuesMap;
 import jalview.bin.argparser.SubVals;
 import jalview.datamodel.AlignmentI;
@@ -26,6 +26,7 @@ import jalview.datamodel.SequenceI;
 import jalview.datamodel.annotations.AlphaFoldAnnotationRowBuilder;
 import jalview.gui.AlignFrame;
 import jalview.gui.AlignmentPanel;
+import jalview.gui.AppJmol;
 import jalview.gui.Desktop;
 import jalview.gui.Preferences;
 import jalview.gui.StructureChooser;
@@ -45,9 +46,13 @@ import jalview.io.IdentifyFile;
 import jalview.io.NewickFile;
 import jalview.structure.StructureImportSettings.TFType;
 import jalview.structure.StructureSelectionManager;
+import jalview.util.FileUtils;
 import jalview.util.HttpUtils;
+import jalview.util.ImageMaker;
+import jalview.util.ImageMaker.TYPE;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
+import jalview.util.imagemaker.BitmapImageSizing;
 
 public class Commands
 {
@@ -73,7 +78,7 @@ public class Commands
     argParser = argparser;
     headless = h;
     desktop = d;
-    afMap = new HashMap<String, AlignFrame>();
+    afMap = new HashMap<>();
     if (argparser != null)
     {
       processArgs(argparser, headless);
@@ -496,8 +501,9 @@ public class Commands
                   .getFromSubValArgOrPrefWithSubstitutions(argParser, avm,
                           Arg.TEMPFAC, Position.AFTER, av, subVals, null,
                           null, null);
-          boolean notempfac = ArgParser.getBoolFromSubValOrArg(avm,
-                  Arg.NOTEMPFAC, subVals);
+          boolean notempfac = ArgParser.getFromSubValArgOrPref(avm,
+                  Arg.NOTEMPFAC, subVals, null, "ADD_TEMPFACT_ANN", false,
+                  true);
           TFType tft = notempfac ? null : TFType.DEFAULT;
           /*
           String tftString = subVals.get("tempfac");
@@ -553,17 +559,82 @@ public class Commands
             }
           }
 
-          boolean addTempFac = notempfac ? false
-                  : ((tft != null)
-                          || Cache.getDefault("ADD_TEMPFACT_ANN", false));
-
           // TODO use ssFromStructure
-          StructureChooser.openStructureFileForSequence(null, null, ap, seq,
-                  false, structureFilepath, tft, paeFilepath, false,
-                  ssFromStructure, false, viewerType);
+          StructureViewer sv = StructureChooser
+                  .openStructureFileForSequence(null, null, ap, seq, false,
+                          structureFilepath, tft, paeFilepath, false,
+                          ssFromStructure, false, viewerType);
 
-          String structureImage = ArgParser.getValueFromSubValOrArg(avm, av,
-                  Arg.STRUCTUREIMAGE, subVals);
+          if (headless)
+          {
+            sv.setAsync(false);
+          }
+
+          String structureImageFilename = ArgParser.getValueFromSubValOrArg(
+                  avm, av, Arg.STRUCTUREIMAGE, subVals);
+          if (sv != null && structureImageFilename != null)
+          {
+            ArgValue siAv = avm.getClosestNextArgValueOfArg(av,
+                    Arg.STRUCTUREIMAGE);
+            SubVals sisv = null;
+            if (structureImageFilename.equals(siAv.getValue()))
+            {
+              sisv = siAv.getSubVals();
+            }
+            File structureImageFile = new File(structureImageFilename);
+            String width = ArgParser.getValueFromSubValOrArg(avm, av,
+                    Arg.STRUCTUREIMAGEWIDTH, sisv);
+            String height = ArgParser.getValueFromSubValOrArg(avm, av,
+                    Arg.STRUCTUREIMAGEHEIGHT, sisv);
+            String scale = ArgParser.getValueFromSubValOrArg(avm, av,
+                    Arg.STRUCTUREIMAGESCALE, sisv);
+            String renderer = ArgParser.getValueFromSubValOrArg(avm, av,
+                    Arg.STRUCTUREIMAGETEXTRENDERER, sisv);
+            String typeS = ArgParser.getValueFromSubValOrArg(avm, av,
+                    Arg.STRUCTUREIMAGETYPE, sisv);
+            if (typeS == null || typeS.length() == 0)
+            {
+              typeS = FileUtils.getExtension(structureImageFile);
+            }
+            TYPE imageType;
+            try
+            {
+              imageType = Enum.valueOf(TYPE.class,
+                      typeS.toUpperCase(Locale.ROOT));
+            } catch (IllegalArgumentException e)
+            {
+              Console.warn("Do not know image format '" + typeS
+                      + "', using PNG");
+              imageType = TYPE.PNG;
+            }
+            BitmapImageSizing userBis = ImageMaker
+                    .parseScaleWidthHeightStrings(scale, width, height);
+            switch (StructureViewer.getViewerType())
+            {
+            case JMOL:
+              try
+              {
+                Thread.sleep(1000);
+              } catch (InterruptedException e)
+              {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+              }
+              JalviewStructureDisplayI sview = sv
+                      .getJalviewStructureDisplay();
+              if (sview instanceof AppJmol)
+              {
+                AppJmol jmol = (AppJmol) sview;
+                jmol.makePDBImage(structureImageFile, imageType, renderer,
+                        userBis);
+              }
+              break;
+            default:
+              Console.warn("Cannot export image for structure viewer "
+                      + sv.getViewerType() + " yet");
+              break;
+            }
+          }
         }
       }
     }
@@ -638,48 +709,14 @@ public class Commands
           renderer = "text";
         String type = "png"; // default
 
-        float bitmapscale = 0.0f;
-        int bitmapwidth = 0;
-        int bitmapheight = 0;
         String scale = ArgParser.getValueFromSubValOrArg(avm, av, Arg.SCALE,
                 subVal);
-        if (scale != null)
-        {
-          try
-          {
-            bitmapscale = Float.parseFloat(scale);
-          } catch (NumberFormatException e)
-          {
-            Console.warn("Did not understand scale '" + scale
-                    + "', won't be used.");
-          }
-        }
         String width = ArgParser.getValueFromSubValOrArg(avm, av, Arg.WIDTH,
                 subVal);
-        if (width != null)
-        {
-          try
-          {
-            bitmapwidth = Integer.parseInt(width);
-          } catch (NumberFormatException e)
-          {
-            Console.warn("Did not understand width '" + width
-                    + "', won't be used.");
-          }
-        }
         String height = ArgParser.getValueFromSubValOrArg(avm, av,
                 Arg.HEIGHT, subVal);
-        if (height != null)
-        {
-          try
-          {
-            bitmapheight = Integer.parseInt(height);
-          } catch (NumberFormatException e)
-          {
-            Console.warn("Did not understand height '" + height
-                    + "', won't be used.");
-          }
-        }
+        BitmapImageSizing userBis = ImageMaker
+                .parseScaleWidthHeightStrings(scale, width, height);
 
         type = ArgParser.getValueFromSubValOrArg(avm, av, Arg.TYPE, subVal);
         if (type == null && fileName != null)
@@ -708,7 +745,7 @@ public class Commands
 
         case "png":
           Console.debug("Outputting type '" + type + "' to " + fileName);
-          af.createPNG(file, null, bitmapscale, bitmapwidth, bitmapheight);
+          af.createPNG(file, null, userBis);
           break;
 
         case "html":
@@ -875,9 +912,15 @@ public class Commands
     SequenceI seq = null;
     if (subVals == null && idAv == null)
       return null;
+    if (af == null || af.getCurrentView() == null)
+    {
+      return null;
+    }
     AlignmentI al = af.getCurrentView().getAlignment();
     if (al == null)
+    {
       return null;
+    }
     if (subVals != null)
     {
       if (subVals.has(Arg.SEQID.getName()))
@@ -896,54 +939,4 @@ public class Commands
     }
     return seq;
   }
-
-  // returns the first Arg value intended for the structure structFilename
-  // (in the given AlignFrame from the ArgValuesMap)
-  private ArgValue getArgAssociatedWithStructure(Arg arg, ArgValuesMap avm,
-          AlignFrame af, String structFilename)
-  {
-    if (af != null)
-    {
-      for (ArgValue av : avm.getArgValueList(arg))
-      {
-        SubVals subVals = av.getSubVals();
-        String structid = subVals.get("structid");
-        String structfile = subVals.get("structfile");
-
-        // let's find a structure
-        if (structfile == null && structid == null)
-        {
-          ArgValue likelyStructure = avm.getClosestPreviousArgValueOfArg(av,
-                  Arg.STRUCTURE);
-          if (likelyStructure != null)
-          {
-            SubVals sv = likelyStructure.getSubVals();
-            if (sv != null && sv.has(ArgValues.ID))
-            {
-              structid = sv.get(ArgValues.ID);
-            }
-            else
-            {
-              structfile = likelyStructure.getValue();
-            }
-          }
-        }
-
-        if (structfile == null && structid != null)
-        {
-          StructureSelectionManager ssm = StructureSelectionManager
-                  .getStructureSelectionManager(Desktop.instance);
-          if (ssm != null)
-          {
-            structfile = ssm.findFileForPDBId(structid);
-          }
-        }
-        if (structfile != null && structfile.equals(structFilename))
-        {
-          return av;
-        }
-      }
-    }
-    return null;
-  }
 }
index 59382fd..615e318 100755 (executable)
@@ -774,7 +774,17 @@ public class Jalview
     {
       if (headlessArg)
       {
-        Jalview.exit("Successfully completed commands in headless mode", 0);
+        if (argparser.getBoolean(Arg.NOQUIT))
+        {
+          Console.warn(
+                  "Completed " + Arg.HEADLESS.getName() + " commands, but "
+                          + Arg.NOQUIT + " is set so not quitting!");
+        }
+        else
+        {
+          Jalview.exit("Successfully completed commands in headless mode",
+                  0);
+        }
       }
       Console.info("Successfully completed commands");
     }
@@ -1236,7 +1246,12 @@ public class Jalview
     }
     if (!lafSet)
     {
-      setSystemLookAndFeel();
+      // Flatlaf default for everyone!
+      lafSet = setFlatLookAndFeel();
+      if (!lafSet)
+      {
+        setSystemLookAndFeel();
+      }
       if (Platform.isLinux())
       {
         setLinuxLookAndFeel();
@@ -1433,6 +1448,8 @@ public class Jalview
       UIManager.put("TabbedPane.smoothScrolling", true);
       UIManager.put("TabbedPane.tabWidthMode", "compact");
       UIManager.put("TabbedPane.selectedBackground", Color.white);
+      UIManager.put("TabbedPane.background", new Color(236, 236, 236));
+      UIManager.put("TabbedPane.hoverColor", Color.lightGray);
     }
 
     Desktop.setLiveDragMode(Cache.getDefault("FLAT_LIVE_DRAG_MODE", true));
@@ -1470,6 +1487,7 @@ public class Jalview
     return set;
   }
 
+  /*
   private static void showUsage()
   {
     System.out.println(
@@ -1512,6 +1530,7 @@ public class Jalview
                     + "-jvmmemmax=MAXMEMORY\tOnly available with standalone executable jar or jalview.bin.Launcher. Limit maximum heap size (memory) to MAXMEMORY. MAXMEMORY can be specified in bytes, kilobytes(k), megabytes(m), gigabytes(g) or if you're lucky enough, terabytes(t). This defaults to 32g if total physical memory can be detected, or to 8g if total physical memory cannot be detected. See https://www.jalview.org/help/html/memory.html for more details.\n"
                     + "\n~Read documentation in Application or visit https://www.jalview.org for description of Features and Annotations file~\n\n");
   }
+  */
 
   private static void startUsageStats(final Desktop desktop)
   {
index f29e0a1..a87d322 100644 (file)
@@ -50,8 +50,28 @@ public class Launcher
 {
   private final static String startClass = "jalview.bin.Jalview";
 
-  private final static String dockIconPath = ChannelProperties
-          .getProperty("logo.512");
+  private static boolean checkJVMSymlink(String testBin)
+  {
+    File testBinFile = new File(testBin);
+    if (!testBinFile.exists())
+    {
+      return false;
+    }
+    File targetFile = null;
+    try
+    {
+      targetFile = testBinFile.getCanonicalFile();
+    } catch (IOException e)
+    {
+      return false;
+    }
+    if (targetFile != null && ("java".equals(targetFile.getName())
+            || "java.exe".equals(targetFile.getName())))
+    {
+      return true;
+    }
+    return false;
+  }
 
   /**
    * main method for jalview.bin.Launcher. This restarts the same JRE's JVM with
@@ -70,9 +90,22 @@ public class Launcher
               + ") may lead to problems. This installation of Jalview should be used with Java "
               + LaunchUtils.getJavaCompileVersion() + ".");
     }
-
-    final String javaBin = System.getProperty("java.home") + File.separator
-            + "bin" + File.separator + "java";
+    final String appName = ChannelProperties.getProperty("app_name");
+    final String javaBinDir = System.getProperty("java.home")
+            + File.separator + "bin" + File.separator;
+    String javaBin = null;
+    if (javaBin == null && checkJVMSymlink(javaBinDir + appName))
+    {
+      javaBin = javaBinDir + appName;
+    }
+    if (javaBin == null && checkJVMSymlink(javaBinDir + "Jalview"))
+    {
+      javaBin = javaBinDir + "Jalview";
+    }
+    if (javaBin == null)
+    {
+      javaBin = "java";
+    }
 
     List<String> command = new ArrayList<>();
     command.add(javaBin);
@@ -226,20 +259,21 @@ public class Launcher
     {
       if (!dockIcon)
       {
+        String dockIconPath = System.getProperty("getdownappdir", ".")
+                + File.separator + "resource/jalview_logo.png";
         command.add("-Xdock:icon=" + dockIconPath);
       }
       if (!dockName)
       {
         // -Xdock:name=... doesn't actually work :(
         // Leaving it in in case it gets fixed
-        command.add(
-                "-Xdock:name=" + ChannelProperties.getProperty("app_name"));
+        command.add("-Xdock:name=" + appName);
         // this launches WITHOUT an icon in the macOS dock. Could be useful for
         // getdown?
         // command.add("-Dapple.awt.UIElement=false");
         // This also does not work for the dock
         command.add("-Dcom.apple.mrj.application.apple.menu.about.name="
-                + ChannelProperties.getProperty("app_name"));
+                + appName);
       }
     }
 
index ae01c48..8bac623 100644 (file)
@@ -128,14 +128,10 @@ public enum Arg
                   + "none,\n" + "jmol,\n" + "chimera,\n" + "chimerax,\n"
                   + "pymol.",
           Opt.STRING, Opt.LINKED, Opt.MULTI),
-  STRUCTUREIMAGE(Type.STRUCTURE,
-          "Export an image of a 3D structure opened in JMOL", Opt.STRING,
-          Opt.LINKED, Opt.MULTI),
   NOTEMPFAC(Type.STRUCTURE,
           "Do not show the temperature factor annotation for the preceding --structure.",
           Opt.UNARY, Opt.LINKED, Opt.ALLOWALL, Opt.SECRET), // keep this secret
-                                                            // until it
-  // works!
+                                                            // until it works!
   SHOWSSANNOTATIONS(Type.STRUCTURE, null, Opt.BOOLEAN, Opt.LINKED,
           Opt.ALLOWALL),
 
@@ -146,11 +142,11 @@ public enum Arg
           Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
           Opt.REQUIREINPUT, Opt.OUTPUT, Opt.PRIMARY),
   TYPE(Type.IMAGE,
-          "Set the image format for the preceding --image to name. Valid values for name are: svg,\n"
-                  + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
+          "Set the image format for the preceding --image. Valid values are:\n"
+                  + "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
           Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
   TEXTRENDERER(Type.IMAGE,
-          "Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art. Possible values for name are:\n"
+          "Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art. Possible values are:\n"
                   + "text,\n" + "lineart.",
           Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
   SCALE(Type.IMAGE,
@@ -162,6 +158,27 @@ public enum Arg
   HEIGHT(Type.IMAGE,
           "Sets a height for bitmap image format (PNG) with the width maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --scale and --width then the smallest scaling will be used (scale, width and height provide bounds for the image).",
           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),
+  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.",
+          Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
+  STRUCTUREIMAGETEXTRENDERER(Type.STRUCTUREIMAGE,
+          "Sets whether text in a vector structure image format (SVG, EPS) should be rendered as text or vector line-art. Possible values are:\n"
+                  + "text,\n" + "lineart.",
+          Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
+  STRUCTUREIMAGESCALE(Type.STRUCTUREIMAGE,
+          "Sets a scaling for bitmap structure image format (PNG). Should be given as a floating point number. If used in conjunction with --structureimagewidth and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).",
+          Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
+  STRUCTUREIMAGEWIDTH(Type.STRUCTUREIMAGE,
+          "Sets a width for bitmap structure image format (PNG) with the height maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).",
+          Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
+  STRUCTUREIMAGEHEIGHT(Type.STRUCTUREIMAGE,
+          "Sets a height for bitmap structure image format (PNG) with the width maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimagewidth then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).",
+          Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
+
   OUTPUT(Type.OUTPUT,
           "Export the open alignment to file filename. The format name is specified by the subval modifier format=name, a following --format name argument or guessed from the file extension. Valid format names (and file extensions) are:\n"
                   + "fasta (fa, fasta, mfa, fastq),\n" + "pfam (pfam),\n"
@@ -224,6 +241,12 @@ public enum Arg
   QUIT(Type.FLOW,
           "After all files have been opened, appended and output, quit Jalview. In â€‘‑headless mode this already happens.",
           Opt.UNARY),
+  NOQUIT(Type.FLOW,
+          "Secret arg to not quit after --headless mode for tests",
+          Opt.UNARY, Opt.SECRET),
+  ALLSTRUCTURES(Type.FLOW,
+          "Apply the following 3D structure formatting arguments to all structures within the open alignment.",
+          Opt.BOOLEAN, Opt.MULTI, Opt.NOACTION),
 
   // secret options
   TESTOUTPUT(Type.CONFIG,
@@ -323,6 +346,7 @@ public enum Arg
     PROCESS("arguments used to process an alignment once opened"),
     OUTPUT("arguments used to save data from a processed alignment"),
     IMAGE("arguments used to export an image of an alignment"),
+    STRUCTUREIMAGE("arguments used to export an image of an structure"),
     FLOW("arguments that control processing of the other arguments"), //
     ALL("all arguments"), // mostly just a place-holder for --help-all
     NONE, // mostly a place-holder for --help
index 6d1251c..0a8b8d3 100644 (file)
@@ -121,6 +121,10 @@ public class ArgParser
   // or OPENED linkedIds
   private boolean openedLinkedIds = false;
 
+  // flag to say whether the structure arguments should be applied to all
+  // structures with this linked id
+  private boolean allStructures = false;
+
   protected static final Map<String, Arg> argMap;
 
   protected Map<String, ArgValuesMap> linkedArgs = new HashMap<>();
@@ -424,6 +428,10 @@ public class ArgParser
           openedLinkedIds = !negated;
           allLinkedIds = false;
         }
+        else if (a == Arg.ALLSTRUCTURES)
+        {
+          allStructures = !negated;
+        }
 
         if (a.hasOption(Opt.STORED))
         {
@@ -485,23 +493,26 @@ public class ArgParser
                       + arg);
             }
           }
-          else if (linkedId.contains(LINKEDIDAUTOCOUNTER))
-          {
-            // turn {n} to the autoCounter
-            autoCounterString = Integer.toString(linkedIdAutoCounter);
-            linkedId = linkedId.replace(LINKEDIDAUTOCOUNTER,
-                    autoCounterString);
-            Console.debug(
-                    "Changing linkedId to '" + linkedId + "' from " + arg);
-          }
-          else if (linkedId.contains(INCREMENTLINKEDIDAUTOCOUNTER))
+          else
           {
-            // turn {++n} to the incremented autoCounter
-            autoCounterString = Integer.toString(++linkedIdAutoCounter);
-            linkedId = linkedId.replace(INCREMENTLINKEDIDAUTOCOUNTER,
-                    autoCounterString);
-            Console.debug(
-                    "Changing linkedId to '" + linkedId + "' from " + arg);
+            if (linkedId.contains(LINKEDIDAUTOCOUNTER))
+            {
+              // turn {n} to the autoCounter
+              autoCounterString = Integer.toString(linkedIdAutoCounter);
+              linkedId = linkedId.replace(LINKEDIDAUTOCOUNTER,
+                      autoCounterString);
+              Console.debug("Changing linkedId to '" + linkedId + "' from "
+                      + arg);
+            }
+            if (linkedId.contains(INCREMENTLINKEDIDAUTOCOUNTER))
+            {
+              // turn {++n} to the incremented autoCounter
+              autoCounterString = Integer.toString(++linkedIdAutoCounter);
+              linkedId = linkedId.replace(INCREMENTLINKEDIDAUTOCOUNTER,
+                      autoCounterString);
+              Console.debug("Changing linkedId to '" + linkedId + "' from "
+                      + arg);
+            }
           }
         }
 
@@ -521,8 +532,9 @@ public class ArgParser
         }
 
         // check for unique id
-        SubVals idsv = new SubVals(val);
-        String id = idsv.get(ArgValues.ID);
+        SubVals subvals = new SubVals(val);
+        boolean addNewSubVals = false;
+        String id = subvals.get(ArgValues.ID);
         if (id != null && avm.hasId(a, id))
         {
           Console.error("Argument '" + a.argString()
@@ -530,10 +542,21 @@ public class ArgParser
           continue;
         }
 
-        /* TODO
-         * Change all avs.addValue() avs.setBoolean avs.setNegated() avs.incrementCount calls to checkfor linkedId == "*"
-         * DONE, need to check
-         */
+        // set allstructures to all non-primary structure options in this linked
+        // id if --allstructures has been set
+        if (allStructures
+                && (a.getType() == Type.STRUCTURE
+                        || a.getType() == Type.STRUCTUREIMAGE)
+                && !a.hasOption(Opt.PRIMARY))
+        {
+          if (!subvals.has(Arg.ALLSTRUCTURES.getName()))
+          // && !subvals.has("structureid"))
+          {
+            subvals.put(Arg.ALLSTRUCTURES.getName(), "true");
+            addNewSubVals = true;
+          }
+        }
+
         ArgValues avs = avm.getOrCreateArgValues(a);
 
         // store appropriate String value(s)
@@ -563,7 +586,9 @@ public class ArgParser
           }
           else
           {
-            addValue(linkedId, type, avs, val, argIndex, true);
+            // addValue(linkedId, type, avs, val, argIndex, true);
+            addValue(linkedId, type, avs, addNewSubVals ? subvals : null,
+                    val, argIndex, true);
           }
         }
         else if (a.hasOption(Opt.BOOLEAN))
@@ -925,8 +950,23 @@ public class ArgParser
       else if (pos == Position.AFTER
               && avm.getClosestNextArgValueOfArg(av, a) != null)
         value = avm.getClosestNextArgValueOfArg(av, a).getValue();
+
+      // look for allstructures subval for Type.STRUCTURE*
+      Arg arg = av.getArg();
+      if (value == null && arg.hasOption(Opt.PRIMARY)
+              && arg.getType() == Type.STRUCTURE
+              && !a.hasOption(Opt.PRIMARY) && (a.getType() == Type.STRUCTURE
+                      || a.getType() == Type.STRUCTUREIMAGE))
+      {
+        ArgValue av2 = avm.getArgValueOfArgWithSubValKey(a,
+                Arg.ALLSTRUCTURES.getName());
+        if (av2 != null)
+        {
+          value = av2.getValue();
+        }
+      }
     }
-    else
+    if (value == null)
     {
       value = pref != null ? Cache.getDefault(pref, def) : def;
     }
@@ -942,6 +982,13 @@ public class ArgParser
   public static boolean getFromSubValArgOrPref(ArgValuesMap avm, Arg a,
           SubVals sv, String key, String pref, boolean def)
   {
+    return getFromSubValArgOrPref(avm, a, sv, key, pref, def, false);
+  }
+
+  public static boolean getFromSubValArgOrPref(ArgValuesMap avm, Arg a,
+          SubVals sv, String key, String pref, boolean def,
+          boolean invertPref)
+  {
     if ((key == null && a == null) || (sv == null && a == null))
       return false;
 
@@ -995,7 +1042,8 @@ public class ArgParser
       return avm.getBoolean(a);
 
     // return preference or default
-    return pref != null ? Cache.getDefault(pref, def) : def;
+    boolean prefVal = pref != null ? Cache.getDefault(pref, def) : false;
+    return pref != null ? (invertPref ? !prefVal : prefVal) : def;
   }
 
   // the following methods look for the "*" linkedId and add the argvalue to all
@@ -1039,13 +1087,35 @@ public class ArgParser
     ADDVALUE, SETBOOLEAN, SETNEGATED, INCREMENTCOUNT
   }
 
-  // The following operations look for the "*" and "open*" linkedIds and add the
-  // argvalue to all appropriate linkedId ArgValues if it does.
-  // If subvals are supplied, they are inserted into all new set values.
   private void argValueOperation(Op op, String linkedId, Type type,
           ArgValues avs, SubVals sv, String v, boolean b, int argIndex,
           boolean doSubs)
   {
+    // default to merge subvals if subvals are provided
+    argValueOperation(op, linkedId, type, avs, sv, true, v, b, argIndex,
+            doSubs);
+  }
+
+  /*
+   * The following operations look for the "*" and "open*" linkedIds and add the
+   * argvalue to all appropriate linkedId ArgValues if it does.
+   * If subvals are supplied, they are inserted into all new set values.
+   * 
+   * @param op The ArgParser.Op operation
+   * @param linkedId The String linkedId from the ArgValuesMap
+   * @param type The Arg.Type to attach to this ArgValue
+   * @param avs The ArgValues for this linkedId
+   * @param sv Use these SubVals on the ArgValue
+   * @param merge Merge the SubVals with any existing on the value.  False will replace unless sv is null
+   * @param v The value of the ArgValue (may contain subvals).
+   * @param b The boolean value of the ArgValue.
+   * @param argIndex The argIndex for the ArgValue.
+   * @param doSubs Whether to perform substitutions on the subvals and value.
+   */
+  private void argValueOperation(Op op, String linkedId, Type type,
+          ArgValues avs, SubVals sv, boolean merge, String v, boolean b,
+          int argIndex, boolean doSubs)
+  {
     Arg a = avs.arg();
 
     List<String> wildcardLinkedIds = null;
@@ -1097,8 +1167,8 @@ public class ArgParser
           {
             if (doSubs)
             {
-              val = makeSubstitutions(v, id);
-              sv = new SubVals(sv, val);
+              sv = new SubVals(sv, val, merge);
+              val = makeSubstitutions(sv.getContent(), id);
             }
             tavs.addValue(sv, type, val, argIndex, true);
           }
index f76b757..3467f61 100644 (file)
@@ -19,8 +19,10 @@ public class ArgValue implements Comparable<ArgValue>
    */
   private Type type = null;
 
-  // This id is set by a subVal id= to identify the product of this ArgValue
-  // later. Set but not currently used.
+  /*
+   * This id is set by a subVal id= to identify the product of this ArgValue
+   * later. Set but not currently used.
+   */
   private String id;
 
   private SubVals subVals;
index 085099a..ab6fcc1 100644 (file)
@@ -120,6 +120,33 @@ public class ArgValuesMap
     return m.keySet();
   }
 
+  public ArgValue getArgValueOfArgWithSubValKey(Arg a, String svKey)
+  {
+    return getArgValueOfArgWithSubValKey(a, svKey, false);
+  }
+
+  public ArgValue getArgValueOfArgWithSubValKey(Arg a, String svKey,
+          boolean last)
+  {
+    ArgValues avs = this.getArgValues(a);
+    if (avs == null)
+    {
+      return null;
+    }
+    List<ArgValue> compareAvs = avs.getArgValueList();
+    for (int i = 0; i < compareAvs.size(); i++)
+    {
+      int index = last ? compareAvs.size() - 1 - i : i;
+      ArgValue av = compareAvs.get(index);
+      SubVals sv = av.getSubVals();
+      if (sv.has(svKey) && !sv.get(svKey).equals("false"))
+      {
+        return av;
+      }
+    }
+    return null;
+  }
+
   public ArgValue getClosestPreviousArgValueOfArg(ArgValue thisAv, Arg a)
   {
     ArgValue closestAv = null;
@@ -161,6 +188,7 @@ public class ArgValuesMap
     return closestAv;
   }
 
+  // TODO this is incomplete and currently unused (fortunately)
   public ArgValue[] getArgValuesReferringTo(String key, String value, Arg a)
   {
     // this looks for the *next* arg that *might* be referring back to
index a03ec15..4d146d9 100644 (file)
@@ -29,14 +29,42 @@ public class SubVals
 
   protected SubVals(SubVals sv, String c)
   {
-    if (sv == null)
+    this(sv, c, true);
+  }
+
+  protected SubVals(SubVals sv, String c, boolean merge)
+  {
+    SubVals subvals;
+    if (merge)
+    {
+      SubVals vsv = new SubVals(c);
+      if (sv != null && sv.getSubValMap() != null)
+      {
+        for (String key : sv.getSubValMap().keySet())
+        {
+          vsv.put(key, sv.get(key));
+        }
+      }
+      if (sv != null && sv.getIndex() > 0)
+      {
+        vsv.index = sv.getIndex();
+      }
+      subvals = vsv;
+    }
+    else
+    {
+      // replace
+      subvals = sv;
+    }
+    if (subvals == null)
     {
       this.subValMap = new HashMap<>();
     }
     else
     {
-      this.subValMap = sv == null ? new HashMap<>() : sv.getSubValMap();
-      this.index = sv.getIndex();
+      this.subValMap = subvals == null ? new HashMap<>()
+              : subvals.getSubValMap();
+      this.index = subvals.getIndex();
     }
     this.content = c;
   }
index a23cbfa..c776d82 100644 (file)
@@ -26,7 +26,6 @@ import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
-import java.util.concurrent.Callable;
 
 import javax.swing.JCheckBox;
 import javax.swing.JPanel;
@@ -120,7 +119,7 @@ public class AlignExportOptions extends JPanel
    * 
    * @param action
    */
-  public void setResponseAction(Object response, Callable action)
+  public void setResponseAction(Object response, Runnable action)
   {
     dialog.setResponseHandler(response, action);
   }
index 48927bb..77c0238 100644 (file)
@@ -59,7 +59,6 @@ import java.util.Hashtable;
 import java.util.List;
 import java.util.Locale;
 import java.util.Vector;
-import java.util.concurrent.Callable;
 
 import javax.swing.ButtonGroup;
 import javax.swing.JCheckBoxMenuItem;
@@ -152,6 +151,7 @@ import jalview.util.HttpUtils;
 import jalview.util.ImageMaker.TYPE;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
+import jalview.util.imagemaker.BitmapImageSizing;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.ViewportRanges;
 import jalview.ws.DBRefFetcher;
@@ -982,7 +982,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void setProgressBar(String message, long id)
   {
-    if (!Platform.isHeadless())
+    if (!Platform.isHeadless() && progressBar != null)
       progressBar.setProgressBar(message, id);
   }
 
@@ -990,7 +990,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public void registerHandler(final long id,
           final IProgressIndicatorHandler handler)
   {
-    progressBar.registerHandler(id, handler);
+    if (progressBar != null)
+      progressBar.registerHandler(id, handler);
   }
 
   /**
@@ -1000,7 +1001,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public boolean operationInProgress()
   {
-    return progressBar.operationInProgress();
+    return progressBar == null ? false : progressBar.operationInProgress();
   }
 
   /**
@@ -1278,11 +1279,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
-    Callable<Void> cancelAction = () -> {
+    Runnable cancelAction = () -> {
       lastSaveSuccessful = false;
-      return null;
     };
-    Callable<Void> outputAction = () -> {
+    Runnable outputAction = () -> {
       // todo defer this to inside formatSequences (or later)
       AlignmentExportData exportData = viewport.getAlignExportData(options);
       String output = new FormatAdapter(alignPanel, options)
@@ -1360,7 +1360,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           AlignFrame.this.getViewport().setSavedUpToDate(true);
         }
       }
-      return null;
     };
 
     /*
@@ -1378,7 +1377,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       try
       {
-        outputAction.call();
+        outputAction.run();
       } catch (Exception e)
       {
         // TODO Auto-generated catch block
@@ -1400,7 +1399,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     FileFormatI fileFormat = FileFormats.getInstance()
             .forName(fileFormatName);
     AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
-    Callable<Void> outputAction = () -> {
+    Runnable outputAction = () -> {
       // todo defer this to inside formatSequences (or later)
       AlignmentExportData exportData = viewport.getAlignExportData(options);
       CutAndPasteTransfer cap = new CutAndPasteTransfer();
@@ -1422,7 +1421,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 oom);
         cap.dispose();
       }
-      return null;
     };
 
     /*
@@ -1439,7 +1437,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       try
       {
-        outputAction.call();
+        outputAction.run();
       } catch (Exception e)
       {
         e.printStackTrace();
@@ -1481,14 +1479,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void createPNG(File f)
   {
-    createPNG(f, null, 0.0f, 0, 0);
+    createPNG(f, null, BitmapImageSizing.nullBitmapImageSizing());
   }
 
-  public void createPNG(File f, String renderer, float bitmapscale,
-          int bitmapwidth, int bitmapheight)
+  public void createPNG(File f, String renderer, BitmapImageSizing userBis)
   {
-    alignPanel.makeAlignmentImage(TYPE.PNG, f, renderer, bitmapscale,
-            bitmapwidth, bitmapheight);
+    alignPanel.makeAlignmentImage(TYPE.PNG, f, renderer, userBis);
   }
 
   /**
@@ -1572,7 +1568,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       String choice = chooser.getSelectedFile().getPath();
       Cache.setProperty("LAST_DIRECTORY", choice);
       loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
-      return null;
     });
 
     chooser.showOpenDialog(this);
@@ -2499,7 +2494,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       return;
     }
 
-    Callable okAction = () -> {
+    Runnable okAction = () -> {
       SequenceI[] cut = sg.getSequences()
               .toArray(new SequenceI[sg.getSize()]);
 
@@ -2523,7 +2518,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         {
         }
       }
-      return null;
     };
 
     /*
@@ -2549,7 +2543,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       try
       {
-        okAction.call();
+        okAction.run();
       } catch (Exception e)
       {
         e.printStackTrace();
@@ -4141,7 +4135,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .getString("label.possible_problem_with_tree_file"),
                 JvOptionPane.WARNING_MESSAGE);
       }
-      return null;
     });
     chooser.showOpenDialog(this);
   }
@@ -5989,7 +5982,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       Cache.setProperty("LAST_DIRECTORY", choice);
       SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
       new VCFLoader(choice).loadVCF(seqs, us);
-      return null;
     });
     chooser.showOpenDialog(null);
 
index 53dec93..5613f16 100644 (file)
@@ -810,13 +810,10 @@ public class AlignViewport extends AlignmentViewport
     JvOptionPane dialog = JvOptionPane.newOptionDialog(Desktop.desktop)
             .setResponseHandler(0, () -> {
               addDataToAlignment(al);
-              return null;
             }).setResponseHandler(1, () -> {
               us.openLinkedAlignmentAs(al, title, true);
-              return null;
             }).setResponseHandler(2, () -> {
               us.openLinkedAlignmentAs(al, title, false);
-              return null;
             });
     dialog.showDialog(question,
             MessageManager.getString("label.open_split_window"),
index a5a1aff..7befa20 100644 (file)
@@ -65,6 +65,7 @@ import jalview.structure.StructureSelectionManager;
 import jalview.util.Comparison;
 import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
+import jalview.util.imagemaker.BitmapImageSizing;
 import jalview.viewmodel.ViewportListenerI;
 import jalview.viewmodel.ViewportRanges;
 
@@ -1175,7 +1176,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer)
   {
-    makeAlignmentImage(type, file, renderer, 0.0f, 0, 0);
+    makeAlignmentImage(type, file, renderer,
+            BitmapImageSizing.nullBitmapImageSizing());
   }
 
   /**
@@ -1188,7 +1190,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    * @param bitmapscale
    */
   void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer,
-          float bitmapscale, int bitmapwidth, int bitmapheight)
+          BitmapImageSizing userBis)
   {
     final int borderBottomOffset = 5;
 
@@ -1219,7 +1221,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     int imageHeight = aDimension.getHeight() + borderBottomOffset;
     String of = MessageManager.getString("label.alignment");
     exporter.doExport(file, this, imageWidth, imageHeight, of, renderer,
-            bitmapscale, bitmapwidth, bitmapheight);
+            userBis);
   }
 
   /**
index 8930629..4148998 100755 (executable)
@@ -36,12 +36,10 @@ import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
 import java.awt.geom.AffineTransform;
-import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Locale;
-import java.util.concurrent.Callable;
 
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenuItem;
@@ -52,7 +50,6 @@ import javax.swing.ToolTipManager;
 
 import jalview.analysis.AlignSeq;
 import jalview.analysis.AlignmentUtils;
-import jalview.bin.Console;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
@@ -62,15 +59,11 @@ import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
-import jalview.io.DataSourceType;
 import jalview.io.FileFormat;
 import jalview.io.FormatAdapter;
-import jalview.io.NewickFile;
-import jalview.schemes.AnnotationColourGradient;
 import jalview.util.Comparison;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
-import jalview.ws.datamodel.alphafold.PAEContactMatrix;
 
 /**
  * The panel that holds the labels for alignment annotations, providing
@@ -315,7 +308,6 @@ public class AnnotationLabels extends JPanel
         ap.av.getAlignment().setAnnotationIndex(annotation, 0);
       }
       ap.refresh(true);
-      return null;
     });
   }
 
index 2447a2f..b7bac37 100644 (file)
  */
 package jalview.gui;
 
-import java.util.Locale;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
 import java.io.File;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.swing.JPanel;
@@ -43,15 +44,16 @@ import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
 import jalview.datamodel.StructureViewerModel;
 import jalview.datamodel.StructureViewerModel.StructureData;
-import jalview.fts.service.alphafold.AlphafoldRestClient;
 import jalview.gui.ImageExporter.ImageWriterI;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.structure.StructureCommand;
 import jalview.structures.models.AAStructureBindingModel;
 import jalview.util.BrowserLauncher;
 import jalview.util.ImageMaker;
+import jalview.util.ImageMaker.TYPE;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
+import jalview.util.imagemaker.BitmapImageSizing;
 
 public class AppJmol extends StructureViewerBase
 {
@@ -424,21 +426,50 @@ public class AppJmol extends StructureViewerBase
   @Override
   public void makePDBImage(ImageMaker.TYPE type)
   {
+    makePDBImage(null, type, null,
+            BitmapImageSizing.nullBitmapImageSizing());
+  }
+
+  public void makePDBImage(File file, ImageMaker.TYPE type, String renderer,
+          BitmapImageSizing userBis)
+  {
     int width = getWidth();
     int height = getHeight();
+
+    BitmapImageSizing bis = ImageMaker.getScaleWidthHeight(width, height,
+            userBis);
+    float usescale = bis.scale;
+    int usewidth = bis.width;
+    int useheight = bis.height;
+
     ImageWriterI writer = new ImageWriterI()
     {
       @Override
       public void exportImage(Graphics g) throws Exception
       {
-        jmb.jmolViewer.renderScreenImage(g, width, height);
+        Graphics2D ig2 = (Graphics2D) g;
+        ig2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_ON);
+        if (type == TYPE.PNG && usescale > 0.0f)
+        {
+          // for a scaled image, this scales down a bigger image to give the
+          // right resolution
+          if (usescale > 0.0f)
+          {
+            ig2.scale(1 / usescale, 1 / usescale);
+          }
+        }
+
+        jmb.jmolViewer.antialiased = true;
+        jmb.jmolViewer.requestRepaintAndWait("image export");
+        jmb.jmolViewer.renderScreenImage(ig2, usewidth, useheight);
       }
     };
     String view = MessageManager.getString("action.view")
             .toLowerCase(Locale.ROOT);
     ImageExporter exporter = new ImageExporter(writer,
             getProgressIndicator(), type, getTitle());
-    exporter.doExport(null, this, width, height, view);
+    exporter.doExport(file, this, width, height, view, renderer, userBis);
   }
 
   @Override
index fb3bbc0..8eebfc1 100644 (file)
@@ -64,7 +64,6 @@ import java.util.List;
 import java.util.ListIterator;
 import java.util.Locale;
 import java.util.Vector;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Semaphore;
@@ -442,6 +441,7 @@ public class Desktop extends jalview.jbgui.GDesktop
         System.err.println(
                 "Linux platform only! You may have the following warning next: \"WARNING: An illegal reflective access operation has occurred\"\nThis is expected and cannot be avoided, sorry about that.");
       }
+      final String awtAppClassName = "awtAppClassName";
       try
       {
         Toolkit xToolkit = Toolkit.getDefaultToolkit();
@@ -449,10 +449,10 @@ public class Desktop extends jalview.jbgui.GDesktop
         Field awtAppClassNameField = null;
 
         if (Arrays.stream(declaredFields)
-                .anyMatch(f -> f.getName().equals("awtAppClassName")))
+                .anyMatch(f -> f.getName().equals(awtAppClassName)))
         {
           awtAppClassNameField = xToolkit.getClass()
-                  .getDeclaredField("awtAppClassName");
+                  .getDeclaredField(awtAppClassName);
         }
 
         String title = ChannelProperties.getProperty("app_name");
@@ -463,11 +463,12 @@ public class Desktop extends jalview.jbgui.GDesktop
         }
         else
         {
-          jalview.bin.Console.debug("XToolkit: awtAppClassName not found");
+          jalview.bin.Console
+                  .debug("XToolkit: " + awtAppClassName + " not found");
         }
       } catch (Exception e)
       {
-        jalview.bin.Console.debug("Error setting awtAppClassName");
+        jalview.bin.Console.debug("Error setting " + awtAppClassName);
         jalview.bin.Console.trace(Cache.getStackTraceString(e));
       }
     }
@@ -1262,7 +1263,6 @@ public class Desktop extends jalview.jbgui.GDesktop
 
       new FileLoader().LoadFile(viewport, selectedFile, DataSourceType.FILE,
               format);
-      return null;
     });
     chooser.showOpenDialog(this);
   }
@@ -1318,7 +1318,7 @@ public class Desktop extends jalview.jbgui.GDesktop
 
     Object[] options = new Object[] { MessageManager.getString("action.ok"),
         MessageManager.getString("action.cancel") };
-    Callable<Void> action = () -> {
+    Runnable action = () -> {
       @SuppressWarnings("unchecked")
       String url = (history instanceof JTextField
               ? ((JTextField) history).getText()
@@ -1357,8 +1357,7 @@ public class Desktop extends jalview.jbgui.GDesktop
           JvOptionPane.showInternalMessageDialog(Desktop.desktop, msg,
                   MessageManager.getString("label.url_not_found"),
                   JvOptionPane.WARNING_MESSAGE);
-
-          return null; // Void
+          return;
         }
 
         if (viewport != null)
@@ -1371,7 +1370,6 @@ public class Desktop extends jalview.jbgui.GDesktop
           new FileLoader().LoadFile(url, DataSourceType.URL, format);
         }
       }
-      return null; // Void
     };
     String dialogOption = MessageManager
             .getString("label.input_alignment_from_url");
@@ -1410,7 +1408,7 @@ public class Desktop extends jalview.jbgui.GDesktop
 
   public QuitHandler.QResponse desktopQuit(boolean ui, boolean disposeFlag)
   {
-    final Callable<Void> doDesktopQuit = () -> {
+    final Runnable doDesktopQuit = () -> {
       Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
       Cache.setProperty("SCREENGEOMETRY_WIDTH", screen.width + "");
       Cache.setProperty("SCREENGEOMETRY_HEIGHT", screen.height + "");
@@ -1436,7 +1434,7 @@ public class Desktop extends jalview.jbgui.GDesktop
       if (QuitHandler.quitCancelled())
       {
         jalview.bin.Console.debug("Desktop aborting quit");
-        return null;
+        return;
       }
 
       if (dialogExecutor != null)
@@ -1465,8 +1463,6 @@ public class Desktop extends jalview.jbgui.GDesktop
         // instance.dispose();
       }
       instance.quit();
-
-      return null; // Void
     };
 
     return QuitHandler.getQuitResponse(ui, doDesktopQuit, doDesktopQuit,
@@ -1965,7 +1961,6 @@ public class Desktop extends jalview.jbgui.GDesktop
           }
         }
       }, "Project Loader").start();
-      return null;
     });
 
     chooser.showOpenDialog(this);
index ff0fe3a..4b8a1fd 100644 (file)
@@ -22,7 +22,6 @@ package jalview.gui;
 
 import java.awt.FlowLayout;
 import java.awt.Font;
-import java.util.concurrent.Callable;
 
 import javax.swing.BoxLayout;
 import javax.swing.JButton;
@@ -87,7 +86,7 @@ public class EditNameDialog
     panel.add(descriptionPanel);
 
     JLabel nameLabel = new JLabel(label1);
-    nameLabel.setFont(COURIER_12);
+    // nameLabel.setFont(COURIER_12);
     namePanel.add(nameLabel);
 
     id = new JTextField(name, 40);
@@ -101,7 +100,7 @@ public class EditNameDialog
     if (desc != null || label2 != null)
     {
       JLabel descLabel = new JLabel(label2);
-      descLabel.setFont(COURIER_12);
+      // descLabel.setFont(COURIER_12);
       descriptionPanel.add(descLabel);
       descriptionPanel.add(description);
     }
@@ -112,14 +111,24 @@ public class EditNameDialog
    * 
    * @param action
    */
-  public void showDialog(JComponent parent, String title, Callable action)
+  public void showDialog(JComponent parent, String title, Runnable action)
   {
-    Object[] options = new Object[] { MessageManager.getString("action.ok"),
-        MessageManager.getString("action.cancel") };
-    JvOptionPane.newOptionDialog(parent).setResponseHandler(0, action)
-            .showInternalDialog(panel, title,
-                    JvOptionPane.YES_NO_CANCEL_OPTION,
-                    JvOptionPane.PLAIN_MESSAGE, null, options,
-                    MessageManager.getString("action.ok"));
+    String ok = MessageManager.getString("action.ok");
+    String cancel = MessageManager.getString("action.cancel");
+    String[] options = new String[] { ok, cancel };
+
+    JvOptionPane.newOptionDialog(parent)
+            .setResponseHandler(JvOptionPane.OK_OPTION, action)
+            .showInternalDialog(panel, title, JvOptionPane.OK_CANCEL_OPTION,
+                    JvOptionPane.PLAIN_MESSAGE, null, options, ok);
+
+    /*
+    List<Runnable> actions = new ArrayList<>();
+    actions.add(action);
+    actions.add(JvOptionPane.NULLCALLABLE);
+    
+    JvOptionPane.frameDialog(panel, title, JvOptionPane.PLAIN_MESSAGE,
+            options, ok, actions, false);
+            */
   }
 }
index ba9da67..7117508 100644 (file)
@@ -33,7 +33,6 @@ import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Callable;
 
 import javax.swing.JComboBox;
 import javax.swing.JLabel;
@@ -428,9 +427,8 @@ public class FeatureEditor
    */
   public void showDialog()
   {
-    Callable<Void> okAction = forCreate ? getCreateAction()
-            : getAmendAction();
-    Callable<Void> cancelAction = getCancelAction();
+    Runnable okAction = forCreate ? getCreateAction() : getAmendAction();
+    Runnable cancelAction = getCancelAction();
 
     /*
      * set dialog action handlers for OK (create/Amend) and Cancel options
@@ -476,12 +474,11 @@ public class FeatureEditor
    * 
    * @return
    */
-  protected Callable getCancelAction()
+  protected Runnable getCancelAction()
   {
-    Callable<Void> okAction = () -> {
+    Runnable okAction = () -> {
       ap.highlightSearchResults(null);
       ap.paintAlignment(false, false);
-      return null;
     };
     return okAction;
   }
@@ -496,14 +493,14 @@ public class FeatureEditor
    * 
    * @return
    */
-  protected Callable getCreateAction()
+  protected Runnable getCreateAction()
   {
-    Callable<Void> okAction = new Callable()
+    Runnable okAction = new Runnable()
     {
       boolean useLastDefaults = features.get(0).getType() == null;
 
       @Override
-      public Void call()
+      public void run()
       {
         final String enteredType = name.getText().trim();
         final String enteredGroup = group.getText().trim();
@@ -543,7 +540,6 @@ public class FeatureEditor
 
           repaintPanel();
         }
-        return null;
       }
     };
     return okAction;
@@ -556,15 +552,14 @@ public class FeatureEditor
    * 
    * @return
    */
-  protected Callable getDeleteAction()
+  protected Runnable getDeleteAction()
   {
-    Callable<Void> deleteAction = () -> {
+    Runnable deleteAction = () -> {
       SequenceFeature sf = features.get(featureIndex);
       sequences.get(0).getDatasetSequence().deleteFeature(sf);
       fr.featuresAdded();
       ap.getSeqPanel().seqCanvas.highlightSearchResults(null);
       ap.paintAlignment(true, true);
-      return null;
     };
     return deleteAction;
   }
@@ -655,9 +650,9 @@ public class FeatureEditor
    * 
    * @return
    */
-  protected Callable getAmendAction()
+  protected Runnable getAmendAction()
   {
-    Callable<Void> okAction = new Callable()
+    Runnable okAction = new Runnable()
     {
       boolean useLastDefaults = features.get(0).getType() == null;
 
@@ -666,7 +661,7 @@ public class FeatureEditor
       String featureGroup = group.getText();
 
       @Override
-      public Void call()
+      public void run()
       {
         final String enteredType = name.getText().trim();
         final String enteredGroup = group.getText().trim();
@@ -729,7 +724,6 @@ public class FeatureEditor
           fr.featuresAdded();
         }
         repaintPanel();
-        return null;
       }
     };
     return okAction;
index 2c8f47a..2e9731d 100644 (file)
@@ -951,7 +951,6 @@ public class FeatureSettings extends JPanel
     chooser.setResponseHandler(0, () -> {
       File file = chooser.getSelectedFile();
       load(file);
-      return null;
     });
     chooser.showOpenDialog(this);
   }
index 785d206..32704d6 100644 (file)
@@ -23,7 +23,6 @@ package jalview.gui;
 import java.awt.Component;
 import java.awt.Graphics;
 import java.io.File;
-import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import jalview.bin.Cache;
@@ -34,6 +33,7 @@ import jalview.util.ImageMaker;
 import jalview.util.ImageMaker.TYPE;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
+import jalview.util.imagemaker.BitmapImageSizing;
 
 /**
  * A class that marshals steps in exporting a view in image graphics format
@@ -105,12 +105,12 @@ public class ImageExporter
   public void doExport(File file, Component parent, int width, int height,
           String imageSource)
   {
-    doExport(file, parent, width, height, imageSource, null, 0.0f, 0, 0);
+    doExport(file, parent, width, height, imageSource, null,
+            BitmapImageSizing.nullBitmapImageSizing());
   }
 
   public void doExport(File file, Component parent, int width, int height,
-          String imageSource, String renderer, float bitmapscale,
-          int bitmapwidth, int bitmapheight)
+          String imageSource, String renderer, BitmapImageSizing userBis)
   {
     final long messageId = System.currentTimeMillis();
     setStatus(
@@ -164,23 +164,16 @@ public class ImageExporter
             && !Jalview.isHeadlessMode())
     {
       final File chosenFile = file;
-      Callable<Void> okAction = () -> {
+      Runnable okAction = () -> {
         exportImage(chosenFile, !textSelected.get(), width, height,
-                messageId, bitmapscale, bitmapwidth, bitmapheight);
-        return null;
+                messageId, userBis);
       };
       LineartOptions epsOption = new LineartOptions(TYPE.EPS.getName(),
               textSelected);
-      epsOption.setResponseAction(1, new Callable<Void>()
-      {
-        @Override
-        public Void call()
-        {
-          setStatus(MessageManager.formatMessage(
-                  "status.cancelled_image_export_operation",
-                  imageType.getName()), messageId);
-          return null;
-        }
+      epsOption.setResponseAction(1, () -> {
+        setStatus(MessageManager.formatMessage(
+                "status.cancelled_image_export_operation",
+                imageType.getName()), messageId);
       });
       epsOption.setResponseAction(0, okAction);
       epsOption.showDialog();
@@ -193,7 +186,7 @@ public class ImageExporter
        * - just do the export
        */
       exportImage(file, !textSelected.get(), width, height, messageId,
-              bitmapscale, bitmapwidth, bitmapheight);
+              userBis);
     }
   }
 
@@ -209,8 +202,7 @@ public class ImageExporter
    * @param messageId
    */
   protected void exportImage(File chosenFile, boolean asLineart, int width,
-          int height, long messageId, float bitmapscale, int bitmapwidth,
-          int bitmapheight)
+          int height, long messageId, BitmapImageSizing userBis)
   {
     String type = imageType.getName();
     try
@@ -220,7 +212,7 @@ public class ImageExporter
       // "status.exporting_alignment_as_x_file", type),
       // messageId);
       ImageMaker im = new ImageMaker(imageType, width, height, chosenFile,
-              title, asLineart, bitmapscale, bitmapwidth, bitmapheight);
+              title, asLineart, userBis);
       imageWriter.exportImage(im.getGraphics());
       im.writeImage();
       setStatus(
index 020890b..c0efd4a 100644 (file)
@@ -41,7 +41,6 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -60,6 +59,7 @@ import javax.swing.event.InternalFrameListener;
 
 import jalview.bin.Console;
 import jalview.util.ChannelProperties;
+import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.util.dialogrunner.DialogRunnerI;
 
@@ -72,13 +72,16 @@ public class JvOptionPane extends JOptionPane
 
   private static boolean interactiveMode = true;
 
+  public static final Runnable NULLCALLABLE = () -> {
+  };
+
   private Component parentComponent;
 
   private ExecutorService executor = Executors.newCachedThreadPool();
 
   private JDialog dialog = null;
 
-  private Map<Object, Callable<Void>> callbacks = new HashMap<>();
+  private Map<Object, Runnable> callbacks = new HashMap<>();
 
   /*
    * JalviewJS reports user choice in the dialog as the selected option (text);
@@ -855,7 +858,7 @@ public class JvOptionPane extends JOptionPane
             initialValueButton = jb;
 
           int buttonAction = buttonActions[i];
-          Callable<Void> action = callbacks.get(buttonAction);
+          Runnable action = callbacks.get(buttonAction);
           jb.setText((String) o);
           jb.addActionListener(new ActionListener()
           {
@@ -884,7 +887,7 @@ public class JvOptionPane extends JOptionPane
               JOptionPane joptionpane = (JOptionPane) joptionpaneObject;
               joptionpane.setValue(buttonAction);
               if (action != null)
-                getExecutor().submit(action);
+                new Thread(action).start();
               joptionpane.transferFocusBackward();
               joptionpane.setVisible(false);
               // put focus and raise parent window if possible, unless cancel or
@@ -980,7 +983,7 @@ public class JvOptionPane extends JOptionPane
         {
           Object o = options[i];
           int buttonAction = buttonActions[i];
-          Callable<Void> action = callbacks.get(buttonAction);
+          Runnable action = callbacks.get(buttonAction);
           JButton jb = new JButton();
           jb.setText((String) o);
           jb.addActionListener(new ActionListener()
@@ -991,7 +994,7 @@ public class JvOptionPane extends JOptionPane
             {
               joptionpane.setValue(buttonAction);
               if (action != null)
-                getExecutor().submit(action);
+                new Thread(action).start();
               // joptionpane.transferFocusBackward();
               joptionpane.transferFocusBackward();
               joptionpane.setVisible(false);
@@ -1047,7 +1050,7 @@ public class JvOptionPane extends JOptionPane
     }
   }
 
-  public void showInternalDialog(JPanel mainPanel, String title,
+  public void showInternalDialog(Object mainPanel, String title,
           int yesNoCancelOption, int questionMessage, Icon icon,
           Object[] options, String initresponse)
   {
@@ -1065,7 +1068,6 @@ public class JvOptionPane extends JOptionPane
     this.setMessage(mainPanel);
 
     ourOptions = Arrays.asList(options);
-    int response;
     if (parentComponent != this
             && !(parentComponent == null && Desktop.instance == null))
     {
@@ -1149,25 +1151,16 @@ public class JvOptionPane extends JOptionPane
    * }
    */
   @Override
-  public JvOptionPane setResponseHandler(Object response,
-          Callable<Void> action)
+  public JvOptionPane setResponseHandler(Object response, Runnable action)
   {
+    if (action == null)
+    {
+      action = NULLCALLABLE;
+    }
     callbacks.put(response, action);
     return this;
   }
 
-  public ExecutorService getExecutor()
-  {
-    if (executor == null)
-      executor = Executors.newSingleThreadExecutor();
-    return executor;
-  }
-
-  public void setExecutor(ExecutorService es)
-  {
-    executor = es;
-  }
-
   public void setDialog(JDialog d)
   {
     dialog = d;
@@ -1311,12 +1304,12 @@ public class JvOptionPane extends JOptionPane
     {
       return;
     }
-    Callable<Void> action = callbacks.get(response);
+    Runnable action = callbacks.get(response);
     if (action != null)
     {
       try
       {
-        getExecutor().submit(action).get();
+        new Thread(action).start();
         // action.call();
       } catch (Exception e)
       {
@@ -1395,7 +1388,7 @@ public class JvOptionPane extends JOptionPane
       {
         Object o = options[i];
         int buttonAction = buttonActions[i];
-        Callable<Void> action = callbacks.get(buttonAction);
+        Runnable action = callbacks.get(buttonAction);
         JButton jb;
         if (buttons != null && buttons.length > i && buttons[i] != null)
         {
@@ -1413,7 +1406,7 @@ public class JvOptionPane extends JOptionPane
           {
             joptionpane.setValue(buttonAction);
             if (action != null)
-              getExecutor().submit(action);
+              new Thread(action).start();
             // joptionpane.transferFocusBackward();
             joptionpane.transferFocusBackward();
             joptionpane.setVisible(false);
@@ -1552,12 +1545,25 @@ public class JvOptionPane extends JOptionPane
     }
   }
 
-  public static JvOptionPane frameDialog(String message, String title,
-          int messageType, String[] buttonsText, String defaultButton,
-          Callable<Void>[] handlers, boolean modal)
+  public static JvOptionPane frameDialog(Object message, String title,
+          int messageType, String[] buttonsTextS, String defaultButtonS,
+          List<Runnable> handlers, boolean modal)
   {
     JFrame parent = new JFrame();
     JvOptionPane jvop = JvOptionPane.newOptionDialog();
+    final String[] buttonsText;
+    final String defaultButton;
+    if (buttonsTextS == null)
+    {
+      String ok = MessageManager.getString("action.ok");
+      buttonsText = new String[] { ok };
+      defaultButton = ok;
+    }
+    else
+    {
+      buttonsText = buttonsTextS;
+      defaultButton = defaultButtonS;
+    }
     JButton[] buttons = new JButton[buttonsText.length];
     for (int i = 0; i < buttonsText.length; i++)
     {
@@ -1581,22 +1587,28 @@ public class JvOptionPane extends JOptionPane
     {
       dialogType = JOptionPane.YES_NO_CANCEL_OPTION;
     }
-    jvop.setResponseHandler(JOptionPane.YES_OPTION, handlers[0]);
+    jvop.setResponseHandler(JOptionPane.YES_OPTION,
+            (handlers != null && handlers.size() > 0) ? handlers.get(0)
+                    : NULLCALLABLE);
     if (dialogType == JOptionPane.YES_NO_OPTION
             || dialogType == JOptionPane.YES_NO_CANCEL_OPTION)
     {
-      jvop.setResponseHandler(JOptionPane.NO_OPTION, handlers[1]);
+      jvop.setResponseHandler(JOptionPane.NO_OPTION,
+              (handlers != null && handlers.size() > 1) ? handlers.get(1)
+                      : NULLCALLABLE);
     }
     if (dialogType == JOptionPane.YES_NO_CANCEL_OPTION)
     {
-      jvop.setResponseHandler(JOptionPane.CANCEL_OPTION, handlers[2]);
+      jvop.setResponseHandler(JOptionPane.CANCEL_OPTION,
+              (handlers != null && handlers.size() > 2) ? handlers.get(2)
+                      : NULLCALLABLE);
     }
 
     final int dt = dialogType;
-    jvop.getExecutor().execute(() -> {
+    new Thread(() -> {
       jvop.showDialog(message, title, dt, messageType, null, buttonsText,
               defaultButton, modal, buttons);
-    });
+    }).start();
 
     return jvop;
   }
index ff4ff6a..2a96eb4 100644 (file)
@@ -23,7 +23,6 @@ package jalview.gui;
 import java.awt.FlowLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.swing.BorderFactory;
@@ -96,7 +95,7 @@ public class LineartOptions extends JPanel
    * 
    * @param action
    */
-  public void setResponseAction(Object response, Callable action)
+  public void setResponseAction(Object response, Runnable action)
   {
     dialog.setResponseHandler(response, action);
   }
index 1c03d6a..be9293f 100644 (file)
@@ -1990,7 +1990,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
               sg.setName(dialog.getName());
               sg.setDescription(dialog.getDescription());
               refresh();
-              return null;
             });
   }
 
@@ -2028,12 +2027,17 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
               {
                 if (dialog.getName().indexOf(" ") > -1)
                 {
-                  JvOptionPane.showMessageDialog(ap,
-                          MessageManager.getString(
-                                  "label.spaces_converted_to_underscores"),
-                          MessageManager.getString(
-                                  "label.no_spaces_allowed_sequence_name"),
-                          JvOptionPane.WARNING_MESSAGE);
+                  String ok = MessageManager.getString("action.ok");
+                  String cancel = MessageManager.getString("action.cancel");
+                  String message = MessageManager.getString(
+                          "label.spaces_converted_to_underscores");
+                  String title = MessageManager.getString(
+                          "label.no_spaces_allowed_sequence_name");
+                  Object[] options = new Object[] { ok, cancel };
+
+                  JvOptionPane.frameDialog(message, title,
+                          JvOptionPane.WARNING_MESSAGE, null, null, null,
+                          false);
                 }
                 sequence.setName(dialog.getName().replace(' ', '_'));
                 ap.paintAlignment(false, false);
@@ -2041,7 +2045,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
               sequence.setDescription(dialog.getDescription());
               ap.av.firePropertyChange("alignment", null,
                       ap.av.getAlignment().getSequences());
-              return null;
             });
   }
 
@@ -2276,7 +2279,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
                 ap.alignFrame.addHistoryItem(editCommand);
                 ap.av.firePropertyChange("alignment", null,
                         ap.av.getAlignment().getSequences());
-                return null;
               });
     }
   }
index 79723cf..5d628ff 100644 (file)
@@ -2,7 +2,6 @@ package jalview.gui;
 
 import java.io.File;
 import java.util.List;
-import java.util.concurrent.Callable;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -58,21 +57,18 @@ public class QuitHandler
   public static QResponse setQuitHandler()
   {
     FlatDesktop.setQuitHandler(response -> {
-      Callable<Void> performQuit = () -> {
+      Runnable performQuit = () -> {
         response.performQuit();
         setResponse(QResponse.QUIT);
-        return null;
       };
-      Callable<Void> performForceQuit = () -> {
+      Runnable performForceQuit = () -> {
         response.performQuit();
         setResponse(QResponse.FORCE_QUIT);
-        return null;
       };
-      Callable<Void> cancelQuit = () -> {
+      Runnable cancelQuit = () -> {
         response.cancelQuit();
         // reset
         setResponse(QResponse.NULL);
-        return null;
       };
       getQuitResponse(true, performQuit, performForceQuit, cancelQuit);
     });
@@ -93,25 +89,22 @@ public class QuitHandler
     return gotQuitResponse;
   }
 
-  public static final Callable<Void> defaultCancelQuit = () -> {
+  public static final Runnable defaultCancelQuit = () -> {
     Console.debug("QuitHandler: (default) Quit action CANCELLED by user");
     // reset
     setResponse(QResponse.CANCEL_QUIT);
-    return null;
   };
 
-  public static final Callable<Void> defaultOkQuit = () -> {
+  public static final Runnable defaultOkQuit = () -> {
     Console.debug("QuitHandler: (default) Quit action CONFIRMED by user");
     setResponse(QResponse.QUIT);
-    return null;
   };
 
-  public static final Callable<Void> defaultForceQuit = () -> {
+  public static final Runnable defaultForceQuit = () -> {
     Console.debug("QuitHandler: (default) Quit action FORCED by user");
     // note that shutdown hook will not be run
     Runtime.getRuntime().halt(0);
     setResponse(QResponse.FORCE_QUIT); // this line never reached!
-    return null;
   };
 
   public static QResponse getQuitResponse(boolean ui)
@@ -120,8 +113,8 @@ public class QuitHandler
             defaultCancelQuit);
   }
 
-  public static QResponse getQuitResponse(boolean ui, Callable<Void> okQuit,
-          Callable<Void> forceQuit, Callable<Void> cancelQuit)
+  public static QResponse getQuitResponse(boolean ui, Runnable okQuit,
+          Runnable forceQuit, Runnable cancelQuit)
   {
     QResponse got = gotQuitResponse();
     if (got != QResponse.NULL && got != QResponse.CANCEL_QUIT)
@@ -240,7 +233,7 @@ public class QuitHandler
       }
     }
 
-    Callable<Void> next = null;
+    Runnable next = null;
     switch (gotQuitResponse())
     {
     case QUIT:
@@ -281,9 +274,8 @@ public class QuitHandler
     return gotQuitResponse();
   }
 
-  private static QResponse waitQuit(boolean interactive,
-          Callable<Void> okQuit, Callable<Void> forceQuit,
-          Callable<Void> cancelQuit)
+  private static QResponse waitQuit(boolean interactive, Runnable okQuit,
+          Runnable forceQuit, Runnable cancelQuit)
   {
     // check for saves in progress
     if (!BackupFiles.hasSavesInProgress())
index 6c68ee6..6fce984 100644 (file)
@@ -33,7 +33,6 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.concurrent.Callable;
 import java.util.concurrent.Executors;
 
 import javax.swing.JCheckBox;
@@ -350,7 +349,7 @@ public class StructureChooser extends GStructureChooser
     };
 
     // fetch db refs if OK pressed
-    final Callable discoverCanonicalDBrefs = () -> {
+    final Runnable discoverCanonicalDBrefs = () -> {
       btn_queryTDB.setEnabled(false);
       populateSeqsWithoutSourceDBRef();
 
@@ -372,14 +371,12 @@ public class StructureChooser extends GStructureChooser
         // call finished action directly
         afterDbRefFetch.finished();
       }
-      return null;
     };
-    final Callable revertview = () -> {
+    final Runnable revertview = () -> {
       if (lastSelected != null)
       {
         cmb_filterOption.setSelectedItem(lastSelected);
       }
-      return null;
     };
     int threshold = Cache.getDefault("UNIPROT_AUTOFETCH_THRESHOLD",
             THRESHOLD_WARN_UNIPROT_FETCH_NEEDED);
@@ -1700,20 +1697,21 @@ public class StructureChooser extends GStructureChooser
   @Override
   public void setProgressBar(String message, long id)
   {
-    if (!Platform.isHeadless())
+    if (!Platform.isHeadless() && progressBar != null)
       progressBar.setProgressBar(message, id);
   }
 
   @Override
   public void registerHandler(long id, IProgressIndicatorHandler handler)
   {
-    progressBar.registerHandler(id, handler);
+    if (progressBar != null)
+      progressBar.registerHandler(id, handler);
   }
 
   @Override
   public boolean operationInProgress()
   {
-    return progressBar.operationInProgress();
+    return progressBar == null ? false : progressBar.operationInProgress();
   }
 
   public JalviewStructureDisplayI getOpenedStructureViewer()
@@ -1767,13 +1765,14 @@ public class StructureChooser extends GStructureChooser
             paeFilename, false, true, doXferSettings, null);
   }
 
-  public static void openStructureFileForSequence(
+  public static StructureViewer openStructureFileForSequence(
           StructureSelectionManager ssm, StructureChooser sc,
           AlignmentPanel ap, SequenceI seq, boolean prompt,
           String sFilename, TFType tft, String paeFilename,
           boolean forceHeadless, boolean showRefAnnotations,
           boolean doXferSettings, ViewerType viewerType)
   {
+    StructureViewer sv = null;
     boolean headless = forceHeadless;
     if (sc == null)
     {
@@ -1782,7 +1781,9 @@ public class StructureChooser extends GStructureChooser
       sc = new StructureChooser(new SequenceI[] { seq }, seq, ap, false);
     }
     if (ssm == null)
+    {
       ssm = ap.getStructureSelectionManager();
+    }
 
     PDBEntry fileEntry = new AssociatePdbFileWithSeq().associatePdbWithSeq(
             sFilename, DataSourceType.FILE, seq, prompt, Desktop.instance,
@@ -1791,15 +1792,18 @@ public class StructureChooser extends GStructureChooser
     // if headless, "false" in the sc constructor above will avoid GUI behaviour
     // in sc.launchStructureViewer()
     if (!headless && !(viewerType == null))
-      sc.launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, ap,
+    {
+      sv = sc.launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, ap,
               new SequenceI[]
               { seq }, viewerType);
+    }
 
-    if (headless)
-      sc.mainFrame.dispose();
+    sc.mainFrame.dispose();
 
     if (showRefAnnotations)
       showReferenceAnnotationsForSequence(ap.alignFrame, seq);
+
+    return sv;
   }
 
   public static void showReferenceAnnotationsForSequence(AlignFrame af,
index 0c12eb2..6cef665 100644 (file)
@@ -54,6 +54,16 @@ public class StructureViewer
    */
   private boolean superposeAdded = true;
 
+  /**
+   * whether to open structures in their own thread or not
+   */
+  private boolean async = true;
+
+  public void setAsync(boolean b)
+  {
+    async = b;
+  }
+
   public enum ViewerType
   {
     JMOL, CHIMERA, CHIMERAX, PYMOL
@@ -146,7 +156,8 @@ public class StructureViewer
     if (sview != null)
     {
       sview.setAlignAddedStructures(superposeAdded);
-      new Thread(new Runnable()
+
+      Runnable viewRunnable = new Runnable()
       {
         @Override
         public void run()
@@ -165,7 +176,15 @@ public class StructureViewer
 
           sview.updateTitleAndMenus();
         }
-      }).start();
+      };
+      if (async)
+      {
+        new Thread(viewRunnable).start();
+      }
+      else
+      {
+        viewRunnable.run();
+      }
       return sview;
     }
 
@@ -303,6 +322,11 @@ public class StructureViewer
 
   JalviewStructureDisplayI sview = null;
 
+  public JalviewStructureDisplayI getJalviewStructureDisplay()
+  {
+    return sview;
+  }
+
   public JalviewStructureDisplayI viewStructures(PDBEntry pdb,
           SequenceI[] seqsForPdb, AlignmentPanel ap)
   {
index e72a084..5bc6563 100644 (file)
@@ -27,7 +27,6 @@ import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.concurrent.Callable;
 
 import javax.swing.BorderFactory;
 import javax.swing.JLabel;
@@ -152,10 +151,9 @@ public class TextColourChooser
         MessageManager.getString("action.cancel") };
     String title = MessageManager
             .getString("label.adjust_foreground_text_colour_threshold");
-    Callable<Void> action = () -> // response for 1 = Cancel
+    Runnable action = () -> // response for 1 = Cancel
     {
       restoreInitialSettings();
-      return null;
     };
     JvOptionPane.newOptionDialog(alignPanel.alignFrame)
             .setResponseHandler(1, action).showInternalDialog(bigpanel,
index 298b8b4..14f9adf 100755 (executable)
@@ -686,7 +686,6 @@ public class UserDefinedColours extends GUserDefinedColours
       }
 
       addNewColourScheme(choice.getPath());
-      return null;
     });
 
     chooser.showOpenDialog(this);
index c5ce35b..7b661f3 100644 (file)
@@ -26,7 +26,6 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Locale;
-import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.jfree.graphics2d.svg.SVGGraphics2D;
@@ -221,9 +220,8 @@ public class HtmlSvgOutput extends HTMLOutput
       /*
        * configure the action to run on OK in the dialog
        */
-      Callable<Void> okAction = () -> {
+      Runnable okAction = () -> {
         doOutput(textOption.get());
-        return null;
       };
 
       /*
@@ -237,7 +235,6 @@ public class HtmlSvgOutput extends HTMLOutput
           setProgressMessage(MessageManager.formatMessage(
                   "status.cancelled_image_export_operation",
                   getDescription()));
-          return null;
         });
         svgOption.setResponseAction(0, okAction);
         svgOption.showDialog();
index 3b6e325..cb47610 100755 (executable)
 //////////////////////////////////////////////////////////////////
 package jalview.io;
 
-import jalview.bin.Cache;
-import jalview.gui.JvOptionPane;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-import jalview.util.dialogrunner.DialogRunnerI;
-
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.EventQueue;
@@ -44,7 +38,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.Vector;
-import java.util.concurrent.Callable;
 
 import javax.swing.BoxLayout;
 import javax.swing.DefaultListCellRenderer;
@@ -80,7 +73,7 @@ public class JalviewFileChooser extends JFileChooser
 {
   private static final long serialVersionUID = 1L;
 
-  private Map<Object, Callable> callbacks = new HashMap<>();
+  private Map<Object, Runnable> callbacks = new HashMap<>();
 
   File selectedFile = null;
 
@@ -628,7 +621,7 @@ public class JalviewFileChooser extends JFileChooser
   */
 
   @Override
-  public DialogRunnerI setResponseHandler(Object response, Callable action)
+  public DialogRunnerI setResponseHandler(Object response, Runnable action)
   {
     callbacks.put(response, action);
     return this;
@@ -644,12 +637,12 @@ public class JalviewFileChooser extends JFileChooser
     {
       return;
     }
-    Callable action = callbacks.get(response);
+    Runnable action = callbacks.get(response);
     if (action != null)
     {
       try
       {
-        action.call();
+        action.run();
       } catch (Exception e)
       {
         e.printStackTrace();
index 016feee..3306b0d 100755 (executable)
@@ -34,7 +34,9 @@ import org.jfree.graphics2d.svg.SVGGraphics2D;
 import org.jfree.graphics2d.svg.SVGHints;
 import org.jibble.epsgraphics.EpsGraphics2D;
 
+import jalview.bin.Console;
 import jalview.io.JalviewFileChooser;
+import jalview.util.imagemaker.BitmapImageSizing;
 
 public class ImageMaker
 {
@@ -114,8 +116,8 @@ public class ImageMaker
    * @throws IOException
    */
   public ImageMaker(TYPE imageType, int width, int height, File file,
-          String fileTitle, boolean useLineart, float bitmapscale,
-          int bitmapwidth, int bitmapheight) throws IOException
+          String fileTitle, boolean useLineart, BitmapImageSizing userBis)
+          throws IOException
   {
     this.type = imageType;
 
@@ -129,7 +131,7 @@ public class ImageMaker
       setupEPS(width, height, fileTitle, useLineart);
       break;
     case PNG:
-      setupPNG(width, height, bitmapscale, bitmapwidth, bitmapheight);
+      setupPNG(width, height, userBis);
       break;
     default:
     }
@@ -180,50 +182,26 @@ public class ImageMaker
    * @param height
    * @param scale
    */
-  protected void setupPNG(int width, int height, float scale,
-          int bitmapwidth, int bitmapheight)
+  protected void setupPNG(int width, int height, BitmapImageSizing userBis)
   {
     if (width == 0 || height == 0)
       return;
 
-    float usescale = 0.0f;
-    int usewidth = width;
-    int useheight = height;
+    BitmapImageSizing bis = ImageMaker.getScaleWidthHeight(width, height,
+            userBis);
+    float usescale = bis.scale;
+    int usewidth = bis.width;
+    int useheight = bis.height;
 
-    // use the smallest positive scale (i.e. fit in the box)
-    if (scale > 0.0f)
-    {
-      usescale = scale;
-      usewidth = Math.round(scale * width);
-      useheight = Math.round(scale * height);
-    }
-    if (bitmapwidth > 0)
-    {
-      float wscale = (float) bitmapwidth / width;
-      if (wscale > 0.0f && (usescale == 0.0f || wscale < usescale))
-      {
-        usescale = wscale;
-        usewidth = bitmapwidth;
-        useheight = Math.round(usescale * height);
-      }
-    }
-    if (bitmapheight > 0)
-    {
-      float hscale = (float) bitmapheight / height;
-      if (hscale > 0.0f && (usescale == 0.0f || hscale < usescale))
-      {
-        usescale = hscale;
-        usewidth = Math.round(usescale * width);
-        useheight = bitmapheight;
-      }
-    }
     bi = new BufferedImage(usewidth, useheight, BufferedImage.TYPE_INT_RGB);
     graphics = bi.getGraphics();
     Graphics2D ig2 = (Graphics2D) graphics;
     ig2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
             RenderingHints.VALUE_ANTIALIAS_ON);
     if (usescale > 0.0f)
+    {
       ig2.scale(usescale, usescale);
+    }
   }
 
   /**
@@ -267,4 +245,120 @@ public class ImageMaker
     pg.setAccurateTextMode(useLineart);
     graphics = pg;
   }
+
+  /**
+   * Takes suggested float scale, int width, int height and create a bounding
+   * box returned as a BitmapImageSizing object with consistent scale, width,
+   * height fields.
+   * 
+   * @param scale
+   * @param bitmapwidth
+   * @param bitmapheight
+   * @return BitmapImageSizing
+   */
+  public static BitmapImageSizing getScaleWidthHeight(int width, int height,
+          float scale, int bitmapwidth, int bitmapheight)
+  {
+    float usescale = 0.0f;
+    int usewidth = width;
+    int useheight = height;
+
+    // use the smallest positive scale (i.e. fit in the box)
+    if (scale > 0.0f)
+    {
+      usescale = scale;
+      usewidth = Math.round(scale * width);
+      useheight = Math.round(scale * height);
+    }
+    if (bitmapwidth > 0)
+    {
+      float wscale = (float) bitmapwidth / width;
+      if (wscale > 0.0f && (usescale == 0.0f || wscale < usescale))
+      {
+        usescale = wscale;
+        usewidth = bitmapwidth;
+        useheight = Math.round(usescale * height);
+      }
+    }
+    if (bitmapheight > 0)
+    {
+      float hscale = (float) bitmapheight / height;
+      if (hscale > 0.0f && (usescale == 0.0f || hscale < usescale))
+      {
+        usescale = hscale;
+        usewidth = Math.round(usescale * width);
+        useheight = bitmapheight;
+      }
+    }
+    return new BitmapImageSizing(usescale, usewidth, useheight);
+  }
+
+  /**
+   * Takes suggested scale, width, height as a BitmapImageSizing object and
+   * create a bounding box returned as a BitmapImageSizing object with
+   * consistent scale, width, height fields.
+   * 
+   * @param bis
+   * @return BitmapImageSizing
+   */
+  public static BitmapImageSizing getScaleWidthHeight(int width, int height,
+          BitmapImageSizing bis)
+  {
+    return ImageMaker.getScaleWidthHeight(width, height, bis.scale,
+            bis.width, bis.height);
+  }
+
+  /**
+   * Takes String versions of suggested float scale, int width, int height and
+   * create a bounding box returned as a BitmapImageSizing object with
+   * consistent scale, width, height fields.
+   * 
+   * @param scaleS
+   * @param widthS
+   * @param heightS
+   * @return BitmapImageSizing
+   */
+  public static BitmapImageSizing parseScaleWidthHeightStrings(
+          String scaleS, String widthS, String heightS)
+  {
+    float scale = 0.0f;
+    int width = 0;
+    int height = 0;
+
+    if (scaleS != null)
+    {
+      try
+      {
+        scale = Float.parseFloat(scaleS);
+      } catch (NumberFormatException e)
+      {
+        Console.warn("Did not understand scale '" + scaleS
+                + "', won't be used.");
+      }
+    }
+    if (widthS != null)
+    {
+      try
+      {
+        width = Integer.parseInt(widthS);
+      } catch (NumberFormatException e)
+      {
+        Console.warn("Did not understand width '" + widthS
+                + "', won't be used.");
+      }
+    }
+    if (heightS != null)
+    {
+      try
+      {
+        height = Integer.parseInt(heightS);
+      } catch (NumberFormatException e)
+      {
+        Console.warn("Did not understand height '" + heightS
+                + "', won't be used.");
+      }
+    }
+
+    return new BitmapImageSizing(scale, width, height);
+  }
 }
index 1fc41e7..ce96bad 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.util.dialogrunner;
 
-import java.util.concurrent.Callable;
-
 /**
  * An interface for blocking dialog response handling. This is motivated by
  * JalviewJS - when running as Javascript, there is only a single thread, and
@@ -43,7 +41,7 @@ public interface DialogRunnerI
    * @param action
    * @return
    */
-  DialogRunnerI setResponseHandler(Object response, Callable<Void> action);
+  DialogRunnerI setResponseHandler(Object response, Runnable action);
 
   // DialogRunnerI setResponseHandler(Object response, Runnable action);
 
diff --git a/src/jalview/util/imagemaker/BitmapImageSizing.java b/src/jalview/util/imagemaker/BitmapImageSizing.java
new file mode 100644 (file)
index 0000000..312b834
--- /dev/null
@@ -0,0 +1,22 @@
+package jalview.util.imagemaker;
+
+public class BitmapImageSizing
+{
+  public final float scale;
+
+  public final int width;
+
+  public final int height;
+
+  public BitmapImageSizing(float scale, int width, int height)
+  {
+    this.scale = scale;
+    this.width = width;
+    this.height = height;
+  }
+
+  public static BitmapImageSizing nullBitmapImageSizing()
+  {
+    return new BitmapImageSizing(0.0f, 0, 0);
+  }
+}
index 20ccd11..7ed1ea3 100644 (file)
@@ -105,6 +105,34 @@ public class CommandsTest
             lookForSequenceName("THIS_SEQUENCE_ID_DOESN'T_EXIST"));
   }
 
+  @Test(groups = "Functional", dataProvider = "structureImageOutputFiles")
+  public void structureImageOutputTest(String cmdLine, String[] filenames)
+          throws IOException
+  {
+    cleanupFiles(filenames);
+    String[] args = cmdLine.split("\\s+");
+    Jalview.main(args);
+    Commands cmds = Jalview.getInstance().getCommands();
+    Assert.assertNotNull(cmds);
+    File lastFile = null;
+    for (String filename : filenames)
+    {
+      File file = new File(filename);
+      Assert.assertTrue(file.exists(), "File '" + filename
+              + "' was not created by '" + cmdLine + "'");
+      Assert.assertTrue(file.isFile(), "File '" + filename
+              + "' is not a file from '" + cmdLine + "'");
+      Assert.assertTrue(Files.size(file.toPath()) > 0, "File '" + filename
+              + "' has no content from '" + cmdLine + "'");
+      // make sure the successive output files get bigger!
+      if (lastFile != null)
+        Assert.assertTrue(
+                Files.size(file.toPath()) > Files.size(lastFile.toPath()));
+    }
+    cleanupFiles(filenames);
+    tearDown();
+  }
+
   @Test(groups = "Functional", dataProvider = "argfileOutputFiles")
   public void argFilesGlobAndSubstitutionsTest(String cmdLine,
           String[] filenames) throws IOException
@@ -133,6 +161,48 @@ public class CommandsTest
     tearDown();
   }
 
+  @DataProvider(name = "structureImageOutputFiles")
+  public Object[][] structureImageOutputFiles()
+  {
+    return new Object[][] {
+        //
+        { "--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 "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--structureimage=" + testfiles
+                + "/structureimage2.png --structureimagescale=1.5"
+                + "--open=./examples/test_fab41.result/sample.a2m "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--structureimage=" + testfiles
+                + "/structureimage3.png --structureimagescale=2.0",
+            new String[]
+            { testfiles + "/structureimage1.png",
+                testfiles + "/structureimage2.png",
+                testfiles + "/structureimage3.png" } },
+        /*
+        { "--headless --noquit --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 "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--structureimage=" + testfiles
+                + "/structureimage2.png --structureimagescale=1.5"
+                + "--open=./examples/test_fab41.result/sample.a2m "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--structureimage=" + testfiles
+                + "/structureimage3.png --structureimagescale=2.0",
+            new String[]
+            { testfiles + "/structureimage1.png",
+                testfiles + "/structureimage2.png",
+                testfiles + "/structureimage3.png" } },
+                */
+        //
+    };
+
+  }
+
   @DataProvider(name = "argfileOutputFiles")
   public Object[][] argfileOutputFiles()
   {
index bd63232..a31b77d 100644 (file)
@@ -131,8 +131,7 @@ public class CommandsTest2
       String cmdLine,
       int seqNum,
       int annNum,
-      int viewerNum,
-      String propsFile
+      int structureViewerNum,
      */
     return new Object[][] {
         //
@@ -182,6 +181,20 @@ public class CommandsTest2
             16, 19, 3 },
         { "--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 "
+                + "--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 "
+                + "--allstructures "
+                + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+                + "--noallstructures " + "--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, 2 },
         /*
          */
         //
index bc2be78..ca63e44 100644 (file)
@@ -184,9 +184,12 @@ public class ArgParserTest
   @DataProvider(name = "argSubValsAndLinkedIds")
   public Object[][] argSubValsAndLinkedIds()
   {
-    return new Object[][] { {
-        "--debug --append=[hi]test/jalview/bin/argparser/testfiles/test1.fa",
-        "JALVIEW:0", Arg.APPEND, "hi", "true", true },
+    return new Object[][] {
+        //
+        /*
+         */
+        { "--debug --append=[hi]test/jalview/bin/argparser/testfiles/test1.fa",
+            "JALVIEW:0", Arg.APPEND, "hi", "true", true },
         { "--append[linkedId1]=[new,hello=world,1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
             "linkedId1", Arg.APPEND, "new", "true", true },
         { "--append[linkedId2]=[new,hello=world,1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
@@ -198,7 +201,11 @@ public class ArgParserTest
         { "--append[linkedId5]=[new,hello=worlddomination,1]test/jalview/bin/argparser/testfiles/test1.fa --append[linkedId2]=[new;hello=world;1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
             "linkedId5", Arg.APPEND, "hello", "world", false },
         { "--append[linkedId6]=[new,hello=world,0]test/jalview/bin/argparser/testfiles/test1.fa --append[linkedId7]=[new;hello=world;1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
-            "linkedId7", Arg.APPEND, "GETINDEX", "0", false }, };
+            "linkedId7", Arg.APPEND, "GETINDEX", "0", false },
+        /*
+         */
+        //
+    };
   }
 
   @DataProvider(name = "argAutoIndexAndSubstitutions")
index 42df90e..b19f160 100644 (file)
@@ -281,7 +281,6 @@ public class QuitHandlerTest
               jalview.bin.Console.debug(
                       "Setting FORCE_QUIT without actually quitting");
               QuitHandler.setResponse(QResponse.FORCE_QUIT);
-              return null;
             }, QuitHandler.defaultCancelQuit);
     long end = System.currentTimeMillis();
 
index 65998bc..1098010 100755 (executable)
@@ -80,9 +80,9 @@ $CONSOLEWIDTH = $Host.UI.RawUI.WindowSize.Width
 
 # quote the args and the command (in case of spaces) with escape chars (`) and precede with & to indicate command not string
 if ( $myArgs.count -eq 0 ) {
-  Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher"
+  Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" `"-Dgetdownappdir=${APPDIR}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher"
 } else {
   $myArgsString = '"' + $($myArgs -join '" "') + '"'
-  Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher ${myArgsString}"
+  Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" `"-Dgetdownappdir=${APPDIR}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher ${myArgsString}"
 }
 
index 62da28c..9e3a8c7 100755 (executable)
@@ -65,7 +65,8 @@ CLASSPATH=""
 declare -a JARPATHS=()
 if [ -e "${GETDOWNTXT}" ]; then
   # always check grep and sed regexes on macos -- they're not the same
-  for JAR in $(grep -e '^code\s*=\s*' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
+for JAR in $(grep -e '^code[[:space:]]*=[[:space:]]*' "${GETDOWNTXT}" | while read -r line; do echo $line | sed -E -e 's/code[[:space:]]*=[[:space:]]*//;'; done);
+  do
     [ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH}:"
     CLASSPATH="${CLASSPATH}${APPDIR}/${JAR}"
     JARPATHS=( "${JARPATHS[@]}" "${APPDIR}/${JAR}" )
@@ -122,6 +123,7 @@ elif command -v resize 2>&1 >/dev/null; then
   COLUMNS=$(resize -u | grep COLUMNS= | sed -e 's/.*=//;s/;//') 2>/dev/null
 fi
 JVMARGS=( "${JVMARGS[@]}" "-DCONSOLEWIDTH=${COLUMNS}" )
+JVMARGS=( "${JVMARGS[@]}" "-Dgetdownappdir=${APPDIR}" )
 
 # Is there a bundled Java?  If not just try one in the PATH (do need .exe in WSL)
 if [ \! -e "${JAVA}" ]; then
index 46feaed..3bc98ae 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<install4j version="10.0.4" transformSequenceNumber="10">
-  <directoryPresets config="bin/jalview" />
+<install4j version="10.0.5" transformSequenceNumber="10">
+  <directoryPresets config="bin/Jalview" />
   <application name="${compiler:JALVIEW_APPLICATION_NAME}" applicationId="${compiler:WINDOWS_APPLICATION_ID}" mediaDir="${compiler:BUILD_DIR}" lzmaCompression="true" shortName="${compiler:INTERNAL_ID}" publisher="University of Dundee" publisherWeb="https://www.jalview.org/" version="${compiler:JALVIEW_VERSION}" allPathsRelative="true" macVolumeId="5aac4968c304f65" javaMinVersion="${compiler:JAVA_MIN_VERSION}" javaMaxVersion="${compiler:JAVA_MAX_VERSION}" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
     <searchSequence>
       <directory location="${compiler:JRE_DIR}" />
       <variable name="APPLICATION_CATEGORIES" value="Science;Biology;Java;" />
       <variable name="APPLICATION_FOLDER" value="Jalview" />
       <variable name="UNIX_APPLICATION_FOLDER" value="jalview" />
-      <variable name="EXECUTABLE_NAME" value="jalview" />
+      <variable name="EXECUTABLE_NAME" value="jalviewg" />
       <variable name="EXTRA_SCHEME" value="jalviewx" />
       <variable name="MAC_ICONS_FILE" value="utils/channels/release/images/jalview_logo.icns" />
       <variable name="WINDOWS_ICONS_FILE" value="utils/channels/release/images/jalview_logo.ico" />
       <variable name="PNG_ICON_FILE" value="utils/channels/release/images/jalview_logo.png" />
       <variable name="BACKGROUND" value="utils/channels/release/images/jalview_logo_background_fade-640x480.png" />
+      <variable name="BATCH_WRAPPER_SCRIPT" value="jalview.bat" />
+      <variable name="POWERSHELL_WRAPPER_SCRIPT" value="jalview.ps1" />
     </variables>
     <codeSigning macEnabled="true" macPkcs12File="${compiler:OSX_KEYSTORE}" macNotarize="true" appleId="${compiler:OSX_APPLEID}">
       <macAdditionalBinaries>
           <versionLine x="85" y="109" text="version ${compiler:sys.version}" />
         </text>
       </splashScreen>
-      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Dinstaller_template_version=${compiler:INSTALLER_TEMPLATE_VERSION}" arguments="&quot;${launcher:sys.launcherDirectory}&quot; jalview">
+      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Dinstaller_template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dchannel.app_name=&quot;${compiler:JALVIEW_APPLICATION_NAME}&quot;" arguments="&quot;${launcher:sys.launcherDirectory}&quot; jalview">
         <classPath>
           <archive location="getdown-launcher.jar" />
           <archive location="${compiler:GETDOWN_INSTALL_DIR}/getdown-launcher.jar" failOnError="false" />
@@ -472,7 +474,7 @@ return console.askOkCancel(message, true);
           </screen>
           <screen id="15" beanClass="com.install4j.runtime.beans.screens.InstallationScreen" rollbackBarrier="true" rollbackBarrierExitCode="0">
             <actions>
-              <action id="17" beanClass="com.install4j.runtime.beans.actions.InstallFilesAction" actionElevationType="elevated" rollbackBarrierExitCode="0" failureStrategy="quit" errorMessage="${i18n:FileCorrupted}" />
+              <action id="17" beanClass="com.install4j.runtime.beans.actions.InstallFilesAction" rollbackBarrierExitCode="0" failureStrategy="quit" errorMessage="${i18n:FileCorrupted}" />
               <action name="Create program group (RELEASE)" id="18" customizedId="PROGRAM_GROUP_RELEASE" beanClass="com.install4j.runtime.beans.actions.desktop.CreateProgramGroupAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                 <serializedBean>
                   <property name="allUsers" type="boolean" value="false" />
@@ -593,6 +595,38 @@ return console.askOkCancel(message, true);
           </screen>
           <screen id="20" beanClass="com.install4j.runtime.beans.screens.FinishedScreen" rollbackBarrierExitCode="0" finishScreen="true">
             <actions>
+              <action name="Linux Jalview Appname-&gt;java symlink" id="2813" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
+                <serializedBean>
+                  <property name="file">
+                    <object class="java.io.File">
+                      <string>${compiler:JRE_DIR}/bin/java</string>
+                    </object>
+                  </property>
+                  <property name="linkFile">
+                    <object class="java.io.File">
+                      <string>${compiler:JRE_DIR}/bin/${compiler:JALVIEW_APPLICATION_NAME}</string>
+                    </object>
+                  </property>
+                  <property name="removeOnUninstall" type="boolean" value="false" />
+                </serializedBean>
+                <condition>Util.isLinux()</condition>
+              </action>
+              <action name="Linux Jalview-&gt;java symlink" id="2814" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
+                <serializedBean>
+                  <property name="file">
+                    <object class="java.io.File">
+                      <string>${compiler:JRE_DIR}/bin/java</string>
+                    </object>
+                  </property>
+                  <property name="linkFile">
+                    <object class="java.io.File">
+                      <string>${compiler:JRE_DIR}/bin/${compiler:JALVIEW_NAME}</string>
+                    </object>
+                  </property>
+                  <property name="removeOnUninstall" type="boolean" value="false" />
+                </serializedBean>
+                <condition>Util.isLinux()</condition>
+              </action>
               <action id="2012" beanClass="com.install4j.runtime.beans.actions.desktop.CreateStartMenuEntryAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                 <serializedBean>
                   <property name="allUsers" type="boolean" value="false" />
@@ -650,7 +684,7 @@ return console.askOkCancel(message, true);
                 </serializedBean>
                 <condition>context.getBooleanVariable("addToDockAction")</condition>
               </action>
-              <action name="Linux/Unix symlink" id="2733" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
+              <action name="Linux/Unix symlink" id="2733" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" rollbackBarrierExitCode="0" errorMessage="Could not make symlink to wrapper script">
                 <serializedBean>
                   <property name="file">
                     <object class="java.io.File">
@@ -673,7 +707,7 @@ return console.askOkCancel(message, true);
                 </serializedBean>
                 <condition>context.getBooleanVariable("appendToPathAction")</condition>
               </action>
-              <action name="Create Linux/Unix symbolic link to jalview.sh in user's local bin" id="2739" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}">
+              <action name="Create Linux/Unix symbolic link to jalview.sh in user's local bin" id="2739" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" rollbackBarrierExitCode="0" errorMessage="Could not make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}">
                 <serializedBean>
                   <property name="file">
                     <object class="java.io.File">
@@ -688,7 +722,7 @@ return console.askOkCancel(message, true);
                 </serializedBean>
                 <condition>context.getBooleanVariable("makeSymbolicLinkAction") &amp;&amp; ( Util.isLinux() || Util.isUnixInstaller() ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null )</condition>
               </action>
-              <action name="Create macOS symbolic link to jalview in user's local bin" id="2743" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}">
+              <action name="Create macOS symbolic link to jalview in user's local bin" id="2743" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" rollbackBarrierExitCode="0" errorMessage="Could not make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}">
                 <serializedBean>
                   <property name="file">
                     <object class="java.io.File">
@@ -703,6 +737,40 @@ return console.askOkCancel(message, true);
                 </serializedBean>
                 <condition>context.getBooleanVariable("makeSymbolicLinkAction") &amp;&amp; Util.isMacOS() &amp;&amp; ( context.getVariable("unixUserBinDir") != null ) &amp;&amp; ( context.getVariable("macWrapperLinkLocation") != null )</condition>
               </action>
+              <action name="Windows copy BAT file" id="2817" beanClass="com.install4j.runtime.beans.actions.files.CopyFileAction" rollbackBarrierExitCode="0">
+                <serializedBean>
+                  <property name="destinationFile">
+                    <object class="java.io.File">
+                      <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}.bat</string>
+                    </object>
+                  </property>
+                  <property name="files" type="array" class="java.io.File" length="1">
+                    <element index="0">
+                      <object class="java.io.File">
+                        <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BATCH_WRAPPER_SCRIPT}</string>
+                      </object>
+                    </element>
+                  </property>
+                </serializedBean>
+                <condition>Util.isWindows() &amp;&amp; !(((String)context.getCompilerVariable("WRAPPER_LINK")+".bat").equals((String)context.getCompilerVariable("BATCH_WRAPPER_SCRIPT")))</condition>
+              </action>
+              <action name="Windows copy PS1 file" id="2818" beanClass="com.install4j.runtime.beans.actions.files.CopyFileAction" rollbackBarrierExitCode="0">
+                <serializedBean>
+                  <property name="destinationFile">
+                    <object class="java.io.File">
+                      <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK}.ps1</string>
+                    </object>
+                  </property>
+                  <property name="files" type="array" class="java.io.File" length="1">
+                    <element index="0">
+                      <object class="java.io.File">
+                        <string>${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:POWERSHELL_WRAPPER_SCRIPT}</string>
+                      </object>
+                    </element>
+                  </property>
+                </serializedBean>
+                <condition>Util.isWindows() &amp;&amp; !(((String)context.getCompilerVariable("WRAPPER_LINK")+".ps1").equals((String)context.getCompilerVariable("POWERSHELL_WRAPPER_SCRIPT")))</condition>
+              </action>
             </actions>
             <formComponents>
               <formComponent id="21" beanClass="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent" insetBottom="10">
@@ -844,13 +912,13 @@ return console.askYesNo(message, true);
                   <property name="progressChangeType" type="enum" class="com.install4j.runtime.beans.actions.control.ProgressChangeType" value="SET_INDETERMINATE" />
                 </serializedBean>
               </action>
-              <action id="29" beanClass="com.install4j.runtime.beans.actions.UninstallFilesAction" actionElevationType="elevated" rollbackBarrierExitCode="0" />
+              <action id="29" beanClass="com.install4j.runtime.beans.actions.UninstallFilesAction" rollbackBarrierExitCode="0" />
               <action id="660" beanClass="com.install4j.runtime.beans.actions.control.SetProgressAction" enabled="false" actionElevationType="none" rollbackBarrierExitCode="0">
                 <serializedBean>
                   <property name="percentValue" type="int" value="95" />
                 </serializedBean>
               </action>
-              <action id="1525" beanClass="com.install4j.runtime.beans.actions.files.DeleteFileAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
+              <action id="1525" beanClass="com.install4j.runtime.beans.actions.files.DeleteFileAction" rollbackBarrierExitCode="0">
                 <serializedBean>
                   <property name="files" type="array" class="java.io.File" length="40">
                     <element index="0">
@@ -1422,6 +1490,8 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
         <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
         <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/jvl_file.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/jvl_file.icns" />
         <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/MacOS/${compiler:WRAPPER_LINK}" target="../Resources/app/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT}" />
+        <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_APPLICATION_NAME}" target="java" />
+        <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_NAME}" target="java" />
       </topLevelFiles>
     </macosArchive>
     <macosArchive name="macOS aarch64 Disk Image" id="2796" customizedId="MACOS-AARCH64-DMG" mediaFileName="${compiler:APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-aarch64-java_${compiler:JAVA_INTEGER_VERSION}" volumeName="${compiler:INSTALLER_NAME}" architecture="aarch64" launcherId="737" setupAppId="2746">
@@ -1437,6 +1507,8 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
         <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
         <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/jvl_file.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/jvl_file.icns" />
         <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/MacOS/${compiler:WRAPPER_LINK}" target="../Resources/app/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT}" />
+        <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_APPLICATION_NAME}" target="java" />
+        <symlink name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/jre/Contents/Home/bin/${compiler:JALVIEW_NAME}" target="java" />
       </topLevelFiles>
     </macosArchive>
     <unixInstaller name="Linux x64 Shell Installer" id="1595" customizedId="LINUX-X64-SH" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-linux-x64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">