From: Ben Soares Date: Wed, 20 Sep 2023 11:17:17 +0000 (+0100) Subject: JAL-4265 Added saveState and restoreState to interface with no-op methods in abstract... X-Git-Tag: Release_2_11_4_0~174^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7f09e6ac5717bc78373c5d77f309831403e6ebf8;p=jalview.git JAL-4265 Added saveState and restoreState to interface with no-op methods in abstract class --- diff --git a/src/jalview/ext/jmol/JmolCommands.java b/src/jalview/ext/jmol/JmolCommands.java index e621ba5..01dac9b 100644 --- a/src/jalview/ext/jmol/JmolCommands.java +++ b/src/jalview/ext/jmol/JmolCommands.java @@ -501,11 +501,13 @@ public class JmolCommands extends StructureCommandsBase return null; // not an external viewer } + @Override public StructureCommandI saveState(String label) { return new StructureCommand("save STATE " + label); } + @Override public StructureCommandI restoreState(String label) { return new StructureCommand("restore STATE " + label); diff --git a/src/jalview/structure/StructureCommandsBase.java b/src/jalview/structure/StructureCommandsBase.java index 0b5874a..24b6539 100644 --- a/src/jalview/structure/StructureCommandsBase.java +++ b/src/jalview/structure/StructureCommandsBase.java @@ -26,6 +26,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import jalview.bin.Console; + /** * A base class holding methods useful to all classes that implement commands * for structure viewers @@ -275,4 +277,18 @@ public abstract class StructureCommandsBase implements StructureCommandsI { return null; } + + @Override + public StructureCommandI saveState(String label) + { + Console.debug("saveState not implemented"); + return null; + } + + @Override + public StructureCommandI restoreState(String label) + { + Console.debug("restoreState not implemented"); + return null; + } } diff --git a/src/jalview/structure/StructureCommandsI.java b/src/jalview/structure/StructureCommandsI.java index 575f256..2b3502d 100644 --- a/src/jalview/structure/StructureCommandsI.java +++ b/src/jalview/structure/StructureCommandsI.java @@ -245,4 +245,8 @@ public interface StructureCommandsI StructureCommandI getResidueAttributes(String attName); List centerViewOn(List residues); + + StructureCommandI saveState(String label); + + StructureCommandI restoreState(String label); }