JAL-1761 pattern for structure viewer construction from project file
[jalview.git] / src / jalview / ext / jmol / JmolCommands.java
index 99130b4..085fbd5 100644 (file)
@@ -41,6 +41,7 @@ import jalview.structure.StructureCommandsBase;
 import jalview.structure.StructureMapping;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.Comparison;
+import jalview.util.Platform;
 
 /**
  * Routines for generating Jmol commands for Jalview/Jmol binding
@@ -291,7 +292,9 @@ public class JmolCommands extends StructureCommandsBase
   @Override
   public StructureCommandI loadFile(String file)
   {
-    return null;
+    // https://chemapps.stolaf.edu/jmol/docs/#loadfiles
+    return new StructureCommand("load FILES \"" + 
+            Platform.escapeBackslashes(file) + "\"");
   }
 
   /**
@@ -466,4 +469,10 @@ public class JmolCommands extends StructureCommandsBase
 
     return sb;
   }
+
+  @Override
+  public StructureCommandI openSession(String filepath)
+  {
+    return loadFile(filepath);
+  }
 }