jnetfile can be loaded onto alignment
authoramwaterhouse <Andrew Waterhouse>
Tue, 29 Aug 2006 15:22:15 +0000 (15:22 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 29 Aug 2006 15:22:15 +0000 (15:22 +0000)
src/jalview/gui/AlignFrame.java

index cd26b17..807b6e3 100755 (executable)
@@ -2818,17 +2818,35 @@ public void drop(DropTargetDropEvent evt)
    public void loadJalviewDataFile(String file)
   {
     try{
+      String protocol = "File";
+
+      if (file.indexOf("http:") > -1 || file.indexOf("file:") > -1)
+      {
+        protocol = "URL";
+      }
+
       boolean isAnnotation = new AnnotationFile().readAnnotationFile(viewport.
           alignment, file);
 
       if (!isAnnotation)
       {
-        boolean isGroupsFile = parseFeaturesFile(file,
-                                                AppletFormatAdapter.FILE);
+        boolean isGroupsFile = parseFeaturesFile(file,protocol);
         if (!isGroupsFile)
         {
-          String format = new IdentifyFile().Identify(file, FormatAdapter.FILE);
-          new FileLoader().LoadFile(viewport, file, FormatAdapter.FILE, format);
+          String format = new IdentifyFile().Identify(file, protocol);
+
+          if(format.equalsIgnoreCase("JnetFile"))
+          {
+            jalview.io.JPredFile predictions = new jalview.io.JPredFile(
+                file, protocol);
+            new JnetAnnotationMaker().add_annotation(predictions,
+                viewport.getAlignment(),
+                0, false);
+            alignPanel.adjustAnnotationHeight();
+            alignPanel.repaint();
+          }
+          else
+            new FileLoader().LoadFile(viewport, file, protocol, format);
         }
       }
       else