X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=ece610a85113dadd2974f9580d03f74e7e3260a0;hb=07df1587079d0e87b9913464e453cd585cf4b0f1;hp=88b359f8c965f4ca5996d35c102dab05789806aa;hpb=1d0f5219658cdf6ad5e1a1cbe6e1bb8cd12e6d85;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 88b359f..ece610a 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -52,11 +52,6 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.security.AllPermission; -import java.security.CodeSource; -import java.security.PermissionCollection; -import java.security.Permissions; -import java.security.Policy; import java.util.HashMap; import java.util.Map; import java.util.Vector; @@ -64,6 +59,8 @@ import java.util.Vector; import javax.swing.LookAndFeel; import javax.swing.UIManager; +import com.sun.xml.ws.policy.Policy; + import groovy.lang.Binding; import groovy.util.GroovyScriptEngine; @@ -96,6 +93,8 @@ public class Jalview static { // grab all the rights we can the JVM + Policy.createEmptyPolicy(); + /* Policy.setPolicy(new Policy() { @Override @@ -105,12 +104,13 @@ public class Jalview perms.add(new AllPermission()); return (perms); } - + @Override public void refresh() { } }); + */ } /** @@ -335,6 +335,18 @@ public class Jalview { desktop = new Desktop(); desktop.setInBatchMode(true); // indicate we are starting up + + try + { + JalviewTaskbar.setTaskbar(this); + } catch (Exception e) + { + e.printStackTrace(); + } catch (Throwable t) + { + t.printStackTrace(); + } + desktop.setVisible(true); desktop.startServiceDiscovery(); if (!aparser.contains("nousagestats")) @@ -391,10 +403,7 @@ public class Jalview FileFormatI format = null; DataSourceType protocol = null; FileLoader fileLoader = new FileLoader(!headless); - Vector getFeatures = null; // vector of das source nicknames to - // fetch - // features from - // loading is done. + String groovyscript = null; // script to execute after all loading is // completed one way or another // extract groovy argument and execute if necessary @@ -626,27 +635,6 @@ public class Jalview // TODO - load PDB structure(s) to alignment JAL-629 // (associate with identical sequence in alignment, or a specified // sequence) - - getFeatures = checkDasArguments(aparser); - if (af != null && getFeatures != null) - { - FeatureFetcher ff = startFeatureFetching(getFeatures); - if (ff != null) - { - while (!ff.allFinished() || af.operationInProgress()) - { - // wait around until fetching is finished. - try - { - Thread.sleep(100); - } catch (Exception e) - { - - } - } - } - getFeatures = null; // have retrieved features - forget them now. - } if (groovyscript != null) { // Execute the groovy script after we've done all the rendering stuff @@ -788,20 +776,9 @@ public class Jalview startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol, format); - getFeatures = checkDasArguments(aparser); // extract groovy arguments before anything else. } - // If the user has specified features to be retrieved, - // or a groovy script to be executed, do them if they - // haven't been done already - // fetch features for the default alignment - if (getFeatures != null) - { - if (startUpAlframe != null) - { - startFeatureFetching(getFeatures); - } - } + // Once all other stuff is done, execute any groovy scripts (in order) if (groovyscript != null) { @@ -864,9 +841,6 @@ public class Jalview // (quote the 'PROPERTY=VALUE' pair to ensure spaces are // passed in correctly)" + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n" - + "-dasserver nickname=URL\tAdd and enable a das server with given nickname\n\t\t\t(alphanumeric or underscores only) for retrieval of features for all alignments.\n" - + "\t\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n" - + "\t\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n" + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n" // + // "-vdoc vamsas-document\tImport vamsas document into new @@ -1001,7 +975,7 @@ public class Jalview } try { - Map vbinding = new HashMap<>(); + Map vbinding = new HashMap<>(); vbinding.put("Jalview", this); if (af != null) { @@ -1025,94 +999,6 @@ public class Jalview } } - /** - * Check commandline for any das server definitions or any fetchfrom switches - * - * @return vector of DAS source nicknames to retrieve from - */ - private static Vector checkDasArguments(ArgsParser aparser) - { - Vector source = null; - String data; - String locsources = Cache.getProperty(Cache.DAS_LOCAL_SOURCE); - while ((data = aparser.getValue("dasserver", true)) != null) - { - String nickname = null; - String url = null; - int pos = data.indexOf('='); - // determine capabilities - if (pos > 0) - { - nickname = data.substring(0, pos); - } - url = data.substring(pos + 1); - if (url != null && (url.startsWith("http:") - || url.startsWith("sequence:http:"))) - { - if (nickname == null) - { - nickname = url; - } - if (locsources == null) - { - locsources = ""; - } - else - { - locsources += "\t"; - } - locsources = locsources + nickname + "|" + url; - System.err.println( - "NOTE! dasserver parameter not yet really supported (got args of " - + nickname + "|" + url); - if (source == null) - { - source = new Vector<>(); - } - source.addElement(nickname); - } - System.out.println( - "CMD [-dasserver " + data + "] executed successfully!"); - } // loop until no more server entries are found. - if (locsources != null && locsources.indexOf('|') > -1) - { - Cache.log.debug("Setting local source list in properties file to:\n" - + locsources); - Cache.setProperty(Cache.DAS_LOCAL_SOURCE, locsources); - } - while ((data = aparser.getValue("fetchfrom", true)) != null) - { - System.out.println("adding source '" + data + "'"); - if (source == null) - { - source = new Vector<>(); - } - source.addElement(data); - } - return source; - } - - /** - * start a feature fetcher for every alignment frame - * - * @param dasSources - */ - private FeatureFetcher startFeatureFetching( - final Vector dasSources) - { - FeatureFetcher ff = new FeatureFetcher(); - AlignFrame afs[] = Desktop.getAlignFrames(); - if (afs == null || afs.length == 0) - { - return null; - } - for (int i = 0; i < afs.length; i++) - { - ff.addFetcher(afs[i], dasSources); - } - return ff; - } - public static boolean isHeadlessMode() { String isheadless = System.getProperty("java.awt.headless");