2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import java.awt.Color;
24 import java.io.BufferedReader;
26 import java.io.FileOutputStream;
27 import java.io.IOException;
28 import java.io.InputStreamReader;
29 import java.io.OutputStream;
30 import java.io.OutputStreamWriter;
31 import java.io.PrintStream;
32 import java.io.PrintWriter;
33 import java.net.MalformedURLException;
35 import java.net.URISyntaxException;
37 import java.security.AllPermission;
38 import java.security.CodeSource;
39 import java.security.PermissionCollection;
40 import java.security.Permissions;
41 import java.security.Policy;
42 import java.util.ArrayList;
43 import java.util.HashMap;
44 import java.util.List;
45 import java.util.Locale;
47 import java.util.Properties;
48 import java.util.Vector;
49 import java.util.logging.ConsoleHandler;
50 import java.util.logging.Level;
51 import java.util.logging.Logger;
52 import java.util.stream.Collectors;
54 import javax.swing.JDialog;
55 import javax.swing.JFrame;
56 import javax.swing.JInternalFrame;
57 import javax.swing.JOptionPane;
58 import javax.swing.SwingUtilities;
59 import javax.swing.UIManager;
60 import javax.swing.UIManager.LookAndFeelInfo;
61 import javax.swing.UnsupportedLookAndFeelException;
63 import com.formdev.flatlaf.FlatLightLaf;
64 import com.formdev.flatlaf.themes.FlatMacLightLaf;
65 import com.formdev.flatlaf.util.SystemInfo;
66 import com.threerings.getdown.util.LaunchUtil;
68 //import edu.stanford.ejalbert.launching.IBrowserLaunching;
69 import groovy.lang.Binding;
70 import groovy.util.GroovyScriptEngine;
71 import jalview.bin.argparser.Arg;
72 import jalview.bin.argparser.Arg.Opt;
73 import jalview.bin.argparser.Arg.Type;
74 import jalview.bin.argparser.ArgParser;
75 import jalview.bin.argparser.BootstrapArgs;
76 import jalview.ext.so.SequenceOntology;
77 import jalview.gui.AlignFrame;
78 import jalview.gui.Desktop;
79 import jalview.gui.PromptUserConfig;
80 import jalview.gui.QuitHandler;
81 import jalview.gui.QuitHandler.QResponse;
82 import jalview.gui.StructureViewerBase;
83 import jalview.io.AppletFormatAdapter;
84 import jalview.io.BioJsHTMLOutput;
85 import jalview.io.DataSourceType;
86 import jalview.io.FileFormat;
87 import jalview.io.FileFormatException;
88 import jalview.io.FileFormatI;
89 import jalview.io.FileFormats;
90 import jalview.io.FileLoader;
91 import jalview.io.HtmlSvgOutput;
92 import jalview.io.IdentifyFile;
93 import jalview.io.NewickFile;
94 import jalview.io.gff.SequenceOntologyFactory;
95 import jalview.schemes.ColourSchemeI;
96 import jalview.schemes.ColourSchemeProperty;
97 import jalview.util.ChannelProperties;
98 import jalview.util.HttpUtils;
99 import jalview.util.LaunchUtils;
100 import jalview.util.MessageManager;
101 import jalview.util.Platform;
102 import jalview.ws.jws2.Jws2Discoverer;
105 * Main class for Jalview Application <br>
107 * start with: java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" \
108 * jalview.bin.Jalview
110 * or on Windows: java -classpath "$PATH_TO_LIB$/*;$PATH_TO_CLASSES$" \
111 * jalview.bin.Jalview jalview.bin.Jalview
113 * (ensure -classpath arg is quoted to avoid shell expansion of '*' and do not
114 * embellish '*' to e.g. '*.jar')
117 * @version $Revision$
123 Platform.getURLCommandArguments();
124 Platform.addJ2SDirectDatabaseCall("https://www.jalview.org");
125 Platform.addJ2SDirectDatabaseCall("http://www.jalview.org");
126 Platform.addJ2SDirectDatabaseCall("http://www.compbio.dundee.ac.uk");
127 Platform.addJ2SDirectDatabaseCall("https://www.compbio.dundee.ac.uk");
131 * singleton instance of this class
133 private static Jalview instance;
135 private Desktop desktop;
137 protected Commands cmds;
139 public static AlignFrame currentAlignFrame;
141 public ArgParser argparser = null;
143 public BootstrapArgs bootstrapArgs = null;
145 private boolean QUIET = false;
147 public static boolean quiet()
149 return Jalview.getInstance() != null && Jalview.getInstance().QUIET;
154 if (!Platform.isJS())
161 // grab all the rights we can for the JVM
162 Policy.setPolicy(new Policy()
165 public PermissionCollection getPermissions(CodeSource codesource)
167 Permissions perms = new Permissions();
168 perms.add(new AllPermission());
173 public void refresh()
181 * keep track of feature fetching tasks.
189 * TODO: generalise to track all jalview events to orchestrate batch processing
193 private int queued = 0;
195 private int running = 0;
197 public FeatureFetcher()
202 public void addFetcher(final AlignFrame af,
203 final Vector<String> dasSources)
205 final long id = System.currentTimeMillis();
207 final FeatureFetcher us = this;
208 new Thread(new Runnable()
220 af.setProgressBar(MessageManager
221 .getString("status.das_features_being_retrived"), id);
222 af.featureSettings_actionPerformed(null);
223 af.setProgressBar(null, id);
232 public synchronized boolean allFinished()
234 return queued == 0 && running == 0;
239 public static Jalview getInstance()
245 * main class for Jalview application
248 * open <em>filename</em>
250 public static void main(String[] args)
252 // setLogging(); // BH - for event debugging in JavaScript
253 instance = new Jalview();
254 instance.doMain(args);
257 private static void logClass(String name)
259 // BH - for event debugging in JavaScript
260 ConsoleHandler consoleHandler = new ConsoleHandler();
261 consoleHandler.setLevel(Level.ALL);
262 Logger logger = Logger.getLogger(name);
263 logger.setLevel(Level.ALL);
264 logger.addHandler(consoleHandler);
267 @SuppressWarnings("unused")
268 private static void setLogging()
276 System.out.println("not in js");
279 // BH - for event debugging in JavaScript (Java mode only)
280 if (!Platform.isJS())
287 Logger.getLogger("").setLevel(Level.ALL);
288 logClass("java.awt.EventDispatchThread");
289 logClass("java.awt.EventQueue");
290 logClass("java.awt.Component");
291 logClass("java.awt.focus.Component");
292 logClass("java.awt.focus.DefaultKeyboardFocusManager");
300 void doMain(String[] args)
302 if (!Platform.isJS())
304 System.setSecurityManager(null);
307 if (args == null || args.length == 0 || (args.length == 1
308 && (args[0] == null || args[0].length() == 0)))
310 args = new String[] {};
313 // get args needed before proper ArgParser
314 bootstrapArgs = BootstrapArgs.getBootstrapArgs(args);
316 if (!Platform.isJS())
318 // are we being --quiet ?
319 if (bootstrapArgs.contains(Arg.QUIET))
322 OutputStream devNull = new OutputStream()
326 public void write(int b)
331 System.setOut(new PrintStream(devNull));
332 // redirecting stderr not working
333 if (bootstrapArgs.getList(Arg.QUIET).size() > 1)
335 System.setErr(new PrintStream(devNull));
339 if (bootstrapArgs.contains(Arg.HELP)
340 || bootstrapArgs.contains(Arg.VERSION))
346 // Move any new getdown-launcher-new.jar into place over old
347 // getdown-launcher.jar
348 String appdirString = System.getProperty("getdownappdir");
349 if (appdirString != null && appdirString.length() > 0)
351 final File appdir = new File(appdirString);
358 LaunchUtil.upgradeGetdown(
359 new File(appdir, "getdown-launcher-old.jar"),
360 new File(appdir, "getdown-launcher.jar"),
361 new File(appdir, "getdown-launcher-new.jar"));
366 if (!quiet() || bootstrapArgs.contains(Arg.VERSION))
369 "Java version: " + System.getProperty("java.version"));
370 System.out.println("Java home: " + System.getProperty("java.home"));
371 System.out.println("Java arch: " + System.getProperty("os.arch") + " "
372 + System.getProperty("os.name") + " "
373 + System.getProperty("os.version"));
375 String val = System.getProperty("sys.install4jVersion");
378 System.out.println("Install4j version: " + val);
380 val = System.getProperty("installer_template_version");
383 System.out.println("Install4j template version: " + val);
385 val = System.getProperty("launcher_version");
388 System.out.println("Launcher version: " + val);
392 if (Platform.isLinux() && LaunchUtils.getJavaVersion() < 11)
394 System.setProperty("flatlaf.uiScale", "1");
397 // get bootstrap properties (mainly for the logger level)
398 Properties bootstrapProperties = Cache
399 .bootstrapProperties(bootstrapArgs.getValue(Arg.PROPS));
401 // report Jalview version
402 Cache.loadBuildProperties(
403 !quiet() || bootstrapArgs.contains(Arg.VERSION));
405 // stop now if only after --version
406 if (bootstrapArgs.contains(Arg.VERSION))
408 Jalview.exit(null, 0);
412 ArgsParser aparser = new ArgsParser(args);
415 boolean headless = false;
417 boolean headlessArg = false;
421 String logLevel = null;
422 if (bootstrapArgs.contains(Arg.TRACE))
426 else if (bootstrapArgs.contains(Arg.DEBUG))
430 if (logLevel == null && !(bootstrapProperties == null))
432 logLevel = bootstrapProperties.getProperty(Cache.JALVIEWLOGLEVEL);
434 Console.initLogger(logLevel);
435 } catch (NoClassDefFoundError error)
437 error.printStackTrace();
438 String message = "\nEssential logging libraries not found."
439 + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview";
440 Jalview.exit(message, 0);
443 // register SIGTERM listener
444 Runtime.getRuntime().addShutdownHook(new Thread()
448 Console.debug("Running shutdown hook");
449 QuitHandler.startForceQuit();
450 boolean closeExternal = Cache
451 .getDefault("DEFAULT_CLOSE_EXTERNAL_VIEWERS", false)
452 || Cache.getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false);
453 StructureViewerBase.setQuitClose(closeExternal);
456 for (JInternalFrame frame : Desktop.desktop.getAllFrames())
458 if (frame instanceof StructureViewerBase)
460 ((StructureViewerBase) frame).closeViewer(closeExternal);
465 if (QuitHandler.gotQuitResponse() == QResponse.CANCEL_QUIT)
467 // Got to here by a SIGTERM signal.
468 // Note we will not actually cancel the quit from here -- it's too
469 // late -- but we can wait for saving files and close external viewers
471 // Close viewers/Leave viewers open
472 Console.debug("Checking for saving files");
473 QuitHandler.getQuitResponse(false);
477 Console.debug("Nothing more to do");
479 Console.debug("Exiting, bye!");
480 // shutdownHook cannot be cancelled, JVM will now halt
484 String usrPropsFile = bootstrapArgs.contains(Arg.PROPS)
485 ? bootstrapArgs.getValue(Arg.PROPS)
486 : aparser.getValue("props");
487 // if usrPropsFile == null, loadProperties will use the Channel
489 Cache.loadProperties(usrPropsFile);
490 if (usrPropsFile != null)
493 "CMD [-props " + usrPropsFile + "] executed successfully!");
494 testoutput(bootstrapArgs, Arg.PROPS,
495 "test/jalview/bin/testProps.jvprops", usrPropsFile);
498 // --argfile=... -- OVERRIDES ALL NON-BOOTSTRAP ARGS
499 if (bootstrapArgs.contains(Arg.ARGFILE))
501 argparser = ArgParser.parseArgFiles(
502 bootstrapArgs.getValueList(Arg.ARGFILE),
503 bootstrapArgs.getBoolean(Arg.INITSUBSTITUTIONS),
508 argparser = new ArgParser(args,
509 bootstrapArgs.getBoolean(Arg.INITSUBSTITUTIONS),
513 if (!Platform.isJS())
520 if (bootstrapArgs.contains(Arg.HELP))
522 List<Map.Entry<Type, String>> helpArgs = bootstrapArgs
524 System.out.println(Arg.usage(helpArgs.stream().map(e -> e.getKey())
525 .collect(Collectors.toList())));
526 Jalview.exit(null, 0);
528 if (aparser.contains("help") || aparser.contains("h"))
531 * Now using new usage statement.
534 System.out.println(Arg.usage());
535 Jalview.exit(null, 0);
539 headlessArg = bootstrapArgs.isHeadless();
542 System.setProperty("java.awt.headless", "true");
545 if (aparser.contains("nodisplay") || aparser.contains("nogui")
546 || aparser.contains("headless"))
548 System.setProperty("java.awt.headless", "true");
553 // allow https handshakes to download intermediate certs if necessary
554 System.setProperty("com.sun.security.enableAIAcaIssuers", "true");
556 String jabawsUrl = bootstrapArgs.getValue(Arg.JABAWS);
557 if (jabawsUrl == null)
558 jabawsUrl = aparser.getValue("jabaws");
559 if (jabawsUrl != null)
563 Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
565 "CMD [-jabaws " + jabawsUrl + "] executed successfully!");
566 testoutput(bootstrapArgs, Arg.JABAWS,
567 "http://www.compbio.dundee.ac.uk/jabaws", jabawsUrl);
568 } catch (MalformedURLException e)
571 "Invalid jabaws parameter: " + jabawsUrl + " ignored");
576 List<String> setprops = new ArrayList<>();
577 if (bootstrapArgs.contains(Arg.SETPROP))
579 setprops = bootstrapArgs.getValueList(Arg.SETPROP);
583 String sp = aparser.getValue("setprop");
587 sp = aparser.getValue("setprop");
590 for (String setprop : setprops)
592 int p = setprop.indexOf('=');
596 .println("Ignoring invalid setprop argument : " + setprop);
600 System.out.println("Executing setprop argument: " + setprop);
603 Cache.setProperty(setprop.substring(0, p),
604 setprop.substring(p + 1));
606 // DISABLED FOR SECURITY REASONS
607 // TODO: add a property to allow properties to be overriden by cli args
608 // Cache.setProperty(setprop.substring(0,p), setprop.substring(p+1));
611 if (System.getProperty("java.awt.headless") != null
612 && System.getProperty("java.awt.headless").equals("true"))
616 System.setProperty("http.agent",
617 "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
621 Console.initLogger();
624 NoClassDefFoundError error)
626 error.printStackTrace();
627 String message = "\nEssential logging libraries not found."
628 + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview";
629 Jalview.exit(message, 0);
633 if (!(headless || headlessArg))
637 * configure 'full' SO model if preferences say to, else use the default (full SO)
638 * - as JS currently doesn't have OBO parsing, it must use 'Lite' version
640 boolean soDefault = !Platform.isJS();
641 if (Cache.getDefault("USE_FULL_SO", soDefault))
643 SequenceOntologyFactory.setInstance(new SequenceOntology());
646 if (!(headless || headlessArg))
648 Desktop.nosplash = "false".equals(bootstrapArgs.getValue(Arg.SPLASH))
649 || aparser.contains("nosplash")
650 || Cache.getDefault("SPLASH", "true").equals("false");
651 desktop = new Desktop();
652 desktop.setInBatchMode(true); // indicate we are starting up
656 JalviewTaskbar.setTaskbar(this);
657 } catch (Exception e)
659 Console.info("Cannot set Taskbar");
660 Console.error(e.getMessage());
661 // e.printStackTrace();
662 } catch (Throwable t)
664 Console.info("Cannot set Taskbar");
665 Console.error(t.getMessage());
666 // t.printStackTrace();
669 // set Proxy settings before all the internet calls
670 Cache.setProxyPropertiesFromPreferences();
672 desktop.setVisible(true);
674 if (!Platform.isJS())
683 * Check to see that the JVM version being run is suitable for the Java
684 * version this Jalview was compiled for. Popup a warning if not.
686 if (!LaunchUtils.checkJavaVersion())
688 Console.warn("The Java version being used (Java "
689 + LaunchUtils.getJavaVersion()
690 + ") may lead to problems. This installation of Jalview should be used with Java "
691 + LaunchUtils.getJavaCompileVersion() + ".");
694 .getBooleanUserPreference("IGNORE_JVM_WARNING_POPUP"))
697 MessageManager.getString("label.continue") };
698 JOptionPane.showOptionDialog(null,
699 MessageManager.formatMessage(
700 "warning.wrong_jvm_version_message",
701 LaunchUtils.getJavaVersion(),
702 LaunchUtils.getJavaCompileVersion()),
704 .getString("warning.wrong_jvm_version_title"),
705 JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
706 null, options, options[0]);
710 boolean webservicediscovery = bootstrapArgs
711 .getBoolean(Arg.WEBSERVICEDISCOVERY);
712 if (aparser.contains("nowebservicediscovery"))
713 webservicediscovery = false;
714 if (webservicediscovery)
716 desktop.startServiceDiscovery();
720 testoutput(argparser, Arg.WEBSERVICEDISCOVERY);
723 boolean usagestats = bootstrapArgs.getBoolean(Arg.USAGESTATS);
724 if (aparser.contains("nousagestats"))
728 startUsageStats(desktop);
729 testoutput(argparser, Arg.USAGESTATS);
733 System.out.println("CMD [-nousagestats] executed successfully!");
734 testoutput(argparser, Arg.USAGESTATS);
737 boolean questionnaire = bootstrapArgs.getBoolean(Arg.QUESTIONNAIRE);
738 if (aparser.contains("noquestionnaire"))
739 questionnaire = false;
742 String url = aparser.getValue("questionnaire");
745 // Start the desktop questionnaire prompter with the specified
747 Console.debug("Starting questionnaire url at " + url);
748 desktop.checkForQuestionnaire(url);
749 System.out.println("CMD questionnaire[-" + url
750 + "] executed successfully!");
754 if (Cache.getProperty("NOQUESTIONNAIRES") == null)
756 // Start the desktop questionnaire prompter with the specified
759 // "http://anaplog.compbio.dundee.ac.uk/cgi-bin/questionnaire.pl";
761 String defurl = "https://www.jalview.org/cgi-bin/questionnaire.pl";
763 "Starting questionnaire with default url: " + defurl);
764 desktop.checkForQuestionnaire(defurl);
771 .println("CMD [-noquestionnaire] executed successfully!");
772 testoutput(argparser, Arg.QUESTIONNAIRE);
775 if ((!aparser.contains("nonews")
776 && Cache.getProperty("NONEWS") == null
777 && !"false".equals(bootstrapArgs.getValue(Arg.NEWS)))
778 || "true".equals(bootstrapArgs.getValue(Arg.NEWS)))
780 desktop.checkForNews();
783 if (!aparser.contains("nohtmltemplates")
784 && Cache.getProperty("NOHTMLTEMPLATES") == null)
786 BioJsHTMLOutput.updateBioJS();
790 // Run Commands from cli
791 cmds = new Commands(argparser, headlessArg);
792 boolean commandsSuccess = cmds.argsWereParsed();
797 if (argparser.getBoolean(Arg.NOQUIT))
800 "Completed " + Arg.HEADLESS.getName() + " commands, but "
801 + Arg.NOQUIT + " is set so not quitting!");
805 Jalview.exit("Successfully completed commands in headless mode",
809 Console.info("Successfully completed commands");
815 Jalview.exit("Error when running Commands in headless mode", 1);
817 Console.warn("Error when running commands");
820 // Check if JVM and compile version might cause problems and log if it
822 if (headless && !Platform.isJS() && !LaunchUtils.checkJavaVersion())
824 Console.warn("The Java version being used (Java "
825 + LaunchUtils.getJavaVersion()
826 + ") may lead to problems. This installation of Jalview should be used with Java "
827 + LaunchUtils.getJavaCompileVersion() + ".");
830 String file = null, data = null;
832 FileFormatI format = null;
834 DataSourceType protocol = null;
836 FileLoader fileLoader = new FileLoader(!headless);
838 String groovyscript = null; // script to execute after all loading is
839 // completed one way or another
840 // extract groovy argument and execute if necessary
841 groovyscript = aparser.getValue("groovy", true);
842 file = aparser.getValue("open", true);
844 if (file == null && desktop == null && !commandsSuccess)
846 Jalview.exit("No files to open!", 1);
850 // Finally, deal with the remaining input data.
855 desktop.setProgressBar(
857 .getString("status.processing_commandline_args"),
858 progress = System.currentTimeMillis());
860 System.out.println("CMD [-open " + file + "] executed successfully!");
862 if (!Platform.isJS())
864 * ignore in JavaScript -- can't just file existence - could load it?
869 if (!HttpUtils.startsWithHttpOrHttps(file))
871 if (!(new File(file)).exists())
876 "Can't find file '" + file + "' in headless mode", 1);
878 Console.warn("Can't find file'" + file + "'");
883 protocol = AppletFormatAdapter.checkProtocol(file);
887 format = new IdentifyFile().identify(file, protocol);
888 } catch (FileFormatException e1)
893 AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol,
897 System.out.println("error");
901 setCurrentAlignFrame(af);
902 data = aparser.getValue("colour", true);
905 data.replaceAll("%20", " ");
907 ColourSchemeI cs = ColourSchemeProperty.getColourScheme(
908 af.getViewport(), af.getViewport().getAlignment(), data);
913 "CMD [-colour " + data + "] executed successfully!");
918 // Must maintain ability to use the groups flag
919 data = aparser.getValue("groups", true);
922 af.parseFeaturesFile(data,
923 AppletFormatAdapter.checkProtocol(data));
924 // System.out.println("Added " + data);
926 "CMD groups[-" + data + "] executed successfully!");
928 data = aparser.getValue("features", true);
931 af.parseFeaturesFile(data,
932 AppletFormatAdapter.checkProtocol(data));
933 // System.out.println("Added " + data);
935 "CMD [-features " + data + "] executed successfully!");
938 data = aparser.getValue("annotations", true);
941 af.loadJalviewDataFile(data, null, null, null);
942 // System.out.println("Added " + data);
944 "CMD [-annotations " + data + "] executed successfully!");
946 // set or clear the sortbytree flag.
947 if (aparser.contains("sortbytree"))
949 af.getViewport().setSortByTree(true);
950 if (af.getViewport().getSortByTree())
952 System.out.println("CMD [-sortbytree] executed successfully!");
955 if (aparser.contains("no-annotation"))
957 af.getViewport().setShowAnnotation(false);
958 if (!af.getViewport().isShowAnnotation())
960 System.out.println("CMD no-annotation executed successfully!");
963 if (aparser.contains("nosortbytree"))
965 af.getViewport().setSortByTree(false);
966 if (!af.getViewport().getSortByTree())
969 .println("CMD [-nosortbytree] executed successfully!");
972 data = aparser.getValue("tree", true);
978 "CMD [-tree " + data + "] executed successfully!");
979 NewickFile nf = new NewickFile(data,
980 AppletFormatAdapter.checkProtocol(data));
982 .setCurrentTree(af.showNewickTree(nf, data).getTree());
983 } catch (IOException ex)
985 System.err.println("Couldn't add tree " + data);
986 ex.printStackTrace(System.err);
989 // TODO - load PDB structure(s) to alignment JAL-629
990 // (associate with identical sequence in alignment, or a specified
992 if (groovyscript != null)
994 // Execute the groovy script after we've done all the rendering stuff
995 // and before any images or figures are generated.
996 System.out.println("Executing script " + groovyscript);
997 executeGroovyScript(groovyscript, af);
998 System.out.println("CMD groovy[" + groovyscript
999 + "] executed successfully!");
1000 groovyscript = null;
1002 String imageName = "unnamed.png";
1003 while (aparser.getSize() > 1)
1005 String outputFormat = aparser.nextValue();
1006 file = aparser.nextValue();
1008 if (outputFormat.equalsIgnoreCase("png"))
1010 af.createPNG(new File(file));
1011 imageName = (new File(file)).getName();
1012 System.out.println("Creating PNG image: " + file);
1015 else if (outputFormat.equalsIgnoreCase("svg"))
1017 File imageFile = new File(file);
1018 imageName = imageFile.getName();
1019 af.createSVG(imageFile);
1020 System.out.println("Creating SVG image: " + file);
1023 else if (outputFormat.equalsIgnoreCase("html"))
1025 File imageFile = new File(file);
1026 imageName = imageFile.getName();
1027 HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
1028 htmlSVG.exportHTML(file);
1030 System.out.println("Creating HTML image: " + file);
1033 else if (outputFormat.equalsIgnoreCase("biojsmsa"))
1037 System.err.println("The output html file must not be null");
1042 BioJsHTMLOutput.refreshVersionInfo(
1043 BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
1044 } catch (URISyntaxException e)
1046 e.printStackTrace();
1048 BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
1049 bjs.exportHTML(file);
1051 .println("Creating BioJS MSA Viwer HTML file: " + file);
1054 else if (outputFormat.equalsIgnoreCase("imgMap"))
1056 af.createImageMap(new File(file), imageName);
1057 System.out.println("Creating image map: " + file);
1060 else if (outputFormat.equalsIgnoreCase("eps"))
1062 File outputFile = new File(file);
1064 "Creating EPS file: " + outputFile.getAbsolutePath());
1065 af.createEPS(outputFile);
1068 FileFormatI outFormat = null;
1071 outFormat = FileFormats.getInstance().forName(outputFormat);
1072 } catch (Exception formatP)
1074 System.out.println("Couldn't parse " + outFormat
1075 + " as a valid Jalview format string.");
1077 if (outFormat != null)
1079 if (!outFormat.isWritable())
1082 "This version of Jalview does not support alignment export as "
1087 af.saveAlignment(file, outFormat);
1088 if (af.isSaveAlignmentSuccessful())
1090 System.out.println("Written alignment in "
1091 + outFormat.getName() + " format to " + file);
1095 System.out.println("Error writing file " + file + " in "
1096 + outFormat.getName() + " format!!");
1103 while (aparser.getSize() > 0)
1105 System.out.println("Unknown arg: " + aparser.nextValue());
1110 AlignFrame startUpAlframe = null;
1111 // We'll only open the default file if the desktop is visible.
1113 // ////////////////////
1115 if (!Platform.isJS() && !headless && file == null
1116 && Cache.getDefault("SHOW_STARTUP_FILE", true)
1117 && !cmds.commandArgsProvided())
1118 // don't open the startup file if command line args have been processed
1119 // (&& !Commands.commandArgsProvided())
1126 file = Cache.getDefault("STARTUP_FILE",
1127 Cache.getDefault("www.jalview.org", "https://www.jalview.org")
1128 + "/examples/exampleFile_2_7.jvp");
1129 if (file.equals("http://www.jalview.org/examples/exampleFile_2_3.jar")
1131 "http://www.jalview.org/examples/exampleFile_2_7.jar"))
1133 file.replace("http:", "https:");
1134 // hardwire upgrade of the startup file
1135 file.replace("_2_3", "_2_7");
1136 file.replace("2_7.jar", "2_7.jvp");
1137 // and remove the stale setting
1138 Cache.removeProperty("STARTUP_FILE");
1141 protocol = AppletFormatAdapter.checkProtocol(file);
1143 if (file.endsWith(".jar"))
1145 format = FileFormat.Jalview;
1151 format = new IdentifyFile().identify(file, protocol);
1152 } catch (FileFormatException e)
1158 startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol,
1160 // don't ask to save when quitting if only the startup file has been
1162 Console.debug("Resetting up-to-date flag for startup file");
1163 startUpAlframe.getViewport().setSavedUpToDate(true);
1164 // extract groovy arguments before anything else.
1167 // Once all other stuff is done, execute any groovy scripts (in order)
1168 if (groovyscript != null)
1170 if (Cache.groovyJarsPresent())
1172 System.out.println("Executing script " + groovyscript);
1173 executeGroovyScript(groovyscript, startUpAlframe);
1178 "Sorry. Groovy Support is not available, so ignoring the provided groovy script "
1182 // and finally, turn off batch mode indicator - if the desktop still exists
1183 if (desktop != null)
1187 desktop.setProgressBar(null, progress);
1189 desktop.setInBatchMode(false);
1193 private static void setLookAndFeel()
1195 // property laf = "crossplatform", "system", "gtk", "metal", "nimbus",
1197 // If not set (or chosen laf fails), use the normal SystemLaF and if on Mac,
1198 // try Quaqua/Vaqua.
1199 String lafProp = System.getProperty("laf");
1200 String lafSetting = Cache.getDefault("PREFERRED_LAF", null);
1201 String laf = "none";
1202 if (lafProp != null)
1206 else if (lafSetting != null)
1210 boolean lafSet = false;
1213 case "crossplatform":
1214 lafSet = setCrossPlatformLookAndFeel();
1217 Console.error("Could not set requested laf=" + laf);
1221 lafSet = setSystemLookAndFeel();
1224 Console.error("Could not set requested laf=" + laf);
1228 lafSet = setGtkLookAndFeel();
1231 Console.error("Could not set requested laf=" + laf);
1235 lafSet = setMetalLookAndFeel();
1238 Console.error("Could not set requested laf=" + laf);
1242 lafSet = setNimbusLookAndFeel();
1245 Console.error("Could not set requested laf=" + laf);
1249 lafSet = setFlatLookAndFeel();
1252 Console.error("Could not set requested laf=" + laf);
1256 lafSet = setMacLookAndFeel();
1259 Console.error("Could not set requested laf=" + laf);
1265 Console.error("Requested laf=" + laf + " not implemented");
1269 // Flatlaf default for everyone!
1270 lafSet = setFlatLookAndFeel();
1273 setSystemLookAndFeel();
1275 if (Platform.isLinux())
1277 setLinuxLookAndFeel();
1279 if (Platform.isMac())
1281 setMacLookAndFeel();
1286 private static boolean setCrossPlatformLookAndFeel()
1288 boolean set = false;
1291 UIManager.setLookAndFeel(
1292 UIManager.getCrossPlatformLookAndFeelClassName());
1294 } catch (Exception ex)
1296 Console.error("Unexpected Look and Feel Exception");
1297 Console.error(ex.getMessage());
1298 Console.debug(Cache.getStackTraceString(ex));
1303 private static boolean setSystemLookAndFeel()
1305 boolean set = false;
1308 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
1310 } catch (Exception ex)
1312 Console.error("Unexpected Look and Feel Exception");
1313 Console.error(ex.getMessage());
1314 Console.debug(Cache.getStackTraceString(ex));
1319 private static boolean setSpecificLookAndFeel(String name,
1320 String className, boolean nameStartsWith)
1322 boolean set = false;
1325 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
1327 if (info.getName() != null && nameStartsWith
1328 ? info.getName().toLowerCase(Locale.ROOT)
1329 .startsWith(name.toLowerCase(Locale.ROOT))
1330 : info.getName().toLowerCase(Locale.ROOT)
1331 .equals(name.toLowerCase(Locale.ROOT)))
1333 className = info.getClassName();
1337 UIManager.setLookAndFeel(className);
1339 } catch (Exception ex)
1341 Console.error("Unexpected Look and Feel Exception");
1342 Console.error(ex.getMessage());
1343 Console.debug(Cache.getStackTraceString(ex));
1348 private static boolean setGtkLookAndFeel()
1350 return setSpecificLookAndFeel("gtk",
1351 "com.sun.java.swing.plaf.gtk.GTKLookAndFeel", true);
1354 private static boolean setMetalLookAndFeel()
1356 return setSpecificLookAndFeel("metal",
1357 "javax.swing.plaf.metal.MetalLookAndFeel", false);
1360 private static boolean setNimbusLookAndFeel()
1362 return setSpecificLookAndFeel("nimbus",
1363 "javax.swing.plaf.nimbus.NimbusLookAndFeel", false);
1366 private static boolean setFlatLookAndFeel()
1368 boolean set = false;
1369 if (SystemInfo.isMacOS)
1373 UIManager.setLookAndFeel(
1374 "com.formdev.flatlaf.themes.FlatMacLightLaf");
1376 Console.debug("Using FlatMacLightLaf");
1377 } catch (ClassNotFoundException | InstantiationException
1378 | IllegalAccessException | UnsupportedLookAndFeelException e)
1380 Console.debug("Exception loading FlatLightLaf", e);
1382 System.setProperty("apple.laf.useScreenMenuBar", "true");
1383 System.setProperty("apple.awt.application.name",
1384 ChannelProperties.getProperty("app_name"));
1385 System.setProperty("apple.awt.application.appearance", "system");
1386 if (SystemInfo.isMacFullWindowContentSupported
1387 && Desktop.desktop != null)
1389 Console.debug("Setting transparent title bar");
1390 Desktop.desktop.getRootPane()
1391 .putClientProperty("apple.awt.fullWindowContent", true);
1392 Desktop.desktop.getRootPane()
1393 .putClientProperty("apple.awt.transparentTitleBar", true);
1394 Desktop.desktop.getRootPane()
1395 .putClientProperty("apple.awt.fullscreenable", true);
1397 SwingUtilities.invokeLater(() -> {
1398 FlatMacLightLaf.setup();
1400 Console.debug("Using FlatMacLightLaf");
1407 UIManager.setLookAndFeel("com.formdev.flatlaf.FlatLightLaf");
1409 Console.debug("Using FlatLightLaf");
1410 } catch (ClassNotFoundException | InstantiationException
1411 | IllegalAccessException | UnsupportedLookAndFeelException e)
1413 Console.debug("Exception loading FlatLightLaf", e);
1415 // Windows specific properties here
1416 SwingUtilities.invokeLater(() -> {
1417 FlatLightLaf.setup();
1419 Console.debug("Using FlatLightLaf");
1422 else if (SystemInfo.isLinux)
1426 UIManager.setLookAndFeel("com.formdev.flatlaf.FlatLightLaf");
1428 Console.debug("Using FlatLightLaf");
1429 } catch (ClassNotFoundException | InstantiationException
1430 | IllegalAccessException | UnsupportedLookAndFeelException e)
1432 Console.debug("Exception loading FlatLightLaf", e);
1434 // enable custom window decorations
1435 JFrame.setDefaultLookAndFeelDecorated(true);
1436 JDialog.setDefaultLookAndFeelDecorated(true);
1437 SwingUtilities.invokeLater(() -> {
1438 FlatLightLaf.setup();
1440 Console.debug("Using FlatLightLaf");
1448 UIManager.setLookAndFeel("com.formdev.flatlaf.FlatLightLaf");
1450 Console.debug("Using FlatLightLaf");
1451 } catch (ClassNotFoundException | InstantiationException
1452 | IllegalAccessException | UnsupportedLookAndFeelException e)
1454 Console.debug("Exception loading FlatLightLaf", e);
1460 UIManager.put("TabbedPane.tabType", "card");
1461 UIManager.put("TabbedPane.showTabSeparators", true);
1462 UIManager.put("TabbedPane.showContentSeparator", true);
1463 UIManager.put("TabbedPane.tabSeparatorsFullHeight", true);
1464 UIManager.put("TabbedPane.tabsOverlapBorder", true);
1465 UIManager.put("TabbedPane.hasFullBorder", true);
1466 UIManager.put("TabbedPane.tabLayoutPolicy", "scroll");
1467 UIManager.put("TabbedPane.scrollButtonsPolicy", "asNeeded");
1468 UIManager.put("TabbedPane.smoothScrolling", true);
1469 UIManager.put("TabbedPane.tabWidthMode", "compact");
1470 UIManager.put("TabbedPane.selectedBackground", Color.white);
1471 UIManager.put("TabbedPane.background", new Color(236, 236, 236));
1472 UIManager.put("TabbedPane.hoverColor", Color.lightGray);
1475 Desktop.setLiveDragMode(Cache.getDefault("FLAT_LIVE_DRAG_MODE", true));
1479 private static boolean setMacLookAndFeel()
1481 boolean set = false;
1482 System.setProperty("com.apple.mrj.application.apple.menu.about.name",
1483 ChannelProperties.getProperty("app_name"));
1484 System.setProperty("apple.laf.useScreenMenuBar", "true");
1486 * broken native LAFs on (ARM?) macbooks
1487 set = setQuaquaLookAndFeel();
1488 if ((!set) || !UIManager.getLookAndFeel().getClass().toString()
1489 .toLowerCase(Locale.ROOT).contains("quaqua"))
1491 set = setVaquaLookAndFeel();
1494 set = setFlatLookAndFeel();
1498 private static boolean setLinuxLookAndFeel()
1500 boolean set = false;
1501 set = setFlatLookAndFeel();
1503 set = setMetalLookAndFeel();
1504 // avoid GtkLookAndFeel -- not good results especially on HiDPI
1506 set = setNimbusLookAndFeel();
1511 private static void showUsage()
1514 "Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
1515 + "-nodisplay\tRun Jalview without User Interface.\n"
1516 + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
1517 + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
1518 + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
1519 + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
1520 + "-features FILE\tUse the given file to mark features on the alignment.\n"
1521 + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
1522 + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
1523 + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
1524 + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
1525 + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
1526 + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
1527 + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
1528 + "-json FILE\tCreate alignment file FILE in JSON format.\n"
1529 + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
1530 + "-png FILE\tCreate PNG image FILE from alignment.\n"
1531 + "-svg FILE\tCreate SVG image FILE from alignment.\n"
1532 + "-html FILE\tCreate HTML file from alignment.\n"
1533 + "-biojsMSA FILE\tCreate BioJS MSA Viewer HTML file from alignment.\n"
1534 + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
1535 + "-eps FILE\tCreate EPS file FILE from alignment.\n"
1536 + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
1537 + "-noquestionnaire\tTurn off questionnaire check.\n"
1538 + "-nonews\tTurn off check for Jalview news.\n"
1539 + "-nousagestats\tTurn off google analytics tracking for this session.\n"
1540 + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
1542 // "-setprop PROPERTY=VALUE\tSet the given Jalview property,
1543 // after all other properties files have been read\n\t
1544 // (quote the 'PROPERTY=VALUE' pair to ensure spaces are
1545 // passed in correctly)"
1546 + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
1547 + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
1548 + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
1549 + "-jvmmempc=PERCENT\tOnly available with standalone executable jar or jalview.bin.Launcher. Limit maximum heap size (memory) to PERCENT% of total physical memory detected. This defaults to 90 if total physical memory can be detected. See https://www.jalview.org/help/html/memory.html for more details.\n"
1550 + "-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"
1551 + "\n~Read documentation in Application or visit https://www.jalview.org for description of Features and Annotations file~\n\n");
1555 private static void startUsageStats(final Desktop desktop)
1558 * start a User Config prompt asking if we can log usage statistics.
1560 PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
1561 "USAGESTATS", "Jalview Usage Statistics",
1562 "Do you want to help make Jalview better by enabling "
1563 + "the collection of usage statistics with Google Analytics ?"
1564 + "\n\n(you can enable or disable usage tracking in the preferences)",
1571 "Initialising googletracker for usage stats.");
1572 Cache.initGoogleTracker();
1573 Console.debug("Tracking enabled.");
1580 Console.debug("Not enabling Google Tracking.");
1583 desktop.addDialogThread(prompter);
1587 * Locate the given string as a file and pass it to the groovy interpreter.
1589 * @param groovyscript
1590 * the script to execute
1591 * @param jalviewContext
1592 * the Jalview Desktop object passed in to the groovy binding as the
1595 protected void executeGroovyScript(String groovyscript, AlignFrame af)
1598 * for scripts contained in files
1605 if (groovyscript.trim().equals("STDIN"))
1607 // read from stdin into a tempfile and execute it
1610 tfile = File.createTempFile("jalview", "groovy");
1611 PrintWriter outfile = new PrintWriter(
1612 new OutputStreamWriter(new FileOutputStream(tfile)));
1613 BufferedReader br = new BufferedReader(
1614 new InputStreamReader(System.in));
1616 while ((line = br.readLine()) != null)
1618 outfile.write(line + "\n");
1624 } catch (Exception ex)
1626 System.err.println("Failed to read from STDIN into tempfile "
1627 + ((tfile == null) ? "(tempfile wasn't created)"
1628 : tfile.toString()));
1629 ex.printStackTrace();
1634 sfile = tfile.toURI().toURL();
1635 } catch (Exception x)
1638 "Unexpected Malformed URL Exception for temporary file created from STDIN: "
1640 x.printStackTrace();
1648 sfile = new URI(groovyscript).toURL();
1649 } catch (Exception x)
1651 tfile = new File(groovyscript);
1652 if (!tfile.exists())
1654 System.err.println("File '" + groovyscript + "' does not exist.");
1657 if (!tfile.canRead())
1659 System.err.println("File '" + groovyscript + "' cannot be read.");
1662 if (tfile.length() < 1)
1664 System.err.println("File '" + groovyscript + "' is empty.");
1669 sfile = tfile.getAbsoluteFile().toURI().toURL();
1670 } catch (Exception ex)
1672 System.err.println("Failed to create a file URL for "
1673 + tfile.getAbsoluteFile());
1680 Map<String, java.lang.Object> vbinding = new HashMap<>();
1681 vbinding.put("Jalview", this);
1684 vbinding.put("currentAlFrame", af);
1686 Binding gbinding = new Binding(vbinding);
1687 GroovyScriptEngine gse = new GroovyScriptEngine(new URL[] { sfile });
1688 gse.run(sfile.toString(), gbinding);
1689 if ("STDIN".equals(groovyscript))
1691 // delete temp file that we made -
1692 // only if it was successfully executed
1695 } catch (Exception e)
1697 System.err.println("Exception Whilst trying to execute file " + sfile
1698 + " as a groovy script.");
1699 e.printStackTrace(System.err);
1704 public static boolean isHeadlessMode()
1706 String isheadless = System.getProperty("java.awt.headless");
1707 if (isheadless != null && isheadless.equalsIgnoreCase("true"))
1714 public AlignFrame[] getAlignFrames()
1716 return desktop == null ? new AlignFrame[] { getCurrentAlignFrame() }
1717 : Desktop.getAlignFrames();
1722 * jalview.bin.Jalview.quit() will just run the non-GUI shutdownHook and exit
1726 // System.exit will run the shutdownHook first
1727 Jalview.exit("Quitting now. Bye!", 0);
1730 public static AlignFrame getCurrentAlignFrame()
1732 return Jalview.currentAlignFrame;
1735 public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
1737 Jalview.currentAlignFrame = currentAlignFrame;
1740 protected Commands getCommands()
1745 public static void exit(String message, int exitcode)
1747 if (Console.log == null)
1749 // Don't start the logger just to exit!
1750 if (message != null)
1754 System.out.println(message);
1758 System.err.println(message);
1764 Console.debug("Using Jalview.exit");
1765 if (message != null)
1769 Console.info(message);
1773 Console.error(message);
1779 System.exit(exitcode);
1783 /******************************
1785 * TEST OUTPUT METHODS
1787 ******************************/
1789 * method for reporting string values parsed/processed during tests
1792 protected static void testoutput(ArgParser ap, Arg a, String s1,
1795 BootstrapArgs bsa = ap.getBootstrapArgs();
1796 if (!bsa.getBoolean(Arg.TESTOUTPUT))
1798 if (!((s1 == null && s2 == null) || (s1 != null && s1.equals(s2))))
1800 Console.debug("testoutput with unmatching values '" + s1 + "' and '"
1801 + s2 + "' for arg " + a.argString());
1804 boolean isset = a.hasOption(Opt.BOOTSTRAP) ? bsa.contains(a)
1808 Console.warn("Arg '" + a.getName() + "' not set at all");
1811 testoutput(true, a, s1, s2);
1815 * method for reporting string values parsed/processed during tests
1818 protected static void testoutput(BootstrapArgs bsa, Arg a, String s1,
1821 if (!bsa.getBoolean(Arg.TESTOUTPUT))
1823 if (!((s1 == null && s2 == null) || (s1 != null && s1.equals(s2))))
1825 Console.debug("testoutput with unmatching values '" + s1 + "' and '"
1826 + s2 + "' for arg " + a.argString());
1829 if (!a.hasOption(Opt.BOOTSTRAP))
1831 Console.error("Non-bootstrap Arg '" + a.getName()
1832 + "' given to testoutput(BootstrapArgs bsa, Arg a, String s1, String s2) with only BootstrapArgs");
1834 if (!bsa.contains(a))
1836 Console.warn("Arg '" + a.getName() + "' not set at all");
1839 testoutput(true, a, s1, s2);
1843 * report value set for string values parsed/processed during tests
1845 private static void testoutput(boolean yes, Arg a, String s1, String s2)
1847 if (yes && ((s1 == null && s2 == null)
1848 || (s1 != null && s1.equals(s2))))
1850 System.out.println("[TESTOUTPUT] arg " + a.argString() + "='" + s1
1856 * testoutput for boolean values
1858 protected static void testoutput(ArgParser ap, Arg a)
1862 BootstrapArgs bsa = ap.getBootstrapArgs();
1865 if (!bsa.getBoolean(Arg.TESTOUTPUT))
1867 boolean val = a.hasOption(Opt.BOOTSTRAP) ? bsa.getBoolean(a)
1869 boolean isset = a.hasOption(Opt.BOOTSTRAP) ? bsa.contains(a)
1873 Console.warn("Arg '" + a.getName() + "' not set at all");
1879 protected static void testoutput(BootstrapArgs bsa, Arg a)
1881 if (!bsa.getBoolean(Arg.TESTOUTPUT))
1883 if (!a.hasOption(Opt.BOOTSTRAP))
1885 Console.warn("Non-bootstrap Arg '" + a.getName()
1886 + "' given to testoutput(BootstrapArgs bsa, Arg a) with only BootstrapArgs");
1889 if (!bsa.contains(a))
1891 Console.warn("Arg '" + a.getName() + "' not set at all");
1894 testoutput(bsa.getBoolean(a), a);
1897 private static void testoutput(boolean yes, Arg a)
1899 System.out.println("[TESTOUTPUT] arg "
1900 + (yes ? a.argString() : a.negateArgString()) + " was set");