JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / io / HtmlSvgOutput.java
index d653e4b..d4a4651 100644 (file)
 package jalview.io;
 
 import jalview.bin.Cache;
+import jalview.bin.Jalview;
 import jalview.gui.AlignmentPanel;
 import jalview.gui.LineartOptions;
 import jalview.gui.OOMWarning;
 import jalview.math.AlignmentDimension;
 import jalview.util.MessageManager;
-import jalview.util.dialogrunner.RunResponse;
 
 import java.awt.Graphics;
 import java.awt.print.PrinterException;
@@ -35,8 +35,6 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import javax.swing.JOptionPane;
-
 import org.jfree.graphics2d.svg.SVGGraphics2D;
 import org.jfree.graphics2d.svg.SVGHints;
 
@@ -214,7 +212,7 @@ public class HtmlSvgOutput extends HTMLOutput
       /*
        * configure the action to run on OK in the dialog
        */
-      RunResponse okAction = new RunResponse(JOptionPane.OK_OPTION)
+      Runnable okAction = new Runnable()
       {
         @Override
         public void run()
@@ -226,10 +224,11 @@ public class HtmlSvgOutput extends HTMLOutput
       /*
        * Prompt for character rendering style if preference is not set
        */
-      if (renderStyle.equalsIgnoreCase("Prompt each time") && !isHeadless())
+      if (renderStyle.equalsIgnoreCase("Prompt each time")
+              && !Jalview.isHeadlessMode())
       {
         LineartOptions svgOption = new LineartOptions("HTML", textOption);
-        svgOption.setResponseAction(new RunResponse(JOptionPane.NO_OPTION)
+        svgOption.setResponseAction(1, new Runnable()
         {
           @Override
           public void run()
@@ -239,7 +238,7 @@ public class HtmlSvgOutput extends HTMLOutput
                     getDescription()));
           }
         });
-        svgOption.setResponseAction(okAction);
+        svgOption.setResponseAction(0, okAction);
         svgOption.showDialog();
         /* no code here - JalviewJS cannot execute it */
       }