Further tweaks to get tests passing
[jalview.git] / src / jalview / io / FileFormat.java
index 770f762..a43bc22 100644 (file)
@@ -1,5 +1,6 @@
 package jalview.io;
 
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.PDBEntry;
 import jalview.ext.jmol.JmolParser;
 import jalview.structure.StructureImportSettings;
@@ -29,7 +30,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new FastaFile();
     }
@@ -51,7 +52,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new PfamFile();
     }
@@ -72,9 +73,9 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
-      return new StockholmFile();
+      return new StockholmFile(al);
     }
 
   },
@@ -95,7 +96,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new PIRFile();
     }
@@ -115,7 +116,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new BLCFile();
     }
@@ -137,9 +138,9 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
-      return new BLCFile();
+      return new AMSAFile(al);
     }
   },
   Html("HTML", "html", true, false)
@@ -157,7 +158,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new HtmlFile();
     }
@@ -184,7 +185,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new RnamlFile();
     }
@@ -205,7 +206,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new JSONFile();
     }
@@ -232,7 +233,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new PileUpfile();
     }
@@ -253,7 +254,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new MSFfile();
     }
@@ -274,7 +275,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new ClustalFile();
     }
@@ -296,7 +297,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new PhylipFile();
     }
@@ -322,7 +323,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return null; // todo is this called?
     }
@@ -345,7 +346,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new FeaturesFile();
     }
@@ -408,7 +409,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new JmolParser(); // todo or null?
     }
@@ -439,7 +440,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return new JmolParser(); // todo or null?
     }
@@ -462,7 +463,7 @@ public enum FileFormat implements FileFormatI
     }
 
     @Override
-    public AlignmentFileI getAlignmentFile()
+    public AlignmentFileI getAlignmentFile(AlignmentI al)
     {
       return null;
     }
@@ -533,12 +534,6 @@ public enum FileFormat implements FileFormatI
     return false;
   }
 
-  @Override
-  public String getShortDescription()
-  {
-    return toString();
-  }
-
   /**
    * Returns the file format with the given name, or null if format is null or
    * invalid. Unlike valueOf(), this is not case-sensitive, to be kind to
@@ -595,4 +590,10 @@ public enum FileFormat implements FileFormatI
   {
     return name;
   }
+
+  @Override
+  public AlignmentFileI getAlignmentFile()
+  {
+    return getAlignmentFile((AlignmentI) null);
+  }
 }