JAL-1067, JAL-1105 - refactor parser to fit Jalview's data parsing architecture
[jalview.git] / src / jalview / gui / AlignFrame.java
index 6896fb7..198c3bd 100755 (executable)
@@ -3945,12 +3945,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
              
              try 
              {
-                 TCoffeeScoreFile result = TCoffeeScoreFile.load(new File(sFilePath));
-                 if( result == null ) { 
-                      // TODO: raise a dialog box here rather than bomb out.
-                 
-                         throw new RuntimeException("The file provided does not match the T-Coffee scores file format"); 
-                 }
+                 TCoffeeScoreFile result = new TCoffeeScoreFile(sFilePath, FormatAdapter.FILE);
+                 if (!result.isValid()) { 
+                   JOptionPane.showMessageDialog(Desktop.desktop, result.getWarningMessage(),
+                            "Problem reading T-COFFEE score file", JOptionPane.WARNING_MESSAGE);
+                   return;
+                   }
 
                  /*
                   * check that the score matrix matches the alignment dimensions