Merge branch 'develop' into feature/JAL-244_Automatically_adjust_left_margin_to_avoid...
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 241e0a3..c4a40d8 100755 (executable)
@@ -515,8 +515,10 @@ public class AnnotationLabels extends JPanel
           public void actionPerformed(ActionEvent e)
           {
             sel_row.setShowGroupsForContactMatrix(chitem.getState());
-            ap.getAnnotationPanel()
-                    .paint(ap.getAnnotationPanel().getGraphics());
+            // so any annotation colour changes are propagated - though they
+            // probably won't be unless the annotation row colours are removed
+            // too!
+            ap.alignmentChanged();
           }
         });
         pop.add(chitem);
@@ -562,7 +564,10 @@ public class AnnotationLabels extends JPanel
                                 "action.clustering_matrix_for",
                                 cm.getAnnotDescr(), 5f),
                         progBar = System.currentTimeMillis());
-                cm.setGroupSet(GroupSet.makeGroups(cm, 5f, true));
+                cm.setGroupSet(GroupSet.makeGroups(cm, true));
+                cm.randomlyReColourGroups();
+                cm.transferGroupColorsTo(alignmentAnnotation);
+                ap.alignmentChanged();
                 ap.alignFrame.showContactMapTree(alignmentAnnotation, cm);
                 ap.alignFrame.setProgressBar(null, progBar);
               }