quick hack re JAL-1278
authorJim Procter <jprocter@issues.jalview.org>
Mon, 2 Mar 2020 10:25:44 +0000 (10:25 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 2 Mar 2020 10:25:44 +0000 (10:25 +0000)
src/jalview/gui/AlignmentPanel.java
src/jalview/io/HtmlSvgOutput.java

index 85c46bd..f7c8000 100644 (file)
@@ -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();
           }
index 948578a..ac0bbd8 100644 (file)
@@ -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);
   }