JAL-1620 version bump and release notes
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
index a7852b4..e546608 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -23,6 +23,7 @@ package jalview.jbgui;
 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.bin.Cache;
 import jalview.gui.JvSwingUtils;
+import jalview.gui.Preferences;
 import jalview.schemes.ColourSchemeProperty;
 import jalview.util.MessageManager;
 
@@ -213,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();
@@ -371,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();
 
@@ -1140,7 +1143,7 @@ public class GAlignFrame extends JInternalFrame
       }
     });
     SequenceAnnotationOrder sortAnnotationsBy = SequenceAnnotationOrder
-            .valueOf(Cache.getDefault(Cache.SORT_ANNOTATIONS,
+            .valueOf(Cache.getDefault(Preferences.SORT_ANNOTATIONS,
                     SequenceAnnotationOrder.NONE.name()));
     sortAnnBySequence.setText(MessageManager
             .getString("label.sort_annotations_by_sequence"));
@@ -1421,30 +1424,30 @@ 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(Cache.SHOW_AUTOCALC_ABOVE,
+    showAutoFirst.setSelected(Cache.getDefault(
+            Preferences.SHOW_AUTOCALC_ABOVE,
             false));
     showAutoFirst.addActionListener(new ActionListener()
     {
       @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();
       }
     });
@@ -1590,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()
     {
@@ -1620,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
@@ -1738,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
@@ -2338,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);
@@ -2848,6 +2864,10 @@ public class GAlignFrame extends JInternalFrame
   {
   }
 
+  public void createSVG(java.io.File f)
+  {
+
+  }
   protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
   {