From: amwaterhouse Date: Thu, 7 Apr 2005 16:59:48 +0000 (+0000) Subject: check annotation label widths as well as id widths X-Git-Tag: Release_2_0~464 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bed54fafd288a7cf39f15262522b0f2503883479;p=jalview.git check annotation label widths as well as id widths --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 75729c3..c38b7dc 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -156,6 +156,20 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene i++; } + // Also check annotation label widths + i=0; + if(al.getAlignmentAnnotation()!=null) + { + fm = g.getFontMetrics(alabels.getFont()); + while (i < al.getAlignmentAnnotation().length) + { + String label = al.getAlignmentAnnotation()[i].label; + if (fm.stringWidth(label) > idWidth) + idWidth = fm.stringWidth(label); + i++; + } + } + return new Dimension(idWidth, 12); }