update HtmlSvgOutput to ignore browser invocation when running in headless mode
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
index 1e67ff7..387bb7f 100755 (executable)
@@ -214,6 +214,8 @@ public class GAlignFrame extends JInternalFrame
 
   JMenuItem createPNG = new JMenuItem();
 
+  JMenuItem createSVG = new JMenuItem();
+
   protected JMenuItem font = new JMenuItem();
 
   public JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();
@@ -372,9 +374,9 @@ public class GAlignFrame extends JInternalFrame
 
   protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
 
-  protected JCheckBoxMenuItem showAutoFirst = new JCheckBoxMenuItem();
+  protected JRadioButtonMenuItem showAutoFirst = new JRadioButtonMenuItem();
 
-  protected JCheckBoxMenuItem showAutoLast = new JCheckBoxMenuItem();
+  protected JRadioButtonMenuItem showAutoLast = new JRadioButtonMenuItem();
 
   private JMenuItem grpsFromSelection = new JMenuItem();
 
@@ -1422,8 +1424,11 @@ public class GAlignFrame extends JInternalFrame
       }
     });
 
+    ButtonGroup buttonGroup = new ButtonGroup();
+    buttonGroup.add(showAutoFirst);
+    buttonGroup.add(showAutoLast);
     showAutoFirst.setText(MessageManager.getString("label.show_first"));
-    showAutoFirst.setState(Cache.getDefault(
+    showAutoFirst.setSelected(Cache.getDefault(
             Preferences.SHOW_AUTOCALC_ABOVE,
             false));
     showAutoFirst.addActionListener(new ActionListener()
@@ -1431,22 +1436,18 @@ public class GAlignFrame extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        boolean sortFirst = showAutoFirst.getState();
-        setShowAutoCalculatedAbove(sortFirst);
-        showAutoLast.setState(!sortFirst);
+        setShowAutoCalculatedAbove(showAutoFirst.isSelected());
         sortAnnotations_actionPerformed();
       }
     });
     showAutoLast.setText(MessageManager.getString("label.show_last"));
-    showAutoLast.setState(!showAutoFirst.getState());
+    showAutoLast.setSelected(!showAutoFirst.isSelected());
     showAutoLast.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        boolean sortLast = showAutoLast.getState();
-        setShowAutoCalculatedAbove(!sortLast);
-        showAutoFirst.setState(!sortLast);
+        setShowAutoCalculatedAbove(!showAutoLast.isSelected());
         sortAnnotations_actionPerformed();
       }
     });
@@ -1592,6 +1593,7 @@ public class GAlignFrame extends JInternalFrame
     createPNG.setActionCommand(MessageManager
             .getString("label.save_png_image"));
     createPNG.setText("PNG");
+
     font.setText(MessageManager.getString("action.font"));
     font.addActionListener(new java.awt.event.ActionListener()
     {
@@ -1622,6 +1624,17 @@ public class GAlignFrame extends JInternalFrame
         createEPS(null);
       }
     });
+
+    createSVG.setText("SVG");
+    createSVG.addActionListener(new java.awt.event.ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        createSVG(null);
+      }
+    });
+
     LoadtreeMenuItem.setActionCommand(MessageManager
             .getString("label.load_tree_for_sequence_set"));
     LoadtreeMenuItem.setText(MessageManager
@@ -1740,7 +1753,7 @@ public class GAlignFrame extends JInternalFrame
     sortByAnnotScore.setText(MessageManager
             .getString("label.sort_by_score"));
     sort.add(sortByAnnotScore);
-    sortByAnnotScore.addMenuListener(new javax.swing.event.MenuListener()
+    sort.addMenuListener(new javax.swing.event.MenuListener()
     {
 
       @Override
@@ -2340,6 +2353,7 @@ public class GAlignFrame extends JInternalFrame
     jMenu2.add(htmlMenuItem);
     jMenu2.add(epsFile);
     jMenu2.add(createPNG);
+    jMenu2.add(createSVG);
     addSequenceMenu.add(addFromFile);
     addSequenceMenu.add(addFromText);
     addSequenceMenu.add(addFromURL);
@@ -2850,6 +2864,10 @@ public class GAlignFrame extends JInternalFrame
   {
   }
 
+  public void createSVG(java.io.File f)
+  {
+
+  }
   protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
   {