'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,
-1.8.3-1.2.13_FJVL
+1.8.3-1.2.14_FJVL
-1.8.3-1.2.13_JVL
+1.8.3-1.2.14_JVL
<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>
<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>
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;
}
+/*
+ * 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
{
public static int scale = 0;
+ public final static int MAX_SCALE = 8;
+
private static boolean doneInit = false;
private static boolean allowScalePropertyArg = false;
// 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);
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 ("
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);
*/
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
* @author bsoares
*
*/
-import java.util.Locale;
-
public class MemorySetting
{
public static final String MAX_HEAPSIZE_PERCENT_PROPERTY_NAME = "jvmmempc";
public static String memoryLongToString(long mem)
{
- return memoryLongToString(mem, "%.1f");
+ return memoryLongToString(mem, "%.3f");
}
public static String memoryLongToString(long mem, String format)
return ADJUSTMENT_MESSAGE;
}
-}
\ No newline at end of file
+}
+/*
+ * 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;
+/*
+ * 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;
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();
+/*
+ * 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
{
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;
+ }
}
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
{
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);
}
/**
}
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;
+ }
}
<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>
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
<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>
<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"/>
<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"/>
<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>
<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/>
<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>
<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>
+++ /dev/null
-<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>
* 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">
--- /dev/null
+<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>‑‑help / -h</code>
+ </td>
+ <td>Display a help statement.</td>
+ </tr>
+
+ <tr valign="top"><td><code>‑‑help‑config</code></td><td>Help for arguments used to configure Jalview from startup</td></tr>
+ <tr valign="top"><td><code>‑‑help‑opening</code></td><td>Help for arguments used to open and format alignments</td></tr>
+ <tr valign="top"><td><code>‑‑help‑structure</code></td><td>Help for arguments used to add and format 3D structure data</td></tr>
+ <tr valign="top"><td><code>‑‑help‑process</code></td><td>Help for arguments used to process an alignment once opened</td></tr>
+ <tr valign="top"><td><code>‑‑help‑output</code></td><td>Help for arguments used to save data from a processed alignment</td></tr>
+ <tr valign="top"><td><code>‑‑help‑image</code></td><td>Help for arguments used to export an image of an alignment</td></tr>
+ <tr valign="top"><td><code>‑‑help‑structureimage</code></td><td>Help for arguments used to export an image of an structure</td></tr>
+ <tr valign="top"><td><code>‑‑help‑flow</code></td><td>Help for arguments that control processing of the other arguments</td></tr>
+ <tr valign="top"><td><code>‑‑help‑all</code></td><td>Help for all arguments</td></tr>
+
+ <tr valign="top">
+ <td><code>‑‑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>‑‑jabaws <em>URL</em></code></td>
+ <td>Set a different URL to connect to a JABAWS server.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑news / ‑‑nonews</code></td>
+ <td>Show (or don't show) the news feed.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑splash / ‑‑nosplash</code></td>
+ <td>Show (or don't show) the About Jalview splash screen.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑questionnaire / ‑‑noquestionnaire</code></td>
+ <td>Show (or don't show) the questionnaire if one is available.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑usagestats / ‑‑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>‑‑webservicediscovery / ‑‑nowebservicediscovery</code></td>
+ <td>Attempt (or don't attempt) to connect to JABAWS web services.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑props <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>‑‑debug</code></td>
+ <td>Start Jalview in debug log level.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑quiet</code></td>
+ <td>Stop all output to STDOUT (after the Java Virtual Machine has started). Use <code>‑‑quiet</code> a second time to stop all output to STDERR.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑initsubstitutions / ‑‑noinitsubstitutions</code></td>
+ <td>Set <code>‑‑substitutions</code> to be initially enabled (or initially disabled).</td>
+ </tr>
+
+<!--
+ <tr valign="top">
+ <td><code>‑‑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>‑‑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>‑‑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>‑‑open <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑append <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑title <em>"string""</em></code></td>
+ <td>Specifies the title for the open alignment window as <em>string</em>.</td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑colour <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑features <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">✓</td>
+ </tr>
+
+
+
+ <tr valign="top">
+ <td><code>‑‑tree <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑sortbytree / ‑‑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">✓</td>
+ </tr>
+
+
+ <tr valign="top">
+ <td><code>‑‑annotations <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑showannotations / ‑‑noshowannotations</code></td>
+ <td>Enforces showing (or not showing) alignment annotations.</td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑wrap / ‑‑nowrap</code></td>
+ <td>Enforces wrapped (or not wrapped) alignment formatting.</td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑nostructure</code></td>
+ <td>Do not open or process any 3D structure in the <code>‑‑open</code> or <code>‑‑append</code> files.</td>
+ <td></td>
+ <td align="center">✓</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>‑‑structure <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>‑‑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">✓</td>
+ </tr>
+
+
+ <tr valign="top">
+ <td><code>‑‑seqid <em>ID</em></code></td>
+ <td>Specify the sequence name for the preceding <code>‑‑structure</code> to be associated with.</td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+
+ <tr valign="top">
+ <td><code>‑‑paematrix <em>filename</em></code></td>
+ <td>Add a PAE json matrix file <em>filename</em> to the preceding <code>‑‑structure</code>.</td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+
+ <tr valign="top">
+ <td><code>‑‑tempfac <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">✓</td>
+ </tr>
+
+
+ <tr valign="top">
+ <td><code>‑‑structureviewer <em>name</em></code></td>
+ <td>Set the structure viewer to use to open the 3d structure file specified in previous <code>‑‑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">✓</td>
+ </tr>
+
+
+ <!--
+ <tr valign="top">
+ <td><code>‑‑notempfac</code></td>
+ <td>Do not show the temperature factor annotation for the preceding <code>‑‑structure</code></td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+ -->
+
+
+ <tr valign="top">
+ <td><code>‑‑showssannotations / ‑‑noshowssannotations</code></td>
+ <td>Do not show secondary structure annotations for the preceding <code>‑‑structure</code></td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑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>‑‑output</code> and <code>‑‑image</code> files, use after <code>‑‑all</code>.</td>
+ <td></td>
+ <td align="center">✓</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>‑‑groovy <em>filename</em></code></td>
+ <td>Process a groovy script in the file for the open alignment.</td>
+ <td></td>
+ <td align="center">✓</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>‑‑output <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>‑‑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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑format <em>name</em></code></td>
+ <td>Sets the format for the preceding <code>‑‑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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑backups / ‑‑nobackups</code></td>
+ <td>Enable (or disable) writing backup files when saving an <code>‑‑output</code> file. This applies to the current open alignment -- to apply to all <code>‑‑output</code> and <code>‑‑image</code> files, use after <code>‑‑all</code>.</td>
+ <td></td>
+ <td align="center">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑overwrite / ‑‑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>‑‑output</code> and <code>‑‑image</code> files, use after <code>‑‑all</code>.</td>
+ <td></td>
+ <td align="center">✓</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>‑‑image <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>‑‑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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑type <em>name</em></code></td>
+ <td>Set the image format for the preceding <code>‑‑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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑textrenderer <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑scale <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑width <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑height <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑groovy <em>filename</em></code></td>
+ <td>Process a groovy script in the file for the open alignment.</td>
+ <td></td>
+ <td align="center">✓</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>‑‑structureimage <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑structureimagetype <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑structureimagetextrenderer <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑structureimagescale <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑structureimagewidth <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">✓</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑structureimageheight <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">✓</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>‑‑new</code></td>
+ <td>
+ Move on to a new alignment window. This will ensure <code>‑‑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>‑‑substitutions / ‑‑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>‑‑open</code>ed file (or first <code>‑‑append</code>ed file),
+ <br/>
+ <code>{dirname}</code>, - the directory (folder) name of the currently <code>‑‑open</code>ed file (or first <code>‑‑append</code>ed file),
+ <br/>
+ <code>{argfilebasename}</code> - the filename-without-extension of the current <code>‑‑argfile</code>,
+ <br/>
+ <code>{argfiledirname}</code> - the directory (folder) name of the current <code>‑‑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>‑‑argfile <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>‑‑argfile</code> arguments then all other non-initialising arguments will be ignored.
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑npp</code></td>
+ <td>Increase the index counter used in argument value substitutions.</td>
+ </tr>
+
+ <tr valign="top">
+ <td><code>‑‑all / ‑‑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>‑‑allstructures / ‑‑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>‑‑quit</code></td>
+ <td>After all files have been opened, appended and output, quit Jalview. In <code>‑‑headless</code> mode this already happens.</td>
+ </tr>
+
+ </table>
+
+</body>
+</html>
* 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>‑‑help / -h</code></td>
- <td>Display a help statement</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑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>‑‑jabaws <em>URL</em></code></td>
- <td>Set a different URL to connect to a JABAWS server.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑news / ‑‑nonews</code></td>
- <td>Show (or don't show) the news feed.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑splash / ‑‑nosplash</code></td>
- <td>Show (or don't show) the About Jalview splash screen.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑questionnaire / ‑‑noquestionnaire</code></td>
- <td>Show (or don't show) the questionnaire if one is available.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑usagestats / ‑‑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>‑‑webservicediscovery / ‑‑nowebservicediscovery</code></td>
- <td>Attempt (or don't attempt) to connect to JABAWS web services.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑props <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>‑‑debug</code></td>
- <td>Start Jalview in debug log level.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑quiet</code></td>
- <td>Stop all output to STDOUT (after the Java Virtual Machine has started). Use <code>‑‑quiet</code> a second time to stop all output to STDERR.</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑initsubstitutions / ‑‑noinitsubstitutions</code></td>
- <td>Set <code>‑‑substitutions</code> to be initially enabled (or initially disabled).</td>
- </tr>
-
-<!--
- <tr valign="top">
- <td><code>‑‑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>‑‑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>‑‑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>‑‑open <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑append <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑title <em>"string""</em></code></td>
- <td>Specifies the title for the open alignment window as <em>string</em>.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑colour <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑features <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">✓</td>
- </tr>
-
-
-
- <tr valign="top">
- <td><code>‑‑tree <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑sortbytree / ‑‑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">✓</td>
- </tr>
-
-
- <tr valign="top">
- <td><code>‑‑annotations <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑showannotations / ‑‑noshowannotations</code></td>
- <td>Enforces showing (or not showing) alignment annotations.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑wrap / ‑‑nowrap</code></td>
- <td>Enforces wrapped (or not wrapped) alignment formatting.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑nostructure</code></td>
- <td>Do not open or process any 3D structure in the <code>‑‑open</code> or <code>‑‑append</code> files.</td>
- <td></td>
- <td align="center">✓</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>‑‑structure <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>‑‑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">✓</td>
- </tr>
-
-
- <tr valign="top">
- <td><code>‑‑seqid <em>ID</em></code></td>
- <td>Specify the sequence name for the preceding <code>‑‑structure</code> to be associated with.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
-
-
- <tr valign="top">
- <td><code>‑‑paematrix <em>filename</em></code></td>
- <td>Add a PAE json matrix file <em>filename</em> to the preceding <code>‑‑structure</code>.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
-
-
- <tr valign="top">
- <td><code>‑‑tempfac <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">✓</td>
- </tr>
-
-
- <tr valign="top">
- <td><code>‑‑structureviewer <em>name</em></code></td>
- <td>Set the structure viewer to use to open the 3d structure file specified in previous <code>‑‑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">✓</td>
- </tr>
-
-
- <!--
- <tr valign="top">
- <td><code>‑‑notempfac</code></td>
- <td>Do not show the temperature factor annotation for the preceding <code>‑‑structure</code></td>
- <td></td>
- <td align="center">✓</td>
- </tr>
- -->
-
-
- <tr valign="top">
- <td><code>‑‑showssannotations / ‑‑noshowssannotations</code></td>
- <td>Do not show secondary structure annotations for the preceding <code>‑‑structure</code></td>
- <td></td>
- <td align="center">✓</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>‑‑output <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>‑‑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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑format <em>name</em></code></td>
- <td>Sets the format for the preceding <code>‑‑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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑image <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>‑‑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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑type <em>name</em></code></td>
- <td>Set the image format for the preceding <code>‑‑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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑textrenderer <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑scale <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑width <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">✓</td>
- </tr>
-
- <tr valign="top">
- <td><code>‑‑height <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">✓</td>
- </tr>
+ <hr/>
- <tr valign="top">
- <td><code>‑‑groovy <em>filename</em></code></td>
- <td>Process a groovy script in the file for the open alignment.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
+ <ul>
+ <li><a href="#introduction">Introduction</a></li>
+ <li><a href="#syntax">Syntax</a></li>
+ </ul>
- <tr valign="top">
- <td><code>‑‑backups / ‑‑nobackups</code></td>
- <td>Enable (or disable) writing backup files when saving an <code>‑‑output</code> file. This applies to the current open alignment -- to apply to all <code>‑‑output</code> and <code>‑‑image</code> files, use after <code>‑‑all</code>.</td>
- <td></td>
- <td align="center">✓</td>
- </tr>
+ <h2><a name="introduction"></a>Introduction</h2>
- <tr valign="top">
- <td><code>‑‑overwrite / ‑‑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>‑‑output</code> and <code>‑‑image</code> files, use after <code>‑‑all</code>.</td>
- <td></td>
- <td align="center">✓</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>‑‑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>‑‑output</code> and <code>‑‑image</code> files, use after <code>‑‑all</code>.</td>
- <td></td>
- <td align="center">✓</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>‑‑new</code></td>
- <td>
- Move on to a new alignment window. This will ensure <code>‑‑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>‑‑substitutions / ‑‑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>‑‑open</code>ed file (or first <code>‑‑append</code>ed file),
- <br/>
- <code>{dirname}</code>, - the directory (folder) name of the currently <code>‑‑open</code>ed file (or first <code>‑‑append</code>ed file),
- <br/>
- <code>{argfilebasename}</code> - the filename-without-extension of the current <code>‑‑argfile</code>,
- <br/>
- <code>{argfiledirname}</code> - the directory (folder) name of the current <code>‑‑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>‑‑argfile <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>‑‑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>‑‑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>‑‑all / ‑‑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>‑‑quit</code></td>
- <td>After all files have been opened, appended and output, quit Jalview. In <code>‑‑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>
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."
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.
*/
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;
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
{
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;
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;
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
{
argParser = argparser;
headless = h;
desktop = d;
- afMap = new HashMap<String, AlignFrame>();
+ afMap = new HashMap<>();
if (argparser != null)
{
processArgs(argparser, headless);
.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");
}
}
- 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;
+ }
+ }
}
}
}
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)
case "png":
Console.debug("Outputting type '" + type + "' to " + fileName);
- af.createPNG(file, null, bitmapscale, bitmapwidth, bitmapheight);
+ af.createPNG(file, null, userBis);
break;
case "html":
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()))
}
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;
- }
}
{
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");
}
}
if (!lafSet)
{
- setSystemLookAndFeel();
+ // Flatlaf default for everyone!
+ lafSet = setFlatLookAndFeel();
+ if (!lafSet)
+ {
+ setSystemLookAndFeel();
+ }
if (Platform.isLinux())
{
setLinuxLookAndFeel();
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));
return set;
}
+ /*
private static void showUsage()
{
System.out.println(
+ "-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)
{
{
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
+ ") 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);
{
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);
}
}
+ "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),
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,
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"
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,
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
// 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<>();
openedLinkedIds = !negated;
allLinkedIds = false;
}
+ else if (a == Arg.ALLSTRUCTURES)
+ {
+ allStructures = !negated;
+ }
if (a.hasOption(Opt.STORED))
{
+ 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);
+ }
}
}
}
// 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()
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)
}
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))
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;
}
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;
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
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;
{
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);
}
*/
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;
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;
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
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;
}
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;
*
* @param action
*/
- public void setResponseAction(Object response, Callable action)
+ public void setResponseAction(Object response, Runnable action)
{
dialog.setResponseHandler(response, action);
}
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;
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;
@Override
public void setProgressBar(String message, long id)
{
- if (!Platform.isHeadless())
+ if (!Platform.isHeadless() && progressBar != null)
progressBar.setProgressBar(message, id);
}
public void registerHandler(final long id,
final 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();
}
/**
}
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)
AlignFrame.this.getViewport().setSavedUpToDate(true);
}
}
- return null;
};
/*
{
try
{
- outputAction.call();
+ outputAction.run();
} catch (Exception e)
{
// TODO Auto-generated catch block
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();
oom);
cap.dispose();
}
- return null;
};
/*
{
try
{
- outputAction.call();
+ outputAction.run();
} catch (Exception e)
{
e.printStackTrace();
@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);
}
/**
String choice = chooser.getSelectedFile().getPath();
Cache.setProperty("LAST_DIRECTORY", choice);
loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
- return null;
});
chooser.showOpenDialog(this);
return;
}
- Callable okAction = () -> {
+ Runnable okAction = () -> {
SequenceI[] cut = sg.getSequences()
.toArray(new SequenceI[sg.getSize()]);
{
}
}
- return null;
};
/*
{
try
{
- okAction.call();
+ okAction.run();
} catch (Exception e)
{
e.printStackTrace();
.getString("label.possible_problem_with_tree_file"),
JvOptionPane.WARNING_MESSAGE);
}
- return null;
});
chooser.showOpenDialog(this);
}
Cache.setProperty("LAST_DIRECTORY", choice);
SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
new VCFLoader(choice).loadVCF(seqs, us);
- return null;
});
chooser.showOpenDialog(null);
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"),
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;
void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer)
{
- makeAlignmentImage(type, file, renderer, 0.0f, 0, 0);
+ makeAlignmentImage(type, file, renderer,
+ BitmapImageSizing.nullBitmapImageSizing());
}
/**
* @param bitmapscale
*/
void makeAlignmentImage(ImageMaker.TYPE type, File file, String renderer,
- float bitmapscale, int bitmapwidth, int bitmapheight)
+ BitmapImageSizing userBis)
{
final int borderBottomOffset = 5;
int imageHeight = aDimension.getHeight() + borderBottomOffset;
String of = MessageManager.getString("label.alignment");
exporter.doExport(file, this, imageWidth, imageHeight, of, renderer,
- bitmapscale, bitmapwidth, bitmapheight);
+ userBis);
}
/**
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;
import jalview.analysis.AlignSeq;
import jalview.analysis.AlignmentUtils;
-import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
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
ap.av.getAlignment().setAnnotationIndex(annotation, 0);
}
ap.refresh(true);
- return null;
});
}
*/
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;
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
{
@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
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;
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();
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");
}
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));
}
}
new FileLoader().LoadFile(viewport, selectedFile, DataSourceType.FILE,
format);
- return null;
});
chooser.showOpenDialog(this);
}
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()
JvOptionPane.showInternalMessageDialog(Desktop.desktop, msg,
MessageManager.getString("label.url_not_found"),
JvOptionPane.WARNING_MESSAGE);
-
- return null; // Void
+ return;
}
if (viewport != null)
new FileLoader().LoadFile(url, DataSourceType.URL, format);
}
}
- return null; // Void
};
String dialogOption = MessageManager
.getString("label.input_alignment_from_url");
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 + "");
if (QuitHandler.quitCancelled())
{
jalview.bin.Console.debug("Desktop aborting quit");
- return null;
+ return;
}
if (dialogExecutor != null)
// instance.dispose();
}
instance.quit();
-
- return null; // Void
};
return QuitHandler.getQuitResponse(ui, doDesktopQuit, doDesktopQuit,
}
}
}, "Project Loader").start();
- return null;
});
chooser.showOpenDialog(this);
import java.awt.FlowLayout;
import java.awt.Font;
-import java.util.concurrent.Callable;
import javax.swing.BoxLayout;
import javax.swing.JButton;
panel.add(descriptionPanel);
JLabel nameLabel = new JLabel(label1);
- nameLabel.setFont(COURIER_12);
+ // nameLabel.setFont(COURIER_12);
namePanel.add(nameLabel);
id = new JTextField(name, 40);
if (desc != null || label2 != null)
{
JLabel descLabel = new JLabel(label2);
- descLabel.setFont(COURIER_12);
+ // descLabel.setFont(COURIER_12);
descriptionPanel.add(descLabel);
descriptionPanel.add(description);
}
*
* @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);
+ */
}
}
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;
*/
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
*
* @return
*/
- protected Callable getCancelAction()
+ protected Runnable getCancelAction()
{
- Callable<Void> okAction = () -> {
+ Runnable okAction = () -> {
ap.highlightSearchResults(null);
ap.paintAlignment(false, false);
- return null;
};
return okAction;
}
*
* @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();
repaintPanel();
}
- return null;
}
};
return okAction;
*
* @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;
}
*
* @return
*/
- protected Callable getAmendAction()
+ protected Runnable getAmendAction()
{
- Callable<Void> okAction = new Callable()
+ Runnable okAction = new Runnable()
{
boolean useLastDefaults = features.get(0).getType() == null;
String featureGroup = group.getText();
@Override
- public Void call()
+ public void run()
{
final String enteredType = name.getText().trim();
final String enteredGroup = group.getText().trim();
fr.featuresAdded();
}
repaintPanel();
- return null;
}
};
return okAction;
chooser.setResponseHandler(0, () -> {
File file = chooser.getSelectedFile();
load(file);
- return null;
});
chooser.showOpenDialog(this);
}
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;
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
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(
&& !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();
* - just do the export
*/
exportImage(file, !textSelected.get(), width, height, messageId,
- bitmapscale, bitmapwidth, bitmapheight);
+ userBis);
}
}
* @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
// "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(
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;
import jalview.bin.Console;
import jalview.util.ChannelProperties;
+import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.dialogrunner.DialogRunnerI;
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);
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()
{
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
{
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()
{
joptionpane.setValue(buttonAction);
if (action != null)
- getExecutor().submit(action);
+ new Thread(action).start();
// joptionpane.transferFocusBackward();
joptionpane.transferFocusBackward();
joptionpane.setVisible(false);
}
}
- public void showInternalDialog(JPanel mainPanel, String title,
+ public void showInternalDialog(Object mainPanel, String title,
int yesNoCancelOption, int questionMessage, Icon icon,
Object[] options, String initresponse)
{
this.setMessage(mainPanel);
ourOptions = Arrays.asList(options);
- int response;
if (parentComponent != this
&& !(parentComponent == null && Desktop.instance == null))
{
* }
*/
@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;
{
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)
{
{
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)
{
{
joptionpane.setValue(buttonAction);
if (action != null)
- getExecutor().submit(action);
+ new Thread(action).start();
// joptionpane.transferFocusBackward();
joptionpane.transferFocusBackward();
joptionpane.setVisible(false);
}
}
- 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++)
{
{
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;
}
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;
*
* @param action
*/
- public void setResponseAction(Object response, Callable action)
+ public void setResponseAction(Object response, Runnable action)
{
dialog.setResponseHandler(response, action);
}
sg.setName(dialog.getName());
sg.setDescription(dialog.getDescription());
refresh();
- return null;
});
}
{
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);
sequence.setDescription(dialog.getDescription());
ap.av.firePropertyChange("alignment", null,
ap.av.getAlignment().getSequences());
- return null;
});
}
ap.alignFrame.addHistoryItem(editCommand);
ap.av.firePropertyChange("alignment", null,
ap.av.getAlignment().getSequences());
- return null;
});
}
}
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;
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);
});
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)
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)
}
}
- Callable<Void> next = null;
+ Runnable next = null;
switch (gotQuitResponse())
{
case QUIT:
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())
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;
};
// fetch db refs if OK pressed
- final Callable discoverCanonicalDBrefs = () -> {
+ final Runnable discoverCanonicalDBrefs = () -> {
btn_queryTDB.setEnabled(false);
populateSeqsWithoutSourceDBRef();
// 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);
@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()
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)
{
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,
// 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,
*/
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
if (sview != null)
{
sview.setAlignAddedStructures(superposeAdded);
- new Thread(new Runnable()
+
+ Runnable viewRunnable = new Runnable()
{
@Override
public void run()
sview.updateTitleAndMenus();
}
- }).start();
+ };
+ if (async)
+ {
+ new Thread(viewRunnable).start();
+ }
+ else
+ {
+ viewRunnable.run();
+ }
return sview;
}
JalviewStructureDisplayI sview = null;
+ public JalviewStructureDisplayI getJalviewStructureDisplay()
+ {
+ return sview;
+ }
+
public JalviewStructureDisplayI viewStructures(PDBEntry pdb,
SequenceI[] seqsForPdb, AlignmentPanel ap)
{
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;
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,
}
addNewColourScheme(choice.getPath());
- return null;
});
chooser.showOpenDialog(this);
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;
/*
* configure the action to run on OK in the dialog
*/
- Callable<Void> okAction = () -> {
+ Runnable okAction = () -> {
doOutput(textOption.get());
- return null;
};
/*
setProgressMessage(MessageManager.formatMessage(
"status.cancelled_image_export_operation",
getDescription()));
- return null;
});
svgOption.setResponseAction(0, okAction);
svgOption.showDialog();
//////////////////////////////////////////////////////////////////
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;
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;
{
private static final long serialVersionUID = 1L;
- private Map<Object, Callable> callbacks = new HashMap<>();
+ private Map<Object, Runnable> callbacks = new HashMap<>();
File selectedFile = null;
*/
@Override
- public DialogRunnerI setResponseHandler(Object response, Callable action)
+ public DialogRunnerI setResponseHandler(Object response, Runnable action)
{
callbacks.put(response, action);
return this;
{
return;
}
- Callable action = callbacks.get(response);
+ Runnable action = callbacks.get(response);
if (action != null)
{
try
{
- action.call();
+ action.run();
} catch (Exception e)
{
e.printStackTrace();
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
{
* @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;
setupEPS(width, height, fileTitle, useLineart);
break;
case PNG:
- setupPNG(width, height, bitmapscale, bitmapwidth, bitmapheight);
+ setupPNG(width, height, userBis);
break;
default:
}
* @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);
+ }
}
/**
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);
+ }
}
*/
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
* @param action
* @return
*/
- DialogRunnerI setResponseHandler(Object response, Callable<Void> action);
+ DialogRunnerI setResponseHandler(Object response, Runnable action);
// DialogRunnerI setResponseHandler(Object response, Runnable action);
--- /dev/null
+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);
+ }
+}
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
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()
{
String cmdLine,
int seqNum,
int annNum,
- int viewerNum,
- String propsFile
+ int structureViewerNum,
*/
return new Object[][] {
//
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 },
/*
*/
//
@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",
{ "--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")
jalview.bin.Console.debug(
"Setting FORCE_QUIT without actually quitting");
QuitHandler.setResponse(QResponse.FORCE_QUIT);
- return null;
}, QuitHandler.defaultCancelQuit);
long end = System.currentTimeMillis();
# 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}"
}
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}" )
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
<?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=""${launcher:sys.launcherDirectory}" jalview">
+ <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Dinstaller_template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dchannel.app_name="${compiler:JALVIEW_APPLICATION_NAME}"" arguments=""${launcher:sys.launcherDirectory}" jalview">
<classPath>
<archive location="getdown-launcher.jar" />
<archive location="${compiler:GETDOWN_INSTALL_DIR}/getdown-launcher.jar" failOnError="false" />
</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" />
</screen>
<screen id="20" beanClass="com.install4j.runtime.beans.screens.FinishedScreen" rollbackBarrierExitCode="0" finishScreen="true">
<actions>
+ <action name="Linux Jalview Appname->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->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" />
</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">
</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">
</serializedBean>
<condition>context.getBooleanVariable("makeSymbolicLinkAction") && ( Util.isLinux() || Util.isUnixInstaller() ) && ( 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">
</serializedBean>
<condition>context.getBooleanVariable("makeSymbolicLinkAction") && Util.isMacOS() && ( context.getVariable("unixUserBinDir") != null ) && ( 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() && !(((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() && !(((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">
<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">
<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">
<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/">