EPSOptions added
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index b3b2865..50c89f5 100755 (executable)
@@ -771,6 +771,33 @@ public class AlignmentPanel extends GAlignmentPanel
      */\r
     public void makeEPS(File epsFile)\r
     {\r
+      boolean accurateText = true;\r
+\r
+      String renderStyle = jalview.bin.Cache.getDefault("EPS_RENDERING",\r
+          "Prompt each time");\r
+\r
+      // If we need to prompt, and if the GUI is visible then\r
+      // Prompt for EPS rendering style\r
+      if (renderStyle.equalsIgnoreCase("Prompt each time")\r
+          && !\r
+          (System.getProperty("java.awt.headless") != null\r
+           && System.getProperty("java.awt.headless").equals("true")))\r
+      {\r
+        EPSOptions eps = new EPSOptions();\r
+        renderStyle = eps.getValue();\r
+\r
+        if(eps.cancelled || renderStyle==null)\r
+          return;\r
+\r
+        renderStyle = eps.getValue();\r
+      }\r
+\r
+      if (renderStyle.equalsIgnoreCase("text"))\r
+      {\r
+        accurateText = false;\r
+      }\r
+\r
+\r
         if(epsFile == null)\r
         {\r
           jalview.io.JalviewFileChooser chooser = new jalview.io.\r
@@ -816,12 +843,14 @@ public class AlignmentPanel extends GAlignmentPanel
 \r
         try\r
          {\r
-            FileOutputStream out = new FileOutputStream(epsFile);\r
-            EpsGraphics2D pg = new EpsGraphics2D("Example", out, 0, 0, width,\r
-                    height);\r
+           FileOutputStream out = new FileOutputStream(epsFile);\r
+           EpsGraphics2D pg = new EpsGraphics2D("Example", out, 0, 0, width,\r
+                                                height);\r
 \r
-            if (av.getWrapAlignment())\r
-            {\r
+           pg.setAccurateTextMode(accurateText);\r
+\r
+           if (av.getWrapAlignment())\r
+           {\r
                 printWrappedAlignment(pg, width, height, 0);\r
             }\r
             else\r