From 8e98fa5a09e06ac59c965d030ed71b0158178a24 Mon Sep 17 00:00:00 2001 From: BobHanson Date: Mon, 1 Jun 2020 22:27:37 -0500 Subject: [PATCH] SO option true for Java (from Jalview-JS/develop) --- src/jalview/bin/Jalview.java | 113 ++++-------------------------------------- 1 file changed, 9 insertions(+), 104 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index ab9b1d9..74babbb 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -474,7 +474,9 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi * configure 'full' SO model if preferences say to, * else use the default (SO Lite) */ - if (Cache.getDefault(Preferences.USE_FULL_SO, false)) + // BH NOTE 2020.06.01 Jalview-JS/develop has this true for Java, false for + // JavaScript + if (Cache.getDefault(Preferences.USE_FULL_SO, !isJS)) { SequenceOntologyFactory.setSequenceOntology(new SequenceOntology()); } @@ -562,7 +564,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi try { ArgsParser aparser = new ArgsParser(args); - return parseArguments(aparser, false); + parseArguments(aparser, false); + return null; } catch (Throwable t) { return t; @@ -573,9 +576,9 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi * * @param aparser * @param isStartup - * @return + * @return null, indicating no error */ - private Object parseArguments(ArgsParser aparser, boolean isStartup) + private void parseArguments(ArgsParser aparser, boolean isStartup) { boolean isJS = Platform.isJS(); @@ -599,7 +602,6 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi System.out.println("No files to open!"); System.exit(1); } - boolean haveImport = checkStartVamas(aparser); // Finally, deal with the remaining input data. long progress = -1; if (file == null && isJavaAppletTag) @@ -729,11 +731,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi "CMD [-open2 " + file2 + "] executed successfully!"); } } - setCurrentAlignFrame(af); - // TODO: file2 How to implement file2 for the applet spit screen? - data = aparser.getValue(ArgsParser.COLOUR, true); if (data != null) { @@ -885,12 +884,13 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } } } + AlignFrame startUpAlframe = null; // We'll only open the default file if the desktop is visible. // And the user // //////////////////// - if (!isJS && !headless && file == null && !haveImport + if (!isJS && !headless && file == null && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)) /** * Java only @@ -963,100 +963,6 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi desktop.setInBatchMode(false); } - return null; - } - - private boolean checkStartVamas(ArgsParser aparser) - { - String vamsasImport = aparser.getValue(ArgsParser.VDOC); - String vamsasSession = aparser.getValue(ArgsParser.VSESS); - if (vamsasImport == null && vamsasSession == null) - { - return false; - } - if (desktop == null || headless) - { - System.out.println( - "Headless vamsas sessions not yet supported. Sorry."); - System.exit(1); - } - boolean haveImport = (vamsasImport != null); - if (haveImport) - { - // if we have a file, start a new session and import it. - boolean inSession = false; - try - { - DataSourceType viprotocol = AppletFormatAdapter - .checkProtocol(vamsasImport); - if (viprotocol == DataSourceType.FILE) - { - inSession = desktop.vamsasImport(new File(vamsasImport)); - } - else if (viprotocol == DataSourceType.URL) - { - inSession = desktop.vamsasImport(new URL(vamsasImport)); - } - - } catch (Exception e) - { - System.err.println("Exeption when importing " + vamsasImport - + " as a vamsas document."); - e.printStackTrace(); - } - if (!inSession) - { - System.err.println("Failed to import " + vamsasImport - + " as a vamsas document."); - } - else - { - System.out.println("Imported Successfully into new session " - + desktop.getVamsasApplication().getCurrentSession()); - } - } - if (vamsasSession != null) - { - if (vamsasImport != null) - { - // close the newly imported session and import the Jalview specific - // remnants into the new session later on. - desktop.vamsasStop_actionPerformed(null); - } - // now join the new session - try - { - if (desktop.joinVamsasSession(vamsasSession)) - { - System.out.println( - "Successfully joined vamsas session " + vamsasSession); - } - else - { - System.err.println("WARNING: Failed to join vamsas session " - + vamsasSession); - } - } catch (Exception e) - { - System.err.println( - "ERROR: Failed to join vamsas session " + vamsasSession); - e.printStackTrace(); - } - if (vamsasImport != null) - { - // the Jalview specific remnants can now be imported into the new - // session at the user's leisure. - Cache.log.info( - "Skipping Push for import of data into existing vamsas session."); - // TODO: - // enable - // this - // when - // debugged - // desktop.getVamsasApplication().push_update(); - } - } - return haveImport; } /** @@ -1109,7 +1015,6 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi imageName = imageFile.getName(); HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel); htmlSVG.exportHTML(file); - System.out.println("Creating HTML image: " + file); continue; } -- 1.7.10.2