X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=a73405424d5743516bd7ae0325cadfdb209a439e;hb=0125a426aecc7065538a13f48236dc1e8d268044;hp=910c94720665a082c0180d8244e051112e57bbc6;hpb=f24dacb1da56fccf05d684e2f4899facec2aecf7;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 910c947..a734054 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -57,8 +57,11 @@ public class Jalview System.out.println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n" +"-nodisplay\tRun Jalview without User Interface.\n" +"-props FILE\tUse the given Jalview properties file instead of users default.\n" - +"-groups FILE\tUse the given file to mark groups on the alignment. \nGroups file is in the following tab delimited format\n" - +"TEXTSEQUENCE_IDSEQUENCE_INDEXSTART_RESIDUEEND_RESIDUECOLOUR\n" + +"-groups FILE\tUse the given file to mark groups on the alignment." + +"\nThe first lines of the groups file lists the GroupName and GroupColours" + +" to be used in the alignment. Use the GROUPNAME label for each of your sequences. " + +"\nGROUPNAMEGROUPCOLOUR\n" + +"TEXTSEQUENCE_IDSEQUENCE_INDEXSTART_RESIDUEEND_RESIDUEGROUPNAME\n" +"SequenceID is used in preference to SequenceIndex if both are provided.\n" +"Enter ID_NOT_SPECIFIED for SEQUENCE_ID or -1 for SEQUENCE_INDEX if unknown.\n" +"COLOUR can be hexadecimal RGB or 'red', 'blue' etc.\n\n" @@ -76,10 +79,12 @@ public class Jalview System.exit(0); } + Cache.loadProperties(aparser.getValue("props")); // must do this before anything else! if (aparser.contains("nodisplay")) + { System.setProperty("java.awt.headless", "true"); - + } if (System.getProperty("java.awt.headless") != null && System.getProperty("java.awt.headless").equals("true")) { @@ -99,8 +104,6 @@ public class Jalview System.exit(0); } - Cache.loadProperties(aparser.getValue("props")); - Desktop desktop = null; if( !headless ) { @@ -145,7 +148,8 @@ public class Jalview if (! (new java.io.File(file)).exists()) { System.out.println("Can't find " + file); - System.exit(1); + if(headless) + System.exit(1); } } @@ -159,7 +163,7 @@ public class Jalview if (file.endsWith(".jar")) format = "Jalview"; else - format = jalview.io.IdentifyFile.Identify(file, protocol); + format = new jalview.io.IdentifyFile().Identify(file, protocol); System.out.println("Opening: " + format + " file " + file); @@ -234,14 +238,10 @@ public class Jalview } else { - format = jalview.io.IdentifyFile.Identify(file, protocol); + format = new jalview.io.IdentifyFile().Identify(file, protocol); desktop.LoadFile(file, protocol, format); } } - - - if (desktop==null) - System.exit(0); } }