JAL-2381 copy and paste sequence also copies contact matrix annotation
[jalview.git] / src / jalview / gui / ImageExporter.java
index d849ba2..785d206 100644 (file)
@@ -105,6 +105,13 @@ public class ImageExporter
   public void doExport(File file, Component parent, int width, int height,
           String imageSource)
   {
+    doExport(file, parent, width, height, imageSource, null, 0.0f, 0, 0);
+  }
+
+  public void doExport(File file, Component parent, int width, int height,
+          String imageSource, String renderer, float bitmapscale,
+          int bitmapwidth, int bitmapheight)
+  {
     final long messageId = System.currentTimeMillis();
     setStatus(
             MessageManager.formatMessage(
@@ -142,9 +149,10 @@ public class ImageExporter
      * for this as EPS_RENDERING / SVG_RENDERING
      * Always set to Text for JalviewJS as Lineart (glyph fonts) not available
      */
-    String renderStyle = Cache.getDefault(
-            imageType.getName() + "_RENDERING",
-            LineartOptions.PROMPT_EACH_TIME);
+    String renderStyle = renderer == null
+            ? Cache.getDefault(imageType.getName() + "_RENDERING",
+                    LineartOptions.PROMPT_EACH_TIME)
+            : renderer;
     if (Platform.isJS())
     {
       renderStyle = "Text";
@@ -158,7 +166,7 @@ public class ImageExporter
       final File chosenFile = file;
       Callable<Void> okAction = () -> {
         exportImage(chosenFile, !textSelected.get(), width, height,
-                messageId);
+                messageId, bitmapscale, bitmapwidth, bitmapheight);
         return null;
       };
       LineartOptions epsOption = new LineartOptions(TYPE.EPS.getName(),
@@ -184,7 +192,8 @@ public class ImageExporter
        * character rendering not required, or preference already set 
        * - just do the export
        */
-      exportImage(file, !textSelected.get(), width, height, messageId);
+      exportImage(file, !textSelected.get(), width, height, messageId,
+              bitmapscale, bitmapwidth, bitmapheight);
     }
   }
 
@@ -200,7 +209,8 @@ public class ImageExporter
    * @param messageId
    */
   protected void exportImage(File chosenFile, boolean asLineart, int width,
-          int height, long messageId)
+          int height, long messageId, float bitmapscale, int bitmapwidth,
+          int bitmapheight)
   {
     String type = imageType.getName();
     try
@@ -210,7 +220,7 @@ public class ImageExporter
       // "status.exporting_alignment_as_x_file", type),
       // messageId);
       ImageMaker im = new ImageMaker(imageType, width, height, chosenFile,
-              title, asLineart);
+              title, asLineart, bitmapscale, bitmapwidth, bitmapheight);
       imageWriter.exportImage(im.getGraphics());
       im.writeImage();
       setStatus(