file format enum wip changes
[jalview.git] / src / jalview / io / JalviewFileChooser.java
index 1ea6795..9ac6a35 100755 (executable)
@@ -153,7 +153,7 @@ public class JalviewFileChooser extends JFileChooser
     }
   }
 
-  public String getSelectedFormat()
+  public FileFormat getSelectedFormat()
   {
     if (getFileFilter() == null)
     {
@@ -161,41 +161,7 @@ public class JalviewFileChooser extends JFileChooser
     }
 
     String format = getFileFilter().getDescription();
-
-    if (format.toUpperCase().startsWith("JALVIEW"))
-    {
-      format = "Jalview";
-    }
-    else if (format.toUpperCase().startsWith("FASTA"))
-    {
-      format = "FASTA";
-    }
-    else if (format.toUpperCase().startsWith("MSF"))
-    {
-      format = "MSF";
-    }
-    else if (format.toUpperCase().startsWith("CLUSTAL"))
-    {
-      format = "CLUSTAL";
-    }
-    else if (format.toUpperCase().startsWith("BLC"))
-    {
-      format = "BLC";
-    }
-    else if (format.toUpperCase().startsWith("PIR"))
-    {
-      format = "PIR";
-    }
-    else if (format.toUpperCase().startsWith("PFAM"))
-    {
-      format = "PFAM";
-    }
-    else if (format.toUpperCase().startsWith(PhylipFile.FILE_DESC))
-    {
-      format = PhylipFile.FILE_DESC;
-    }
-
-    return format;
+    return FileFormat.valueOf(format);
   }
 
   @Override