// Also check annotation label widths
if (includeAnnotations && al.getAlignmentAnnotation() != null)
{
- fm = c.getFontMetrics(getAlabels().getFont());
-
- for (i = 0; i < al.getAlignmentAnnotation().length; i++)
+ if (Jalview.isHeadlessMode())
+ {
+ AnnotationLabels aal = this.getAlabels();
+ int stringWidth = aal.drawLabels(null, false, idWidth, false, fm);
+ idWidth = Math.max(idWidth, stringWidth);
+ }
+ else
{
- AlignmentAnnotation aa = al.getAlignmentAnnotation()[i];
- if (visibleOnly && !aa.visible)
+ fm = c.getFontMetrics(getAlabels().getFont());
+
+ for (i = 0; i < al.getAlignmentAnnotation().length; i++)
{
- continue;
+ AlignmentAnnotation aa = al.getAlignmentAnnotation()[i];
+ if (visibleOnly && !aa.visible)
+ {
+ continue;
+ }
+ String label = aa.label;
+ int stringWidth = fm.stringWidth(label);
+ idWidth = Math.max(idWidth, stringWidth);
}
- String label = aa.label;
- int stringWidth = fm.stringWidth(label);
- idWidth = Math.max(idWidth, stringWidth);
}
}
// not be called directly by programs.
// I note that addNotify() is called in several areas of Jalview.
- int annotationHeight = getAnnotationPanel().adjustPanelHeight();
- annotationHeight = getAnnotationPanel()
- .adjustForAlignFrame(adjustPanelHeight, annotationHeight);
+ AnnotationPanel ap = getAnnotationPanel();
+ int annotationHeight = ap.adjustPanelHeight();
+ annotationHeight = ap.adjustForAlignFrame(adjustPanelHeight,
+ annotationHeight);
hscroll.addNotify();
annotationScroller.setPreferredSize(
annotationSpaceFillerHolder.getWidth(), annotationHeight));
annotationScroller.validate();
annotationScroller.addNotify();
+ ap.validate();
}
/**
}
int w = getIdPanel().getWidth();
+ w = this.calculateIdWidth(-1, true, true).width;
return (w > 0 ? w : calculateIdWidth().width);
}
final int borderBottomOffset = 5;
AlignmentDimension aDimension = getAlignmentDimension();
+
// todo use a lambda function in place of callback here?
ImageWriterI writer = new ImageWriterI()
{