From: gmungoc Date: Wed, 7 Aug 2019 15:56:17 +0000 (+0100) Subject: JAL-3390 showSelectedChains pulled up to base class for Jmol/Chimera X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a663c1c844de90b4c125dbbcf5c8b953b00a809d;p=jalview.git JAL-3390 showSelectedChains pulled up to base class for Jmol/Chimera --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 2a9a698..d820273 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -133,9 +133,12 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } /** - * prepare the view for a given set of models/chains. chainList contains - * strings of the form 'pdbfilename:Chaincode' + * prepare the view for a given set of models/chains. chainList contains strings + * of the form 'pdbfilename:Chaincode' + * + * @deprecated now only used by applet code */ + @Deprecated public void centerViewer() { StringBuilder cmd = new StringBuilder(128); @@ -1440,10 +1443,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel { cmd.append("hide *;"); - AtomSpecModel model = getShownResidues(av); - String atomSpec = JmolCommands.getAtomSpec(model); + AtomSpecModel model = getShownResidues(av); + String atomSpec = JmolCommands.getAtomSpec(model); - cmd.append("display ").append(atomSpec); + cmd.append("display ").append(atomSpec); } else { @@ -1452,7 +1455,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel cmd.append("; cartoon"); if (refocus) { - cmd.append("; zoom 100"); + cmd.append("; zoom 0"); } evalStateCommand(cmd.toString()); } diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 9179be6..205c33b 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -259,13 +259,6 @@ public class AppJmol extends StructureViewerBase } @Override - void showSelectedChains() - { - setSelectedChains(); - jmb.centerViewer(); - } - - @Override public void closeViewer(boolean closeExternalViewer) { // Jmol does not use an external viewer diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 1a5ed5e..71e90d9 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -357,20 +357,6 @@ public class ChimeraViewFrame extends StructureViewerBase } /** - * Show only the selected chain(s) in the viewer - */ - @Override - void showSelectedChains() - { - setSelectedChains(); - - /* - * refresh display without resizing - easier to see what changed - */ - jmb.showStructures(getAlignmentPanel().getAlignViewport(), false); - } - - /** * Close down this instance of Jalview's Chimera viewer, giving the user the * option to close the associated Chimera window (process). They may wish to * keep it open until they have had an opportunity to save any work. diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index 2ffcee1..d04d1d6 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -556,8 +556,6 @@ public abstract class StructureViewerBase extends GStructureViewer } } - abstract void showSelectedChains(); - /** * Action on selecting one of Jalview's registered colour schemes */ @@ -1069,4 +1067,21 @@ public abstract class StructureViewerBase extends GStructureViewer toFront(); } + @Override + public abstract AAStructureBindingModel getBinding(); + + /** + * Show only the selected chain(s) in the viewer + */ + protected void showSelectedChains() + { + setSelectedChains(); + + /* + * refresh display without resizing - easier to see what changed + */ + getBinding().showStructures(getAlignmentPanel().getAlignViewport(), + false); + } + } diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index 47e7f30..8a7c355 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -108,7 +108,7 @@ public abstract class AAStructureBindingModel * a list of chains "pdbid:chainid" to show in the viewer; * empty means show all */ - // TODO make private once showStructures() deals with this + // TODO make private once deprecated JalviewJmolBinding.centerViewer removed protected List chainsToShow; private boolean hideHiddenRegions;