From 990c7b35fef576a3b2ae28dcf86cf775630bd455 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 29 Jun 2020 10:22:35 +0100 Subject: [PATCH] JAL-3390 respect 'hidden chains' on redisplay after superposition --- .../structures/models/AAStructureBindingModel.java | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index e7aac1c..e7f879c 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -929,9 +929,11 @@ public abstract class AAStructureBindingModel /* * Show all as backbone before doing superposition(s) * (residues used for matching will be shown as ribbon) + * while remembering to hide any chains unselected for display */ // todo better way to ensure synchronous than setting getReply true!! executeCommands(commandGenerator.showBackbone(), true, null); + hideHiddenChains(); /* * superpose each (other) structure to the reference in turn @@ -1300,10 +1302,21 @@ public abstract class AAStructureBindingModel StructureCommandI cmd = getCommandGenerator().showStructures(model); executeCommand(cmd, false); - /* - * and hide any chains selected _not_ to be shown - * (whether mapped to sequence in the alignment or not) - */ + hideHiddenChains(); + + if (refocus) + { + focusView(); + } + } + + /** + * Hides any chains selected _not_ to be shown + * (whether mapped to sequence in the alignment or not) + */ + protected void hideHiddenChains() + { + StructureCommandI cmd; for (String pdbChain : chainsToHide) { String modelNo = getModelIdForFile(getFileForChain(pdbChain)); @@ -1314,11 +1327,6 @@ public abstract class AAStructureBindingModel executeCommand(cmd, false); } } - - if (refocus) - { - focusView(); - } } /** -- 1.7.10.2