/**
* Calculate the width of the alignment labels based on the displayed names
- * and any bounds on label width set in preferences.
+ * and any bounds on label width set in preferences. Also includes annotations
+ * not actually visible.
+ *
+ * FIXME JAL-244 JAL-4091 - doesn't include sequence associated annotation
+ * label decorators and only called during tests
*
* @param maxwidth
* -1 or maximum width allowed for IdWidth
{
return calculateIdWidth(maxwidth, true, false);
}
-
+ /**
+ * Calculate the width of the alignment labels based on the displayed names
+ * and any bounds on label width set in preferences.
+ *
+ * @param maxwidth
+ * -1 or maximum width allowed for IdWidth
+ * @param includeAnnotations - when true includes width of any additional marks in annotation id panel
+ * @param visibleOnly -
+ * @return Dimension giving the maximum width of the alignment label panel
+ * that should be used.
+ */
public Dimension calculateIdWidth(int maxwidth,
boolean includeAnnotations, boolean visibleOnly)
{
if (Jalview.isHeadlessMode())
{
AnnotationLabels aal = getAlabels();
- int stringWidth = aal.drawLabels(null, false, idWidth, false, false, fm);
+ int stringWidth = aal.drawLabels(null, false, idWidth, false, false,
+ fm,false);
idWidth = Math.max(idWidth, stringWidth);
}
else
Graphics idGraphics, Graphics alignmentGraphics)
throws PrinterException
{
- final int idWidth = getVisibleIdWidth(false);
+ final int idWidth;
+ if (getIdPanel()!=null && getIdPanel().getWidth()>0)
+ {
+ // use the current IdPanel's width, if its set and non-zero
+ idWidth = getIdPanel().getWidth();
+ } else {
+ // otherwise calculate it
+ idWidth = getVisibleIdWidth(false);
+ }
/*
* Get the horizontal offset to where we draw the sequences.
throws ImageOutputException
{
makeAlignmentImage(type, file, renderer,
- BitmapImageSizing.nullBitmapImageSizing());
+ BitmapImageSizing.defaultBitmapImageSizing());
}
/**