file format enum wip changes
[jalview.git] / src / jalview / appletgui / AppletJmol.java
index 8374721..18e7d1a 100644 (file)
  */
 package jalview.appletgui;
 
+import jalview.bin.JalviewLite;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
 import jalview.io.FileParse;
+import jalview.io.DataSourceType;
 import jalview.io.StructureFile;
 import jalview.schemes.BuriedColourScheme;
 import jalview.schemes.HelixColourScheme;
@@ -176,7 +177,7 @@ public class AppletJmol extends EmbmenuFrame implements
   }
 
   public AppletJmol(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
-          AlignmentPanel ap, String protocol)
+          AlignmentPanel ap, DataSourceType protocol)
   {
     this.ap = ap;
     jmb = new AppletJmolBinding(this, ap.getStructureSelectionManager(),
@@ -185,7 +186,7 @@ public class AppletJmol extends EmbmenuFrame implements
     jmb.setColourBySequence(true);
     if (pdbentry.getId() == null || pdbentry.getId().length() < 1)
     {
-      if (protocol.equals(AppletFormatAdapter.PASTE))
+      if (protocol == DataSourceType.PASTE)
       {
         pdbentry.setId("PASTED PDB"
                 + (chains == null ? "_" : chains.toString()));
@@ -196,7 +197,7 @@ public class AppletJmol extends EmbmenuFrame implements
       }
     }
 
-    if (jalview.bin.JalviewLite.debug)
+    if (JalviewLite.debug)
     {
       System.err
               .println("AppletJmol: PDB ID is '" + pdbentry.getId() + "'");
@@ -292,20 +293,20 @@ public class AppletJmol extends EmbmenuFrame implements
     });
     if (pdbentry.getProperty() == null)
     {
-      pdbentry.setProperty(new Hashtable());
-      pdbentry.getProperty().put("protocol", protocol);
+      pdbentry.setProperty(new Hashtable<String, String>());
+      pdbentry.getProperty().put("protocol", protocol.toString());
     }
     if (pdbentry.getFile() != null)
     {
       // import structure data from pdbentry.getFile based on given protocol
-      if (protocol.equals(AppletFormatAdapter.PASTE))
+      if (protocol == DataSourceType.PASTE)
       {
         // TODO: JAL-623 : correctly record file contents for matching up later
         // pdbentry.getProperty().put("pdbfilehash",""+pdbentry.getFile().hashCode());
         loadInline(pdbentry.getFile());
       }
-      else if (protocol.equals(AppletFormatAdapter.FILE)
-              || protocol.equals(AppletFormatAdapter.URL))
+      else if (protocol == DataSourceType.FILE
+              || protocol == DataSourceType.URL)
       {
         jmb.viewer.openFile(pdbentry.getFile());
       }