X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=a3f7e0001b728b1644bd50213e940814411a120c;hb=1213d49ca3df8f48360da857121805d088c13aab;hp=d9d6b9f60b7dfe822223cd8910c46837c1c9cf05;hpb=772387bbccde43cd52ccfadb854d45b1c27f3324;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index d9d6b9f..a3f7e00 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -1211,7 +1211,7 @@ public class AnnotationLabels extends JPanel Graphics2D g2d = (Graphics2D) g; Graphics dummy = g2d.create(); int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, forGUI, - null); + null, false); dummy.dispose(); Dimension d = ap.calculateDefaultAlignmentIdWidth(); int alignmentIdWidth = d.width; @@ -1245,10 +1245,10 @@ public class AnnotationLabels extends JPanel } else { - int newAnnotationIdWidth = drawLabels(g, clip, width, false, forGUI, null); + int newAnnotationIdWidth = drawLabels(g, clip, width, false, forGUI, null, false); width = Math.max(newAnnotationIdWidth, givenWidth); } - drawLabels(g, clip, width, true, forGUI, null); + drawLabels(g, clip, width, true, forGUI, null, false); } /** @@ -1257,8 +1257,6 @@ public class AnnotationLabels extends JPanel * occur, but the widest label width will be returned. If g is null then * fmetrics must be supplied. * - * Returns the width of the annotation labels. - * * @param g * Graphics2D instance (used for rendering and font scaling if no fmetrics supplied) * @param clip @@ -1270,9 +1268,11 @@ public class AnnotationLabels extends JPanel * @param forGUI - when false, GUI relevant marks like indicators for dragging annotation panel height are not rendered * @param fmetrics * FontMetrics if Graphics object g is null + * @param includeHidden - when true returned width includes labels in hidden row width calculation + * @return the width of the annotation labels. */ public int drawLabels(Graphics g0, boolean clip, int width, - boolean actuallyDraw, boolean forGUI, FontMetrics fmetrics) + boolean actuallyDraw, boolean forGUI, FontMetrics fmetrics, boolean includeHidden) { if (clip) { @@ -1361,7 +1361,7 @@ public class AnnotationLabels extends JPanel for (int i = 0; i < aa.length; i++) { visible = true; - if (!aa[i].visible) + if (!aa[i].visible && !includeHidden) { hasHiddenRows = true; continue; @@ -1369,7 +1369,7 @@ public class AnnotationLabels extends JPanel olY = y; // look ahead to next annotation for (nexAA = i + 1; nexAA < aa.length - && !aa[nexAA].visible; nexAA++) + && (!aa[nexAA].visible && includeHidden); nexAA++) ; y += aa[i].height; if (clip)