From: gmungoc Date: Mon, 29 Jun 2020 09:22:35 +0000 (+0100) Subject: JAL-3390 respect 'hidden chains' on redisplay after superposition X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=990c7b35fef576a3b2ae28dcf86cf775630bd455;p=jalview.git JAL-3390 respect 'hidden chains' on redisplay after superposition --- 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(); - } } /**