JAL-1152 annotation sorting preferences and help documentation
[jalview.git] / src / jalview / jbgui / GPreferences.java
index bf01a01..2223c1f 100755 (executable)
@@ -23,13 +23,40 @@ package jalview.jbgui;
 import jalview.gui.JvSwingUtils;
 import jalview.util.MessageManager;
 
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.event.*;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.Insets;
 import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
 
 /**
  * DOCUMENT ME!
@@ -73,19 +100,19 @@ public class GPreferences extends JPanel
 
   JLabel gapLabel = new JLabel();
 
-  protected JComboBox colour = new JComboBox();
+  protected JComboBox<String> colour = new JComboBox<String>();
 
   JLabel colourLabel = new JLabel();
 
   JLabel fontLabel = new JLabel();
 
-  protected JComboBox fontSizeCB = new JComboBox();
+  protected JComboBox<String> fontSizeCB = new JComboBox<String>();
 
-  protected JComboBox fontStyleCB = new JComboBox();
+  protected JComboBox<String> fontStyleCB = new JComboBox<String>();
 
-  protected JComboBox fontNameCB = new JComboBox();
+  protected JComboBox<String> fontNameCB = new JComboBox<String>();
 
-  protected JComboBox gapSymbolCB = new JComboBox();
+  protected JComboBox<String> gapSymbolCB = new JComboBox<String>();
 
   protected JCheckBox startupCheckbox = new JCheckBox();
 
@@ -145,10 +172,16 @@ public class GPreferences extends JPanel
 
   GridBagLayout gridBagLayout3 = new GridBagLayout();
 
-  protected JComboBox sortby = new JComboBox();
+  protected JComboBox<String> sortby = new JComboBox<String>();
 
   JLabel sortLabel = new JLabel();
 
+  protected JComboBox<String> sortAnnBy = new JComboBox<String>();
+
+  protected JComboBox<String> sortAutocalc = new JComboBox<String>();
+
+  JLabel sortAnnLabel = new JLabel();
+
   JPanel jPanel2 = new JPanel();
 
   JPanel visual2panel = new JPanel();
@@ -169,7 +202,7 @@ public class GPreferences extends JPanel
 
   JLabel epsLabel = new JLabel();
 
-  protected JComboBox epsRendering = new JComboBox();
+  protected JComboBox<String> epsRendering = new JComboBox<String>();
 
   protected JLabel userIdWidthlabel = new JLabel();
 
@@ -450,7 +483,7 @@ public class GPreferences extends JPanel
     fontNameCB.setFont(verdana11);
     fontNameCB.setBounds(new Rectangle(172, 104, 147, 23));
     gapSymbolCB.setFont(verdana11);
-    gapSymbolCB.setBounds(new Rectangle(172, 204, 69, 23));
+    gapSymbolCB.setBounds(new Rectangle(172, 196, 69, 23));
     mincolourLabel.setFont(verdana11);
     mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
     mincolourLabel.setText(MessageManager.getString("label.min_colour"));
@@ -484,7 +517,7 @@ public class GPreferences extends JPanel
     startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
     startupCheckbox.setSelected(true);
     startupFileTextfield.setFont(verdana11);
-    startupFileTextfield.setBounds(new Rectangle(172, 273, 270, 20));
+    startupFileTextfield.setBounds(new Rectangle(172, 287, 270, 20));
     startupFileTextfield.addMouseListener(new MouseAdapter()
     {
       public void mouseClicked(MouseEvent e)
@@ -605,13 +638,20 @@ public class GPreferences extends JPanel
     jPanel1.setBorder(titledBorder1);
     jPanel1.setLayout(gridBagLayout1);
     sortby.setFont(verdana11);
-    sortby.setBounds(new Rectangle(172, 249, 155, 21));
+    sortby.setBounds(new Rectangle(172, 240, 155, 21));
     sortLabel.setFont(verdana11);
     sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
     sortLabel.setText(MessageManager.getString("label.sort_by"));
-    jPanel2.setBounds(new Rectangle(7, 17, 158, 278));
+    sortAnnBy.setFont(verdana11);
+    sortAnnBy.setBounds(new Rectangle(172, 264, 120, 21));
+    sortAnnLabel.setFont(verdana11);
+    sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+    sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
+    sortAutocalc.setFont(verdana11);
+    sortAutocalc.setBounds(new Rectangle(300, 264, 185, 21));
+    jPanel2.setBounds(new Rectangle(7, 17, 158, 297));
     jPanel2.setLayout(gridLayout2);
-    gridLayout2.setRows(12);
+    gridLayout2.setRows(13);
     exportTab.setLayout(null);
     epsLabel.setFont(verdana11);
     epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
@@ -746,10 +786,13 @@ public class GPreferences extends JPanel
     jPanel2.add(gapLabel);
     jPanel2.add(wrap);
     jPanel2.add(sortLabel);
+    jPanel2.add(sortAnnLabel);
     jPanel2.add(startupCheckbox);
     visualTab.add(annotations);
     visualTab.add(startupFileTextfield);
     visualTab.add(sortby);
+    visualTab.add(sortAnnBy);
+    visualTab.add(sortAutocalc);
     visualTab.add(gapSymbolCB);
     visualTab.add(fontNameCB);
     visualTab.add(fontSizeCB);