/**
* 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, annotation label widths are also accounted for
+ * @param includeAnnotations - when true includes width of any additional marks in annotation id panel
* @param visibleOnly - when true, ignore label widths for hidden annotation rows
* @return Dimension giving the maximum width of the alignment label panel
* that should be used.
if (!legacy || 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, !visibleOnly);
idWidth = Math.max(idWidth, stringWidth);
}
else
Graphics idGraphics, Graphics alignmentGraphics)
throws PrinterException
{
- final int idWidth = getVisibleIdWidth(false);
-
+ final int idWidth, idWidthForGui;
+ // otherwise calculate it
+ idWidth = getVisibleIdWidth(false);
+// if (getIdPanel()!=null && getIdPanel().getWidth()>0)
+// {
+// // use the current IdPanel's width, if its set and non-zero
+// idWidthForGui = getIdPanel().getWidth();
+// } else {
+// idWidthForGui=0;
+// }
/*
* Get the horizontal offset to where we draw the sequences.
* This is idWidth if using a single Graphics context, else zero.
}
final int alignmentDrawnHeight = (endSeq - startSeq) * charHeight + 3;
+ alignmentGraphics.setColor(Color.white);
+ alignmentGraphics.fillRect(0, 0, pageWidth, pageHeight+scaleHeight);
+
/*
* draw the Scale at horizontal offset, then reset to top left (0, 0)
*/
IdCanvas idCanvas = getIdPanel().getIdCanvas();
List<SequenceI> selection = av.getSelectionGroup() == null ? null
: av.getSelectionGroup().getSequences(null);
+
idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1,
- selection, false);
+ selection, false,idWidth);
idGraphics.setFont(av.getFont());
idGraphics.translate(0, -scaleHeight);
// see if rendering offscreen - check preferences and calc width accordingly
if (!onscreen && Cache.getDefault("FIGURE_AUTOIDWIDTH", false))
{
- return calculateIdWidth(-1).width;
+ return calculateIdWidth(-1,true,true).width;
}
Integer idwidth = onscreen ? null
: Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH");
throws ImageOutputException
{
makeAlignmentImage(type, file, renderer,
- BitmapImageSizing.nullBitmapImageSizing());
+ BitmapImageSizing.defaultBitmapImageSizing());
}
/**