JAL-4134 popup menu and annotation row property to control display of display of...
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index e3cc36e..f4c37fd 100755 (executable)
@@ -432,6 +432,25 @@ public class AnnotationLabels extends JPanel
         {
           pop.addSeparator();
 
+          if (cm.hasGroups())
+          {
+            JCheckBoxMenuItem chitem = new JCheckBoxMenuItem("Show Groups on Matrix");
+            boolean showGroups = aa[selectedRow].isShowGroupsForContactMatrix();
+            final AlignmentAnnotation sel_row=aa[selectedRow];
+            chitem.setState(showGroups);
+            chitem.addActionListener(new ActionListener()
+            {
+
+              @Override
+              public void actionPerformed(ActionEvent e)
+              {
+                sel_row.setShowGroupsForContactMatrix(chitem.getState());
+                ap.getAnnotationPanel()
+                .paint(ap.getAnnotationPanel().getGraphics());
+              }
+            });
+            pop.add(chitem);
+          }
           if (cm.hasTree())
           {
             item = new JMenuItem("Show Tree for Matrix");