From: gmungoc Date: Thu, 28 May 2020 17:27:31 +0000 (+0100) Subject: JAL-2422 correct ChimeraX save/open session commands; check for null X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~56^2~2 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=639070f3bd8d2e1502952c54d58ab3ff95538431 JAL-2422 correct ChimeraX save/open session commands; check for null --- diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index 90bdb6b..6df5ab9 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -125,7 +125,8 @@ public class ChimeraXCommands extends ChimeraCommands public StructureCommandI saveSession(String filepath) { // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/save.html - return new StructureCommand("save session " + filepath); + // note ChimeraX will append ".cxs" to the filepath! + return new StructureCommand("save " + filepath + " format session"); } /** @@ -226,6 +227,6 @@ public class ChimeraXCommands extends ChimeraCommands public StructureCommandI openSession(String filepath) { // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/open.html#composite - return new StructureCommand("open session:" + filepath); + return new StructureCommand("open " + filepath + " format session"); } } diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index 870a761..dcd6da8 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -1245,6 +1245,10 @@ public abstract class AAStructureBindingModel { AlignmentViewPanel ap = (avp == null) ? getViewer().getAlignmentPanel() : avp; + if (ap == null) + { + return null; + } return ap.getAlignViewport().isShowSequenceFeatures() ? ap.getFeatureRenderer() : null;