X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;fp=src%2Fjalview%2Fbin%2FJalview.java;h=642efdbd372d512ba9bf799fe450036e42c8c4e9;hb=91f5bc8371da7a2c3330477d0b4c716e5fd27dec;hp=b5ec365644b51aed02e29ef698e6ef53e8b466d3;hpb=ba1ea2deefe026b1b862de72aed232060dd92c7c;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index b5ec365..642efdb 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -727,17 +727,37 @@ public class Jalview af.createEPS(outputFile); continue; } - - af.saveAlignment(file, format); - if (af.isSaveAlignmentSuccessful()) + FileFormatI outFormat = null; + try + { + outFormat = FileFormats.getInstance().forName(outputFormat); + } catch (Exception formatP) { - System.out.println("Written alignment in " + format - + " format to " + file); + System.out.println("Couldn't parse " + outFormat + + " as a valid Jalview format string."); } - else + if (outFormat != null) { - System.out.println("Error writing file " + file + " in " - + format + " format!!"); + if (!outFormat.isWritable()) + { + System.out.println( + "This version of Jalview does not support alignment export as " + + outputFormat); + } + else + { + af.saveAlignment(file, outFormat); + if (af.isSaveAlignmentSuccessful()) + { + System.out.println("Written alignment in " + + outFormat.getName() + " format to " + file); + } + else + { + System.out.println("Error writing file " + file + " in " + + outFormat.getName() + " format!!"); + } + } } }