X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=56efe53acf2c44a2525d6449723bd309176d7f8f;hb=6081884ff7c5a50b2a9f6615f7a864bdc5699bf2;hp=241e0a3776c94e9d497663f8512bb32f5856ec50;hpb=15c3c0e89d9157187e1ccc6962b115cb255dd04a;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 241e0a3..56efe53 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -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); } @@ -1213,7 +1218,13 @@ public class AnnotationLabels extends JPanel { // If no manual adjustment to ID column with has been made then adjust // width match widest of alignment or annotation id widths + boolean allowShrink = Cache.getDefault("ALLOW_SHRINK_ID_WIDTH", + false); width = Math.max(alignmentIdWidth, newAnnotationIdWidth); + if (clip && width < givenWidth && !allowShrink) + { + width = givenWidth; + } } else if (newAnnotationIdWidth != annotationIdWidth && newAnnotationIdWidth > givenWidth @@ -1233,10 +1244,7 @@ public class AnnotationLabels extends JPanel } else { - Graphics2D g2d = (Graphics2D) g; - Graphics dummy = g2d.create(); - int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, - null); + int newAnnotationIdWidth = drawLabels(g, clip, width, false, null); width = Math.max(newAnnotationIdWidth, givenWidth); } drawLabels(g, clip, width, true, null); @@ -1260,9 +1268,28 @@ public class AnnotationLabels extends JPanel * @param fmetrics * FontMetrics if Graphics object g is null */ - public int drawLabels(Graphics g, boolean clip, int width, + public int drawLabels(Graphics g0, boolean clip, int width, boolean actuallyDraw, FontMetrics fmetrics) { + if (clip) + { + clip = Cache.getDefault("MOVE_SEQUENCE_ID_WITH_VISIBLE_ANNOTATIONS", + true); + } + Graphics g = null; + // create a dummy Graphics object if not drawing and one is supplied + if (g0 != null) + { + if (!actuallyDraw) + { + Graphics2D g2d = (Graphics2D) g0; + g = g2d.create(); + } + else + { + g = g0; + } + } int actualWidth = 0; if (g != null) {