From: Jim Procter Date: Mon, 2 Mar 2020 10:25:44 +0000 (+0000) Subject: quick hack re JAL-1278 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4eeb6040d685b1527e44c38c1a29039a6635fa8f;p=jalview.git quick hack re JAL-1278 --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 85c46bd..f7c8000 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -896,7 +896,7 @@ public class AlignmentPanel extends GAlignmentPanel implements } else { - return printUnwrapped(pwidth, pheight, pi, pg, pg); + return printUnwrapped(false, pwidth, pheight, pi, pg, pg); } } @@ -919,7 +919,8 @@ public class AlignmentPanel extends GAlignmentPanel implements * @return * @throws PrinterException */ - public int printUnwrapped(int pageWidth, int pageHeight, int pageIndex, + public int printUnwrapped(boolean exportSeqPanel, int pageWidth, + int pageHeight, int pageIndex, Graphics idGraphics, Graphics alignmentGraphics) throws PrinterException { @@ -995,14 +996,17 @@ public class AlignmentPanel extends GAlignmentPanel implements idGraphics.setFont(av.getFont()); idGraphics.translate(0, -scaleHeight); - /* - * draw the sequences, offset for scale height, and id width (if using a - * single graphics context), then reset to (0, scale height) - */ - alignmentGraphics.translate(alignmentGraphicsOffset, scaleHeight); - getSeqPanel().seqCanvas.drawPanelForPrinting(alignmentGraphics, startRes, - endRes, startSeq, endSeq - 1); - alignmentGraphics.translate(-alignmentGraphicsOffset, 0); + if (!exportSeqPanel) + { + /* + * draw the sequences, offset for scale height, and id width (if using a + * single graphics context), then reset to (0, scale height) + */ + alignmentGraphics.translate(alignmentGraphicsOffset, scaleHeight); + getSeqPanel().seqCanvas.drawPanelForPrinting(alignmentGraphics, + startRes, endRes, startSeq, endSeq - 1); + alignmentGraphics.translate(-alignmentGraphicsOffset, 0); + } if (av.isShowAnnotation() && (endSeq == alignmentHeight)) { @@ -1045,7 +1049,8 @@ public class AlignmentPanel extends GAlignmentPanel implements * * @throws PrinterException */ - public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber, + public int printWrappedAlignment(int pageWidth, + int pageHeight, int pageNumber, Graphics g) throws PrinterException { getSeqPanel().seqCanvas.calculateWrappedGeometry(getWidth(), @@ -1098,7 +1103,8 @@ public class AlignmentPanel extends GAlignmentPanel implements g.translate(idWidth, 0); - getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(g, pageWidth - idWidth, + getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(g, + pageWidth - idWidth, totalHeight, 0); if ((pageNumber * pageHeight) < totalHeight) @@ -1151,6 +1157,13 @@ public class AlignmentPanel extends GAlignmentPanel implements void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file) { + makeAlignmentImage(type, file, jalview.bin.Cache + .getDefault("IMAGE_EXPORT_NOSEQUENCES", false)); + } + + public void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, + File file, boolean exportSeqPanel) + { int boarderBottomOffset = 5; long pSessionId = System.currentTimeMillis(); headless = (System.getProperty("java.awt.headless") != null @@ -1206,7 +1219,8 @@ public class AlignmentPanel extends GAlignmentPanel implements { if (graphics != null) { - printUnwrapped(aDimension.getWidth(), aDimension.getHeight(), 0, + printUnwrapped(exportSeqPanel, aDimension.getWidth(), + aDimension.getHeight(), 0, graphics, graphics); im.writeImage(); } diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index 948578a..ac0bbd8 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -74,7 +74,7 @@ public class HtmlSvgOutput extends HTMLOutput Graphics idGraphics, Graphics alignmentGraphics) throws PrinterException { - return ap.printUnwrapped(pwidth, pheight, pi, idGraphics, + return ap.printUnwrapped(false, pwidth, pheight, pi, idGraphics, alignmentGraphics); }