public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber,
Graphics g, boolean clipToPage)
{
- getSeqPanel().seqCanvas.calculateWrappedGeometry(getWidth(),
- getHeight());
+ final SeqCanvas seqCanvas = getSeqPanel().seqCanvas;
+ seqCanvas.calculateWrappedGeometry(seqCanvas.getWidth(),
+ seqCanvas.getHeight());
int annotationHeight = 0;
if (av.isShowAnnotation())
{
int maxwidth = av.getAlignment().getVisibleWidth();
- int resWidth = getSeqPanel().seqCanvas
+ int resWidth = seqCanvas
.getWrappedCanvasWidth(pageWidth - idWidth);
av.getRanges().setViewportStartAndWidth(0, resWidth);
idCanvas.drawIdsWrapped((Graphics2D) g, av, 0, totalHeight);
g.translate(idWidth, 0);
- getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(g, pageWidth - idWidth,
+ seqCanvas.drawWrappedPanelForPrinting(g, pageWidth - idWidth,
totalHeight, 0);
g.translate(-idWidth, 0);
* if exporting a split frame image, the graphics object has
* width: maximum of the top and bottom image widths
* height: sum of the top and bottom image heights
- * if 'protein scaled to codons' and 'auto id width', fudge
- * to a fixed width (and restore preferences afterwards)
+ * Any preferences for auto or fixed id width are overridden here
+ * with the actual id widths, and restored after export
*/
AlignmentPanel complement = null;
- AlignmentDimension dim1 = getAlignmentDimension();
- AlignmentDimension dim2 = new AlignmentDimension(0, 0);
+ final int idWidth = getIdPanel().getWidth();
+ int complementIdWidth = 0;
if (forSplitFrame)
{
complement = ((AlignViewport) av.getCodingComplement())
.getAlignPanel();
+ Cache.setProperty("FIGURE_AUTOIDWIDTH", Boolean.FALSE.toString());
+ Cache.setProperty("FIGURE_FIXEDIDWIDTH", String.valueOf(idWidth));
+ }
+ AlignmentDimension dim1 = getAlignmentDimension();
+ AlignmentDimension dim2 = new AlignmentDimension(0, 0);
+
+ if (forSplitFrame)
+ {
+ complementIdWidth = complement.getIdPanel().getWidth();
+ Cache.setProperty("FIGURE_FIXEDIDWIDTH", String.valueOf(complementIdWidth));
dim2 = complement.getAlignmentDimension();
- if (Boolean.valueOf(autoIdWidth) && av.isScaleProteinAsCdna())
- {
- int w1 = this.getVisibleIdWidth(false);
- int w2 = complement.getVisibleIdWidth(false);
- Cache.setProperty("FIGURE_AUTOIDWIDTH", Boolean.FALSE.toString());
- Cache.setProperty("FIGURE_FIXEDIDWIDTH",
- String.valueOf(Math.max(w1, w2)));
- }
+ Cache.setProperty("FIGURE_FIXEDIDWIDTH", String.valueOf(idWidth));
}
+
final int graphicsHeight = dim1.height + dim2.height
+ borderBottomOffset;
final int graphicsWidth = Math.max(dim1.width, dim2.width);
*/
// to debug location of next write to Graphics:
// graphics.drawString("Hello world", 0, 0);
+ Cache.setProperty("FIGURE_FIXEDIDWIDTH",
+ String.valueOf(complementIdWidth));
if (av.getCodingComplement().getWrapAlignment())
{
complement.printWrappedAlignment(dim2.width,
} finally
{
/*
- * restore preference settings in case they were fudged
+ * restore preference settings in case they were overridden
*/
if (autoIdWidth == null)
{