Neeed to know protocol for annotation loading
[jalview.git] / src / jalview / bin / Jalview.java
index 2f76347..1116fe4 100755 (executable)
@@ -137,6 +137,7 @@ public class Jalview
 \r
           if(file!=null)\r
           {\r
+            System.out.println("Opening file: " + file);\r
 \r
             if (!file.startsWith("http://"))\r
             {\r
@@ -155,15 +156,23 @@ public class Jalview
               protocol = "URL";\r
             }\r
 \r
+\r
+\r
             if (file.endsWith(".jar"))\r
               format = "Jalview";\r
             else\r
               format = new jalview.io.IdentifyFile().Identify(file, protocol);\r
 \r
-            System.out.println("Opening: " + format + " file " + file);\r
+\r
 \r
             AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol, format);\r
 \r
+            if(af==null)\r
+            {\r
+              System.out.println("error");\r
+              return;\r
+            }\r
+\r
             data = aparser.getValue("colour");\r
             if(data!=null)\r
             {\r
@@ -271,13 +280,15 @@ public class Jalview
 \r
             if (file.endsWith(".jar"))\r
             {\r
-              new Jalview2XML().LoadJalviewAlign(file);\r
+              format = "Jalview";\r
             }\r
             else\r
             {\r
               format = new jalview.io.IdentifyFile().Identify(file, protocol);\r
-              new jalview.io.FileLoader().LoadFile(file, protocol, format);\r
             }\r
+\r
+            fileLoader.LoadFile(file, protocol, format);\r
+\r
           }\r
     }\r
 }\r