From: gmungoc Date: Wed, 8 Feb 2017 15:30:42 +0000 (+0000) Subject: JAL-2405 set context on selection group for tailored colour options X-Git-Tag: Release_2_10_3b1~355 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e72d0b60b3078d4afed714491600efce110f0336;p=jalview.git JAL-2405 set context on selection group for tailored colour options --- 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)