+ * Load a File into this AlignViewport attempting to detect format if not
+ * given or given as null.
+ *
+ * @param file
+ * @param format
+ */
+ public void addFile(File file, FileFormatI format)
+ {
+ addFile(file, format, true);
+ }
+
+ public void addFile(File file, FileFormatI format, boolean async)
+ {
+ DataSourceType protocol = AppletFormatAdapter.checkProtocol(file);
+
+ if (format == null)
+ {
+ try
+ {
+ format = new IdentifyFile().identify(file, protocol);
+ } catch (FileFormatException e1)
+ {
+ jalview.bin.Console.error("Unknown file format for '" + file + "'");
+ }
+ }
+ else if (FileFormats.getInstance().isIdentifiable(format))
+ {
+ try
+ {
+ format = new IdentifyFile().identify(file, protocol);
+ } catch (FileFormatException e)
+ {
+ jalview.bin.Console.error("Unknown file format for '" + file + "'",
+ e);
+ }
+ }
+
+ new FileLoader().LoadFile(this, file, DataSourceType.FILE, format,
+ async);
+ }
+
+ public void addFile(File file)
+ {
+ addFile(file, null);
+ }
+
+ /**