X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=7dc263bdf6261ec8e148bacf7bba6000c82b66ca;hb=2526066acdc3faf3a178e50672c78e428287e9ef;hp=d3d4d6e49ad81c26d9ac1aac38e116a00a92229d;hpb=65a810f2dd78c44eef0f06bc0afbe3ad3e891848;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index d3d4d6e..7dc263b 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -29,6 +29,7 @@ import jalview.datamodel.AlignmentView; import jalview.util.MessageManager; import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -205,6 +206,10 @@ public class AppletFormatAdapter public static final boolean isValidFormat(String format, boolean forwriting) { + if (format == null) + { + return false; + } boolean valid = false; String[] format_list = (forwriting) ? WRITEABLE_FORMATS : READABLE_FORMATS; @@ -339,7 +344,10 @@ public class AppletFormatAdapter ex.printStackTrace(); } } - + if (format.equalsIgnoreCase("HTML")) + { + throw new IOException(e.getMessage()); + } // If we get to this stage, the format was not supported throw new java.io.IOException(SUPPORTED_FORMATS); } @@ -483,7 +491,7 @@ public class AppletFormatAdapter private AlignmentI buildAlignmentFrom(AlignFile alignFile2) { // Standard boilerplate for creating alignment from parser - alignFile.configureForView(viewpanel); + // alignFile.configureForView(viewpanel); AlignmentI al = new Alignment(alignFile.getSeqsAsArray()); @@ -519,7 +527,7 @@ public class AppletFormatAdapter aselview.addAnnotation(aa); } } - + viewpanel = ap; return formatSequences(format, aselview, jvsuffix); } @@ -597,11 +605,10 @@ public class AppletFormatAdapter { throw new Exception(MessageManager.getString("error.implementation_error_unknown_file_format_string")); } + afile.setNewlineString(newline); afile.addJVSuffix(jvsuffix); - afile.setExportSettings(exportSettings); - afile.configureForView(viewpanel); // check whether we were given a specific alignment to export, rather than