From: James Procter Date: Thu, 2 Nov 2023 21:05:53 +0000 (+0000) Subject: Merge branch 'patch/JAL-3921_jmol_session_save' into develop X-Git-Tag: Release_2_11_3_0~3^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=21c97822fa6091216a9e018bf276f8243dcbc750;hp=04cefeebe4d5267638319c74fe68b8b9cc0bf37a;p=jalview.git Merge branch 'patch/JAL-3921_jmol_session_save' into develop --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 9d49a93..f51252c 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -156,7 +156,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel jmolHistory(false); if (lastCommand == null || !lastCommand.equals(cmd)) { - jmolScript(cmd + "\n"); + jmolScript(cmd + "\n",command.isWaitNeeded()); } jmolHistory(true); lastCommand = cmd; diff --git a/src/jalview/ext/jmol/JmolCommands.java b/src/jalview/ext/jmol/JmolCommands.java index 106d458..1fb8761 100644 --- a/src/jalview/ext/jmol/JmolCommands.java +++ b/src/jalview/ext/jmol/JmolCommands.java @@ -241,7 +241,9 @@ public class JmolCommands extends StructureCommandsBase /* * https://chemapps.stolaf.edu/jmol/docs/#writemodel */ - return new StructureCommand("write STATE \"" + filepath + "\""); + StructureCommand sc = new StructureCommand("write STATE \"" + filepath + "\""); + sc.setWaitNeeded(true); + return sc; } @Override diff --git a/src/jalview/structure/StructureCommand.java b/src/jalview/structure/StructureCommand.java index 5dab059..6e4c4e1 100644 --- a/src/jalview/structure/StructureCommand.java +++ b/src/jalview/structure/StructureCommand.java @@ -29,6 +29,7 @@ public class StructureCommand implements StructureCommandI private List parameters; + private boolean waitNeeded=false; public StructureCommand(String cmd, String... params) { command = cmd; @@ -40,7 +41,18 @@ public class StructureCommand implements StructureCommandI } } } - + + public void setWaitNeeded(boolean wait) + { + waitNeeded=wait; + } + + @Override + public boolean isWaitNeeded() + { + return waitNeeded; + } + @Override public void addParameter(String param) { diff --git a/src/jalview/structure/StructureCommandI.java b/src/jalview/structure/StructureCommandI.java index ba557a8..03b15fb 100644 --- a/src/jalview/structure/StructureCommandI.java +++ b/src/jalview/structure/StructureCommandI.java @@ -31,4 +31,6 @@ public interface StructureCommandI void addParameter(String param); boolean hasParameters(); + + default boolean isWaitNeeded() { return false; }; }