JAL-1835 added UI for BioJSON embbeding preference
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 18 Aug 2015 13:24:32 +0000 (14:24 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 18 Aug 2015 13:24:32 +0000 (14:24 +0100)
resources/lang/Messages.properties
src/jalview/gui/Preferences.java
src/jalview/io/HtmlSvgOutput.java
src/jalview/jbgui/GPreferences.java

index 59562aa..cf11670 100644 (file)
@@ -1246,4 +1246,5 @@ info.enter_search_text_to_enable = Enter Search Text to Enable
 info.search_in_annotation_label = Search in {0} Label
 info.search_in_annotation_description = Search in {0} Description
 info.change_threshold_mode_to_enable = Change Threshold Mode to Enable
-label.couldnt_read_data = Couldn't read data
\ No newline at end of file
+label.couldnt_read_data = Couldn't read data
+label.embbed_biojson = Embbed BioJSON to HTML export
\ No newline at end of file
index 67e0f83..1b274a8 100755 (executable)
  */
 package jalview.gui;
 
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.bin.Cache;
+import jalview.gui.Help.HelpId;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GPreferences;
+import jalview.jbgui.GSequenceLink;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.util.MessageManager;
+
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
@@ -42,17 +53,6 @@ import javax.swing.JPanel;
 
 import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
 
-import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.bin.Cache;
-import jalview.gui.Help.HelpId;
-import jalview.gui.StructureViewer.ViewerType;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GPreferences;
-import jalview.jbgui.GSequenceLink;
-import jalview.schemes.ColourSchemeProperty;
-import jalview.util.MessageManager;
-
 /**
  * DOCUMENT ME!
  * 
@@ -365,6 +365,8 @@ public class Preferences extends GPreferences
     pileupjv.setSelected(Cache.getDefault("PILEUP_JVSUFFIX", true));
     pirjv.setSelected(Cache.getDefault("PIR_JVSUFFIX", true));
     modellerOutput.setSelected(Cache.getDefault("PIR_MODELLER", false));
+    embbedBioJSON.setSelected(Cache.getDefault("EXPORT_EMBBED_BIOJSON",
+            true));
 
     /*
      * Set Editing tab defaults
@@ -589,6 +591,8 @@ public class Preferences extends GPreferences
             Boolean.toString(pirjv.isSelected()));
     Cache.applicationProperties.setProperty("PIR_MODELLER",
             Boolean.toString(modellerOutput.isSelected()));
+    Cache.applicationProperties.setProperty("EXPORT_EMBBED_BIOJSON",
+            Boolean.toString(embbedBioJSON.isSelected()));
     jalview.io.PIRFile.useModellerOutput = modellerOutput.isSelected();
 
     Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH",
index 7fcf629..16b2647 100644 (file)
@@ -40,11 +40,7 @@ public class HtmlSvgOutput
   {
     try
     {
-      if (file == null /*
-                        * && !(System.getProperty("java.awt.headless") != null
-                        * && System
-                        * .getProperty("java.awt.headless").equals("true"))
-                        */)
+      if (file == null)
       {
 
       JalviewFileChooser chooser = getHTMLChooser();
index 97edb36..4f4afb0 100755 (executable)
  */
 package jalview.jbgui;
 
+import jalview.gui.JvSwingUtils;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
+import jalview.util.MessageManager;
+
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -61,11 +66,6 @@ import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 
-import jalview.gui.JvSwingUtils;
-import jalview.gui.StructureViewer.ViewerType;
-import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
-import jalview.util.MessageManager;
-
 /**
  * Base class for the Preferences panel.
  * 
@@ -216,6 +216,8 @@ public class GPreferences extends JPanel
 
   protected JCheckBox modellerOutput = new JCheckBox();
 
+  protected JCheckBox embbedBioJSON = new JCheckBox();
+
   /*
    * Editing tab components
    */
@@ -432,6 +434,14 @@ public class GPreferences extends JPanel
         userIdWidth_actionPerformed();
       }
     });
+    modellerOutput.setFont(LABEL_FONT);
+    modellerOutput.setText(MessageManager
+            .getString("label.use_modeller_output"));
+    modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
+    embbedBioJSON.setFont(LABEL_FONT);
+    embbedBioJSON.setText(MessageManager.getString("label.embbed_biojson"));
+    embbedBioJSON.setBounds(new Rectangle(228, 200, 250, 23));
+
     jPanel11.add(jLabel1);
     jPanel11.add(blcjv);
     jPanel11.add(clustaljv);
@@ -444,13 +454,10 @@ public class GPreferences extends JPanel
     outputTab.add(userIdWidth);
     outputTab.add(userIdWidthlabel);
     outputTab.add(modellerOutput);
+    outputTab.add(embbedBioJSON);
     outputTab.add(epsLabel);
     outputTab.add(epsRendering);
     outputTab.add(jPanel11);
-    modellerOutput.setFont(LABEL_FONT);
-    modellerOutput.setText(MessageManager
-            .getString("label.use_modeller_output"));
-    modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
     return outputTab;
   }