From 7f09e6ac5717bc78373c5d77f309831403e6ebf8 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 20 Sep 2023 12:17:17 +0100 Subject: [PATCH] JAL-4265 Added saveState and restoreState to interface with no-op methods in abstract class --- src/jalview/ext/jmol/JmolCommands.java | 2 ++ src/jalview/structure/StructureCommandsBase.java | 16 ++++++++++++++++ src/jalview/structure/StructureCommandsI.java | 4 ++++ 3 files changed, 22 insertions(+) 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); } -- 1.7.10.2