X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=bc2465a8023da9a86f9ee163fe1e5adc56abb9cc;hb=5969ead0fd401f4435a3435ede9e4e87cf9c1d0b;hp=3f51ea8ad019a84874aa4a71d2d1184a889e4d48;hpb=8875ec9fa2dcd7dcb494a1538ae61e3279ceb4aa;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 3f51ea8..bc2465a 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -75,6 +75,8 @@ public class AppletFormatAdapter private AlignExportSettingI exportSettings; + private File selectedFile; + public static String INVALID_CHARACTERS = "Contains invalid characters"; /** @@ -147,6 +149,16 @@ public class AppletFormatAdapter public AlignmentI readFile(String file, DataSourceType sourceType, FileFormatI fileFormat) throws IOException { + return readFile(null, file, sourceType, fileFormat); + } + + public AlignmentI readFile(File selectedFile, String file, DataSourceType sourceType, + FileFormatI fileFormat) throws IOException + { + + this.selectedFile = selectedFile; + if (selectedFile != null) + this.inFile = selectedFile.getPath(); this.inFile = file; try { @@ -161,6 +173,7 @@ public class AppletFormatAdapter localSecondaryStruct, serviceSecondaryStruct); if (isParseWithJMOL) { + // needs a File option alignFile = new JmolParser(inFile, sourceType); } else @@ -174,7 +187,9 @@ public class AppletFormatAdapter ((StructureFile) alignFile).setDbRefType( FileFormat.PDB.equals(fileFormat) ? Type.PDB : Type.MMCIF); } - else + else if (selectedFile != null) { + alignFile = fileFormat.getReader(new FileParse(selectedFile, sourceType)); + } else { // alignFile = fileFormat.getAlignmentFile(inFile, sourceType); alignFile = fileFormat.getReader(new FileParse(inFile, sourceType));