X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;fp=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=da784208d9aceae920bc2fe9b3ff82c40db8afc5;hb=2e9e0527943d0c42a6059ebbb8e7e69346c38206;hp=5e209e6569970c260d95410ebd1c853e4b0a37b0;hpb=e4843176d8337fc165c1b93ae6c161cb29521f6d;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 5e209e6..da78420 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -147,6 +147,20 @@ public class AppletFormatAdapter public AlignmentI readFile(String file, DataSourceType sourceType, FileFormatI fileFormat) throws IOException { + if (alignFile == null) + { + prepareFileReader(file, sourceType, fileFormat); + } + else + { + alignFile.parse(); + } + return buildAlignmentFromFile(); + } + + public void prepareFileReader(String file, DataSourceType sourceType, + FileFormatI fileFormat) throws IOException + { this.inFile = file; try { @@ -176,10 +190,9 @@ public class AppletFormatAdapter } else { - // alignFile = fileFormat.getAlignmentFile(inFile, sourceType); alignFile = fileFormat.getReader(new FileParse(inFile, sourceType)); } - return buildAlignmentFromFile(); + return; } catch (Exception e) { e.printStackTrace(); @@ -200,7 +213,7 @@ public class AppletFormatAdapter // Possible sequence is just residues with no label alignFile = new FastaFile(">UNKNOWN\n" + inFile, DataSourceType.PASTE); - return buildAlignmentFromFile(); + return; } catch (Exception ex) {