Merge branch 'develop' into features/filetypeEnum
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index be042e6..1738f99 100644 (file)
@@ -32,8 +32,9 @@ import jalview.datamodel.Annotation;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SearchResults;
 import jalview.datamodel.SequenceI;
+import jalview.ext.jmol.JmolParser;
 import jalview.gui.IProgressIndicator;
-import jalview.io.AppletFormatAdapter;
+import jalview.io.DataSourceType;
 import jalview.io.StructureFile;
 import jalview.util.MappingUtils;
 import jalview.util.MessageManager;
@@ -316,14 +317,14 @@ public class StructureSelectionManager
    *          (may be nill, individual elements may be nill)
    * @param pdbFile
    *          - structure data resource
-   * @param protocol
+   * @param paste
    *          - how to resolve data from resource
    * @return null or the structure data parsed as a pdb file
    */
   synchronized public StructureFile setMapping(SequenceI[] sequence,
-          String[] targetChains, String pdbFile, String protocol)
+          String[] targetChains, String pdbFile, DataSourceType paste)
   {
-    return setMapping(true, sequence, targetChains, pdbFile, protocol);
+    return setMapping(true, sequence, targetChains, pdbFile, paste);
   }
 
 
@@ -341,14 +342,14 @@ public class StructureSelectionManager
    *          (may be nill, individual elements may be nill)
    * @param pdbFile
    *          - structure data resource
-   * @param protocol
+   * @param sourceType
    *          - how to resolve data from resource
    * @return null or the structure data parsed as a pdb file
    */
   synchronized public StructureFile setMapping(boolean forStructureView,
           SequenceI[] sequenceArray, String[] targetChainIds,
           String pdbFile,
-          String protocol)
+ DataSourceType sourceType)
   {
     /*
      * There will be better ways of doing this in the future, for now we'll use
@@ -391,17 +392,17 @@ public class StructureSelectionManager
                               .toString());
       if (isParseWithJMOL || (pdbFile != null && isCIFFile(pdbFile)))
       {
-        pdb = new jalview.ext.jmol.JmolParser(addTempFacAnnot, parseSecStr,
-                secStructServices, pdbFile, protocol);
+        pdb = new JmolParser(addTempFacAnnot, parseSecStr,
+                secStructServices, pdbFile, sourceType);
       }
       else
       {
         pdb = new PDBfile(addTempFacAnnot, parseSecStr, secStructServices,
-                pdbFile, protocol);
+                pdbFile, sourceType);
       }
 
       if (pdb.getId() != null && pdb.getId().trim().length() > 0
-              && AppletFormatAdapter.FILE.equals(protocol))
+              && sourceType == DataSourceType.FILE)
       {
         registerPDBFile(pdb.getId().trim(), pdbFile);
       }
@@ -496,7 +497,7 @@ public class StructureSelectionManager
         continue;
       }
 
-      if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
+      if (sourceType == DataSourceType.PASTE)
       {
         pdbFile = "INLINE" + pdb.getId();
       }