JAL-2405 set context on selection group for tailored colour options
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 8 Feb 2017 15:30:42 +0000 (15:30 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 8 Feb 2017 15:30:42 +0000 (15:30 +0000)
src/jalview/appletgui/APopupMenu.java
src/jalview/gui/PopupMenu.java
src/jalview/viewmodel/AlignmentViewport.java

index 4ae0ed2..dd1e089 100644 (file)
@@ -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());
index c94d24d..81c3d4f 100644 (file)
@@ -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())
index 230864e..e5c7b4c 100644 (file)
@@ -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)