JAL-3084 force EPS output to "Text" for JalviewJS
[jalview.git] / src / jalview / gui / Preferences.java
index 31842e4..92dde1f 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.gui;
 
 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.bin.Cache;
+import jalview.bin.Jalview;
 import jalview.gui.Help.HelpId;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.io.FileFormatI;
@@ -188,10 +189,12 @@ public class Preferences extends GPreferences
     super();
     frame = new JInternalFrame();
     frame.setContentPane(this);
-    wsPrefs = new WsPreferences();
-    wsTab.add(wsPrefs, BorderLayout.CENTER);
+    if (!Jalview.isJS())
+    {
+      wsPrefs = new WsPreferences();
+      wsTab.add(wsPrefs, BorderLayout.CENTER);
+    }
     int width = 500, height = 450;
-    new jalview.util.Platform();
     if (Platform.isAMac())
     {
       width = 570;
@@ -548,8 +551,12 @@ public class Preferences extends GPreferences
     comboBox.addItem(promptEachTimeOpt);
     comboBox.addItem(lineArtOpt);
     comboBox.addItem(textOpt);
-    String defaultOption = Cache.getDefault(propertyKey,
-            "Prompt each time");
+    
+    /*
+     * JalviewJS doesn't support Lineart so force it to Text
+     */
+    String defaultOption = Jalview.isJS() ? "Text"
+            : Cache.getDefault(propertyKey, "Prompt each time");
     if (defaultOption.equalsIgnoreCase("Text"))
     {
       comboBox.setSelectedItem(textOpt);
@@ -813,7 +820,10 @@ public class Preferences extends GPreferences
     Cache.applicationProperties.setProperty("PAD_GAPS",
             Boolean.toString(padGaps.isSelected()));
 
-    wsPrefs.updateAndRefreshWsMenuConfig(false);
+    if (!Jalview.isJS())
+    {
+      wsPrefs.updateAndRefreshWsMenuConfig(false);
+    }
     Cache.saveProperties();
     Desktop.instance.doConfigureStructurePrefs();
     try
@@ -887,8 +897,11 @@ public class Preferences extends GPreferences
   {
     try
     {
-      wsPrefs.updateWsMenuConfig(true);
-      wsPrefs.refreshWs_actionPerformed(e);
+      if (!Jalview.isJS())
+      {
+        wsPrefs.updateWsMenuConfig(true);
+        wsPrefs.refreshWs_actionPerformed(e);
+      }
       frame.setClosed(true);
     } catch (Exception ex)
     {