From e72d0b60b3078d4afed714491600efce110f0336 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Wed, 8 Feb 2017 15:30:42 +0000 Subject: [PATCH] JAL-2405 set context on selection group for tailored colour options --- src/jalview/appletgui/APopupMenu.java | 1 + src/jalview/gui/PopupMenu.java | 3 ++- src/jalview/viewmodel/AlignmentViewport.java | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 4ae0ed2..dd1e089 100644 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -243,6 +243,7 @@ public class APopupMenu extends java.awt.PopupMenu implements SequenceGroup sg = ap.av.getSelectionGroup(); if (sg != null && sg.getSize() > 0) { + conservationColour.setEnabled(!sg.isNucleotide()); editGroupName.setLabel(MessageManager.formatMessage( "label.name_param", new Object[] { sg.getName() })); showText.setState(sg.getDisplayText()); diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index c94d24d..81c3d4f 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -414,7 +414,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener add(menuItem); } - } SequenceGroup sg = ap.av.getSelectionGroup(); @@ -428,6 +427,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener ColourMenuHelper.setColourSelected(colourMenu, sg.getColourScheme()); + conservationMenuItem.setEnabled(!sg.isNucleotide()); + if (sg.cs != null) { if (sg.cs.conservationApplied()) diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 230864e..e5c7b4c 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1083,6 +1083,10 @@ public abstract class AlignmentViewport implements AlignViewportI, public void setSelectionGroup(SequenceGroup sg) { selectionGroup = sg; + if (sg != null) + { + sg.setContext(alignment); + } } public void setHiddenColumns(ColumnSelection colsel) -- 1.7.10.2