import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
int startSeq, int pageHeight)
{
+ drawIdsWrapped(g, alignViewport, startSeq, pageHeight, -1);
+ }
+
+ void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
+ int startSeq, int pageHeight, int idWidth)
+ {
int alignmentWidth = alignViewport.getAlignment().getWidth();
final int alheight = alignViewport.getAlignment().getHeight();
if (labels != null && alignViewport.isShowAnnotation())
{
g.translate(0, ypos + (alheight * charHeight));
- labels.drawComponent(g, getWidth());
+ int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,
+ null);
+ int thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth;
+ if (thisIdWidth > getWidth())
+ {
+ this.setPreferredSize(
+ new Dimension(this.getHeight(), thisIdWidth));
+ this.repaint();
+ }
+ labels.drawComponent(g, false, thisIdWidth);
g.translate(0, -ypos - (alheight * charHeight));
}