From fa25baa61ac89d1bba5eccf6fe3df85928191706 Mon Sep 17 00:00:00 2001 From: James Procter Date: Fri, 20 Oct 2023 14:17:18 +0100 Subject: [PATCH] JAL-4307 also report molecule name in tooltip for show/hide HETATM --- src/jalview/ext/jmol/JalviewJmolBinding.java | 4 ++-- src/jalview/gui/StructureViewerBase.java | 8 +++++--- src/jalview/structures/models/AAStructureBindingModel.java | 8 ++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 5b931e1..9d49a93 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -192,7 +192,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // @Override - public List getHetatmNames() + public Map getHetatmNames() { HashMap hetlist=new HashMap(); for (int mc=0;mc hetatmNames) + void setHetatmMenuItems(Map hetatmNames) { hetatmMenu.removeAll(); if (hetatmNames == null || hetatmNames.isEmpty()) @@ -660,9 +661,10 @@ public abstract class StructureViewerBase extends GStructureViewer hetatmMenu.add(noneMenuItem); hetatmMenu.add(allMenuItem); - for (String chain : hetatmNames) + for (Map.Entry chain : hetatmNames.entrySet()) { - JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(chain, false); + JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(chain.getKey(), false); + menuItem.setToolTipText(chain.getValue()); menuItem.addItemListener(new ItemListener() { @Override diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index 55955a8..9c8afdf 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -2008,8 +2008,12 @@ public abstract class AAStructureBindingModel return 0; } - public List getHetatmNames() { - return Collections.EMPTY_LIST; + /** + * list the ligands available for display/hiding in the current view + * @return HETATM CODE:Molecule name + */ + public Map getHetatmNames() { + return Collections.EMPTY_MAP; } /** * Generates and executes a command to show the given hetatm types as CPK -- 1.7.10.2