X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=b560c5f2b46c9fe2032532938f71dace35acba40;hb=4882f6845b3a82307f68ccc376d36a2f4c884720;hp=4fe822d0a2a4d71eaf0a6b910237289202e15332;hpb=1d1edb58c9ee8baec12686a512eb18d97b9bdba1;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 4fe822d..b560c5f 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -53,6 +53,7 @@ import java.util.stream.Collectors; import javax.swing.JDialog; import javax.swing.JFrame; +import javax.swing.JInternalFrame; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; @@ -78,6 +79,7 @@ import jalview.gui.Desktop; import jalview.gui.PromptUserConfig; import jalview.gui.QuitHandler; import jalview.gui.QuitHandler.QResponse; +import jalview.gui.StructureViewerBase; import jalview.io.AppletFormatAdapter; import jalview.io.BioJsHTMLOutput; import jalview.io.DataSourceType; @@ -394,7 +396,7 @@ public class Jalview // 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( @@ -444,11 +446,29 @@ public class Jalview public void run() { Console.debug("Running shutdown hook"); + QuitHandler.startForceQuit(); + boolean closeExternal = Cache + .getDefault("DEFAULT_CLOSE_EXTERNAL_VIEWERS", false) + || Cache.getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false); + StructureViewerBase.setQuitClose(closeExternal); + if (desktop != null) + { + for (JInternalFrame frame : Desktop.desktop.getAllFrames()) + { + if (frame instanceof StructureViewerBase) + { + ((StructureViewerBase) frame).closeViewer(closeExternal); + } + } + } + if (QuitHandler.gotQuitResponse() == QResponse.CANCEL_QUIT) { // Got to here by a SIGTERM signal. // Note we will not actually cancel the quit from here -- it's too - // late -- but we can wait for saving files. + // late -- but we can wait for saving files and close external viewers + // if configured. + // Close viewers/Leave viewers open Console.debug("Checking for saving files"); QuitHandler.getQuitResponse(false); } @@ -462,7 +482,7 @@ public class Jalview }); 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 @@ -515,17 +535,17 @@ public class Jalview Jalview.exit(null, 0); } - if (bootstrapArgs.contains(Arg.HEADLESS)) + // new CLI + headlessArg = bootstrapArgs.isHeadless(); + if (headlessArg) { System.setProperty("java.awt.headless", "true"); - // new - headlessArg = bootstrapArgs.getBoolean(Arg.HEADLESS); } + // old CLI if (aparser.contains("nodisplay") || aparser.contains("nogui") || aparser.contains("headless")) { System.setProperty("java.awt.headless", "true"); - // old headless = true; } // anything else! @@ -533,7 +553,7 @@ public class Jalview // 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) @@ -625,7 +645,7 @@ public class Jalview 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(); @@ -754,8 +774,8 @@ public class Jalview 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(); } @@ -1246,7 +1266,12 @@ public class Jalview } if (!lafSet) { - setSystemLookAndFeel(); + // Flatlaf default for everyone! + lafSet = setFlatLookAndFeel(); + if (!lafSet) + { + setSystemLookAndFeel(); + } if (Platform.isLinux()) { setLinuxLookAndFeel(); @@ -1443,6 +1468,8 @@ public class Jalview UIManager.put("TabbedPane.smoothScrolling", true); UIManager.put("TabbedPane.tabWidthMode", "compact"); UIManager.put("TabbedPane.selectedBackground", Color.white); + UIManager.put("TabbedPane.background", new Color(236, 236, 236)); + UIManager.put("TabbedPane.hoverColor", Color.lightGray); } Desktop.setLiveDragMode(Cache.getDefault("FLAT_LIVE_DRAG_MODE", true)); @@ -1753,8 +1780,14 @@ public class Jalview } } - /* - * 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) @@ -1778,6 +1811,10 @@ public class Jalview 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) { @@ -1802,6 +1839,9 @@ public class Jalview 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)