JAL-969 - refactor colourscheme machinery from GUI code to core alignment view model
[jalview.git] / src / jalview / bin / Jalview.java
index 5357e81..272250e 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -318,9 +318,14 @@ public class Jalview
         }
       }
     }
+    long progress=-1;
     // Finally, deal with the remaining input data.
     if (file != null)
     {
+      if (!headless)
+      {
+        desktop.setProgressBar("Processing commandline arguments...", progress=System.currentTimeMillis());
+      }
       System.out.println("Opening file: " + file);
 
       if (!file.startsWith("http://"))
@@ -334,10 +339,6 @@ public class Jalview
           }
         }
       }
-      if (!headless)
-      {
-        desktop.setProgressBar("Processing commandline arguments...", Jalview.class.hashCode());
-      }
 
       protocol = jalview.io.AppletFormatAdapter.checkProtocol(file);
 
@@ -510,8 +511,15 @@ public class Jalview
             && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
     {
       file = jalview.bin.Cache.getDefault("STARTUP_FILE",
-              jalview.bin.Cache.getDefault("www.jalview.org", "http://www.jalview.org")+"/examples/exampleFile_2_3.jar");
-
+              jalview.bin.Cache.getDefault("www.jalview.org", "http://www.jalview.org")+"/examples/exampleFile_2_7.jar");
+      if (file.equals("http://www.jalview.org/examples/exampleFile_2_3.jar"))
+      {
+        // hardwire upgrade of the startup file
+        file.replace("_2_3.jar","_2_7.jar");
+        // and remove the stale setting 
+        jalview.bin.Cache.removeProperty("STARTUP_FILE");
+      }
+      
       protocol = "File";
 
       if (file.indexOf("http:") > -1)
@@ -562,7 +570,9 @@ public class Jalview
     // and finally, turn off batch mode indicator - if the desktop still exists
     if (desktop != null)
     {
-      desktop.setProgressBar(null, Jalview.class.hashCode());
+      if (progress!=-1) {
+        desktop.setProgressBar(null, progress);
+      }
       desktop.setInBatchMode(false);
     }
   }