X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=f01bfdc97fc579c2c8d9415d11bfdb84bec43e69;hb=d3bf4ae12b72df02dee34c95da750ab38a3816b9;hp=4c25634fd0e396b48eff069451d2e2dfedbf7a34;hpb=c945c9641de88cad01b09b3db19e45667dfe751e;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 4c25634..f01bfdc 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -20,7 +20,7 @@ */ package jalview.io; -import jalview.api.AlignExportSettingI; +import jalview.api.AlignExportSettingsI; import jalview.api.AlignmentViewPanel; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; @@ -30,6 +30,7 @@ import jalview.datamodel.PDBEntry.Type; import jalview.datamodel.SequenceI; import jalview.ext.jmol.JmolParser; import jalview.structure.StructureImportSettings; +import jalview.util.Platform; import java.io.File; import java.io.IOException; @@ -73,7 +74,7 @@ public class AppletFormatAdapter */ protected String newline = System.getProperty("line.separator"); - private AlignExportSettingI exportSettings; + private AlignExportSettingsI exportSettings; private File selectedFile; @@ -100,7 +101,7 @@ public class AppletFormatAdapter } public AppletFormatAdapter(AlignmentViewPanel alignPanel, - AlignExportSettingI settings) + AlignExportSettingsI settings) { viewpanel = alignPanel; exportSettings = settings; @@ -157,9 +158,7 @@ public class AppletFormatAdapter { this.selectedFile = selectedFile; - if (selectedFile != null) - this.inFile = selectedFile.getPath(); - this.inFile = file; + inFile = (selectedFile == null ? file : selectedFile.getPath()); try { if (fileFormat.isStructureFile()) @@ -178,9 +177,9 @@ public class AppletFormatAdapter } else { - // todo is MCview parsing obsolete yet? JAL-2120 + // todo is mc_view parsing obsolete yet? JAL-2120 StructureImportSettings.setShowSeqFeatures(true); - alignFile = new MCview.PDBfile(annotFromStructure, + alignFile = new mc_view.PDBfile(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, inFile, sourceType); } @@ -265,7 +264,7 @@ public class AppletFormatAdapter else { StructureImportSettings.setShowSeqFeatures(true); - alignFile = new MCview.PDBfile(annotFromStructure, + alignFile = new mc_view.PDBfile(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, source); } ((StructureFile) alignFile).setDbRefType(Type.PDB); @@ -434,7 +433,9 @@ public class AppletFormatAdapter public static DataSourceType checkProtocol(Object dataObject) { if(dataObject instanceof File) + { return DataSourceType.FILE; + } String data = dataObject.toString(); DataSourceType protocol = DataSourceType.PASTE; @@ -444,7 +445,7 @@ public class AppletFormatAdapter { protocol = DataSourceType.URL; } - else if (jalview.bin.Jalview.isJS) + else if (Platform.isJS()) { protocol = DataSourceType.RELATIVE_URL; } @@ -455,6 +456,10 @@ public class AppletFormatAdapter return protocol; } + /** + * @param args + * @j2sIgnore + */ public static void main(String[] args) { int i = 0;