// get bootstrap properties (mainly for the logger level)
Properties bootstrapProperties = Cache
- .bootstrapProperties(bootstrapArgs.get(Arg.PROPS));
+ .bootstrapProperties(bootstrapArgs.getValue(Arg.PROPS));
// report Jalview version
Cache.loadBuildProperties(
.getDefault("DEFAULT_CLOSE_EXTERNAL_VIEWERS", false)
|| Cache.getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false);
StructureViewerBase.setQuitClose(closeExternal);
- for (JInternalFrame frame : Desktop.desktop.getAllFrames())
+ if (desktop != null)
{
- if (frame instanceof StructureViewerBase)
+ for (JInternalFrame frame : Desktop.desktop.getAllFrames())
{
- ((StructureViewerBase) frame).closeViewer(closeExternal);
+ if (frame instanceof StructureViewerBase)
+ {
+ ((StructureViewerBase) frame).closeViewer(closeExternal);
+ }
}
}
});
String usrPropsFile = bootstrapArgs.contains(Arg.PROPS)
- ? bootstrapArgs.get(Arg.PROPS)
+ ? bootstrapArgs.getValue(Arg.PROPS)
: aparser.getValue("props");
// if usrPropsFile == null, loadProperties will use the Channel
// preferences.file
}
// new CLI
- headlessArg = isHeadless(bootstrapArgs);
+ headlessArg = bootstrapArgs.isHeadless();
if (headlessArg)
{
System.setProperty("java.awt.headless", "true");
// allow https handshakes to download intermediate certs if necessary
System.setProperty("com.sun.security.enableAIAcaIssuers", "true");
- String jabawsUrl = bootstrapArgs.get(Arg.JABAWS);
+ String jabawsUrl = bootstrapArgs.getValue(Arg.JABAWS);
if (jabawsUrl == null)
jabawsUrl = aparser.getValue("jabaws");
if (jabawsUrl != null)
if (!(headless || headlessArg))
{
- Desktop.nosplash = "false".equals(bootstrapArgs.get(Arg.SPLASH))
+ Desktop.nosplash = "false".equals(bootstrapArgs.getValue(Arg.SPLASH))
|| aparser.contains("nosplash")
|| Cache.getDefault("SPLASH", "true").equals("false");
desktop = new Desktop();
if ((!aparser.contains("nonews")
&& Cache.getProperty("NONEWS") == null
- && !"false".equals(bootstrapArgs.get(Arg.NEWS)))
- || "true".equals(bootstrapArgs.get(Arg.NEWS)))
+ && !"false".equals(bootstrapArgs.getValue(Arg.NEWS)))
+ || "true".equals(bootstrapArgs.getValue(Arg.NEWS)))
{
desktop.checkForNews();
}
}
}
- /*
- * testoutput for string values
+ /******************************
+ *
+ * TEST OUTPUT METHODS
+ *
+ ******************************/
+ /**
+ * method for reporting string values parsed/processed during tests
+ *
*/
protected static void testoutput(ArgParser ap, Arg a, String s1,
String s2)
testoutput(true, a, s1, s2);
}
+ /**
+ * method for reporting string values parsed/processed during tests
+ */
+
protected static void testoutput(BootstrapArgs bsa, Arg a, String s1,
String s2)
{
testoutput(true, a, s1, s2);
}
+ /**
+ * report value set for string values parsed/processed during tests
+ */
private static void testoutput(boolean yes, Arg a, String s1, String s2)
{
if (yes && ((s1 == null && s2 == null)
System.out.println("[TESTOUTPUT] arg "
+ (yes ? a.argString() : a.negateArgString()) + " was set");
}
-
- private static boolean isHeadless(BootstrapArgs bootstrapArgs)
- {
- if (bootstrapArgs == null)
- {
- return false;
- }
- boolean isHeadless = false;
- if (bootstrapArgs.contains(Arg.GUI))
- {
- isHeadless = !bootstrapArgs.getBoolean(Arg.GUI);
- }
- else if (bootstrapArgs.contains(Arg.HEADLESS))
- {
- isHeadless = bootstrapArgs.getBoolean(Arg.HEADLESS);
- }
- else if (bootstrapArgs.argsHaveOption(Opt.OUTPUTFILE))
- {
- isHeadless = true;
- }
- return isHeadless;
- }
}