X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=cc41c534d9899d85b3e4f8b5a6fe0d7723e0ee85;hb=16d109024847af92482237e43f99b82fd997451a;hp=ea2f1d6ca96d410cfc0ac23ecb66a12b1124e398;hpb=b483c2012e40cab4b38f650dc049c94efe7e27c2;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index ea2f1d6..cc41c53 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -70,7 +70,14 @@ import groovy.util.GroovyScriptEngine; /** * Main class for Jalview Application
*
- * start with java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview + * start with: java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" \ + * jalview.bin.Jalview + * + * or on Windows: java -classpath "$PATH_TO_LIB$/*;$PATH_TO_CLASSES$" \ + * jalview.bin.Jalview jalview.bin.Jalview + * + * (ensure -classpath arg is quoted to avoid shell expansion of '*' and do not + * embellish '*' to e.g. '*.jar') * * @author $author$ * @version $Revision$ @@ -264,7 +271,7 @@ public class Jalview { error.printStackTrace(); System.out.println("\nEssential logging libraries not found." - + "\nUse: java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview"); + + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview"); System.exit(0); } @@ -384,10 +391,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 @@ -534,7 +538,8 @@ public class Jalview data.replaceAll("%20", " "); ColourSchemeI cs = ColourSchemeProperty - .getColourScheme(af.getViewport().getAlignment(), data); + .getColourScheme(af.getViewport(), + af.getViewport().getAlignment(), data); if (cs != null) { @@ -618,27 +623,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 @@ -780,20 +764,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) { @@ -856,9 +829,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 @@ -1017,94 +987,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");