- setProgressMessage(MessageManager
- .formatMessage("status.export_complete", type.getName()));
- }
-
- /**
- * Sets up a graphics object for the SVG image to be written on. The user is
- * first prompted for choice of Text or Lineart rendering, unless a preference
- * for this has been set.
- *
- * @param width
- * @param height
- * @param title
- */
- void setupSVG(int width, int height, String title)
- {
- String renderStyle = Cache.getDefault("SVG_RENDERING",
- "Prompt each time");
- AtomicBoolean textOption = new AtomicBoolean(
- !"Lineart".equals(renderStyle));
-
- /*
- * configure the action to run on OK in the dialog
- */
- RunResponse okAction = new RunResponse(JOptionPane.OK_OPTION)
- {
- @Override
- public void run()
- {
- setupSVG(width, height, textOption.get());
- }
- };
-
- /*
- * Prompt for character rendering style if preference is not set
- */
- if (renderStyle.equalsIgnoreCase("Prompt each time")
- && !(System.getProperty("java.awt.headless") != null && System
- .getProperty("java.awt.headless").equals("true")))
- {
- LineartOptions svgOption = new LineartOptions("SVG_RENDERING",
- TYPE.SVG.getName(), textOption);
- svgOption.setResponseAction(new RunResponse(JOptionPane.NO_OPTION)
- {
- @Override
- public void run()
- {
- setProgressMessage(MessageManager.formatMessage(
- "status.cancelled_image_export_operation", "SVG"));
- }
- });
- svgOption.setResponseAction(okAction);
- svgOption.showDialog();
- /* no code here - JalviewJS cannot execute it */
- }
- else
- {
- /*
- * else (if preference set) just do the export action
- */
- setupSVG(width, height, textOption.get());
- }
- }
-
- void setProgressMessage(String message)
- {
- if (pIndicator != null && !headless)
- {
- pIndicator.setProgressBar(message, pSessionId);
- }