X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;fp=src%2Fjalview%2Fbin%2FJalview.java;h=ca2a5845fa306051b2c33f2980045444970d51b8;hb=6a05eb3f55d97e685f0c723822384633d5636778;hp=61f0f8a9634c6398555a14702e98d4d9f9bf4954;hpb=d113749a183a3ea8f3f7e22c725511f59f1d833f;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 61f0f8a..ca2a584 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -107,7 +107,7 @@ public class Jalview perms.add(new AllPermission()); return (perms); } - + @Override public void refresh() { @@ -124,8 +124,8 @@ public class Jalview class FeatureFetcher { /* - * TODO: generalise to track all jalview events to orchestrate batch - * processing events. + * TODO: generalise to track all jalview events to orchestrate batch processing + * events. */ private int queued = 0; @@ -183,7 +183,7 @@ public class Jalview * main class for Jalview application * * @param args - * open filename + * open filename */ public static void main(String[] args) { @@ -202,24 +202,9 @@ public class Jalview System.out.println(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version")); + // report Jalview version + Cache.loadBuildProperties(true); - String appdirString = System.getProperty("getdownappdir"); - if (appdirString != null && appdirString.length() > 0) - { - final File appdir = new File(appdirString); - new Thread() - { - @Override - public void run() - { - LaunchUtil.upgradeGetdown( - new File(appdir, "getdown-launcher-old.jar"), - new File(appdir, "getdown-launcher.jar"), - new File(appdir, "getdown-launcher-new.jar")); - } - }.start(); - - } ArgsParser aparser = new ArgsParser(args); boolean headless = false; @@ -323,8 +308,9 @@ public class Jalview "Failed to set QuaQua look and feel: " + e.toString()); } } - if (lookAndFeel == null || !(lookAndFeel.getClass() - .isAssignableFrom(UIManager.getLookAndFeel().getClass())) + if (lookAndFeel == null + || !(lookAndFeel.getClass().isAssignableFrom( + UIManager.getLookAndFeel().getClass())) || !UIManager.getLookAndFeel().getClass().toString() .toLowerCase().contains("quaqua")) { @@ -342,8 +328,8 @@ public class Jalview } /* - * configure 'full' SO model if preferences say to, - * else use the default (SO Lite) + * configure 'full' SO model if preferences say to, else use the default (SO + * Lite) */ if (Cache.getDefault("USE_FULL_SO", true)) { @@ -420,6 +406,25 @@ public class Jalview BioJsHTMLOutput.updateBioJS(); } + // Move any new getdown-launcher-new.jar into place over old + // getdown-launcher.jar + String appdirString = System.getProperty("getdownappdir"); + if (appdirString != null && appdirString.length() > 0) + { + final File appdir = new File(appdirString); + new Thread() + { + @Override + public void run() + { + LaunchUtil.upgradeGetdown( + new File(appdir, "getdown-launcher-old.jar"), + new File(appdir, "getdown-launcher.jar"), + new File(appdir, "getdown-launcher-new.jar")); + } + }.start(); + } + String file = null, data = null; FileFormatI format = null; DataSourceType protocol = null; @@ -436,91 +441,6 @@ public class Jalview System.out.println("No files to open!"); System.exit(1); } - String vamsasImport = aparser.getValue("vdoc"); - String vamsasSession = aparser.getValue("vsess"); - if (vamsasImport != null || vamsasSession != null) - { - if (desktop == null || headless) - { - System.out.println( - "Headless vamsas sessions not yet supported. Sorry."); - System.exit(1); - } - // if we have a file, start a new session and import it. - boolean inSession = false; - if (vamsasImport != null) - { - 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(); - } - } - } long progress = -1; // Finally, deal with the remaining input data. if (file != null) @@ -570,9 +490,8 @@ public class Jalview { data.replaceAll("%20", " "); - ColourSchemeI cs = ColourSchemeProperty - .getColourScheme(af.getViewport(), - af.getViewport().getAlignment(), data); + ColourSchemeI cs = ColourSchemeProperty.getColourScheme( + af.getViewport(), af.getViewport().getAlignment(), data); if (cs != null) { @@ -757,7 +676,7 @@ public class Jalview // And the user // //////////////////// - if (!headless && file == null && vamsasImport == null + if (!headless && file == null && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)) { file = jalview.bin.Cache.getDefault("STARTUP_FILE", @@ -863,10 +782,6 @@ public class Jalview // passed in correctly)" + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n" + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n" - // + - // "-vdoc vamsas-document\tImport vamsas document into new - // session or join existing session with same URN\n" - // + "-vses vamsas-session\tJoin session with given URN\n" + "-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" + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n"); } @@ -906,10 +821,10 @@ public class Jalview * Locate the given string as a file and pass it to the groovy interpreter. * * @param groovyscript - * the script to execute + * the script to execute * @param jalviewContext - * the Jalview Desktop object passed in to the groovy binding as the - * 'Jalview' object. + * the Jalview Desktop object passed in to the groovy + * binding as the 'Jalview' object. */ private void executeGroovyScript(String groovyscript, AlignFrame af) { @@ -1038,8 +953,8 @@ public class Jalview } /** - * Quit method delegates to Desktop.quit - unless running in headless mode - * when it just ends the JVM + * Quit method delegates to Desktop.quit - unless running in headless mode when + * it just ends the JVM */ public void quit() {