X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=02e53ecf395534900bf2792fbccec1e51dfa3dd6;hb=bb1629fd423f5ce90ca1a951f10e9183fbbbc8d0;hp=cda02fcd4ebe15fe98bc1c3f39d47bd84f5523f2;hpb=e2e71a31f26f128c939d2ca2758a897f28174a37;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index cda02fc..02e53ec 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -41,8 +41,6 @@ import jalview.util.MessageManager; import jalview.util.Platform; import jalview.ws.jws2.Jws2Discoverer; -import java.awt.Image; -import java.awt.Taskbar; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; @@ -66,6 +64,8 @@ import java.util.Vector; import javax.swing.LookAndFeel; import javax.swing.UIManager; +import com.threerings.getdown.util.LaunchUtil; + import groovy.lang.Binding; import groovy.util.GroovyScriptEngine; @@ -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,6 +202,8 @@ public class Jalview System.out.println(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version")); + // report Jalview version + Cache.loadBuildProperties(true); ArgsParser aparser = new ArgsParser(args); boolean headless = false; @@ -306,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")) { @@ -325,10 +328,10 @@ 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", false)) + if (Cache.getDefault("USE_FULL_SO", true)) { SequenceOntologyFactory.setInstance(new SequenceOntology()); } @@ -338,26 +341,17 @@ public class Jalview desktop = new Desktop(); desktop.setInBatchMode(true); // indicate we are starting up - if (Taskbar.isTaskbarSupported()) + try { - Taskbar tb = Taskbar.getTaskbar(); - if (tb.isSupported(Taskbar.Feature.ICON_IMAGE)) - { - try - { - java.net.URL url = getClass() - .getResource("/images/JalviewLogo_Huge.png"); - if (url != null) - { - Image image = java.awt.Toolkit.getDefaultToolkit() - .createImage(url); - tb.setIconImage(image); - } - } catch (Exception e) - { - e.printStackTrace(); - } - } + JalviewTaskbar.setTaskbar(this); + } catch (Exception e) + { + System.out.println("Cannot set Taskbar"); + // e.printStackTrace(); + } catch (Throwable t) + { + System.out.println("Cannot set Taskbar"); + // t.printStackTrace(); } desktop.setVisible(true); @@ -412,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; @@ -562,9 +575,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) { @@ -898,10 +910,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) { @@ -988,7 +1000,7 @@ public class Jalview } try { - Map vbinding = new HashMap<>(); + Map vbinding = new HashMap<>(); vbinding.put("Jalview", this); if (af != null) { @@ -1030,8 +1042,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() {