(JAL-985,JAL-986) preference widgets for settings
[jalview.git] / src / jalview / jbgui / GPreferences.java
index 1a1f9d3..8e2acc2 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -160,6 +160,11 @@ public class GPreferences extends JPanel
   JLabel epsLabel = new JLabel();
 
   protected JComboBox epsRendering = new JComboBox();
+  
+  protected JLabel userIdWidthlabel = new JLabel();
+  protected JCheckBox autoIdWidth = new JCheckBox();
+  protected JTextField userIdWidth = new JTextField();
+
 
   JLabel jLabel1 = new JLabel();
 
@@ -181,7 +186,7 @@ public class GPreferences extends JPanel
 
   JPanel jPanel11 = new JPanel();
 
-  Font verdana11 = new java.awt.Font("Verdana", Font.PLAIN, 11);
+  Font verdana11 = JvSwingUtils.getLabelFont();
 
   protected JCheckBox seqLimit = new JCheckBox();
 
@@ -241,6 +246,8 @@ public class GPreferences extends JPanel
 
   protected JCheckBox followHighlight = new JCheckBox();
 
+  protected JCheckBox sortByTree= new JCheckBox();
+
   /**
    * Creates a new GPreferences object.
    */
@@ -436,7 +443,7 @@ public class GPreferences extends JPanel
     });
     maxcolourLabel.setFont(verdana11);
     maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
-    maxcolourLabel.setText("Maximumum Colour ");
+    maxcolourLabel.setText("Maximum Colour ");
     maxColour.setFont(verdana11);
     maxColour.setBorder(BorderFactory.createEtchedBorder());
     maxColour.setPreferredSize(new Dimension(40, 20));
@@ -447,6 +454,7 @@ public class GPreferences extends JPanel
           maxColour_actionPerformed();
       }
     });
+    
     startupCheckbox.setText("Open file");
     startupCheckbox.setFont(verdana11);
     startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
@@ -622,32 +630,64 @@ public class GPreferences extends JPanel
     smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
     smoothFont.setText("Smooth Font");
     calcTab.setLayout(null);
-    autoCalculateConsCheck.setFont(new java.awt.Font("Verdana", Font.PLAIN,
-            11));
+    autoCalculateConsCheck.setFont(JvSwingUtils.getLabelFont());
     autoCalculateConsCheck.setText("AutoCalculate Consensus");
     autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
-    padGaps.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
-    padGaps.setText("Pad gaps when editing");
+    padGaps.setFont(JvSwingUtils.getLabelFont());
+    padGaps.setText("Pad Gaps When Editing");
     padGaps.setBounds(new Rectangle(22, 94, 168, 23));
-    modellerOutput.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
+    sortByTree.setFont(JvSwingUtils.getLabelFont());
+    sortByTree.setText("Sort With New Tree");
+    sortByTree.setToolTipText("When selected, any trees calculated or loaded onto the alignment will automatically sort the alignment.");
+    sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
+    
+    autoIdWidth.setFont(JvSwingUtils.getLabelFont());
+    autoIdWidth.setText("Autofit Figure ID width");
+    autoIdWidth.setBounds(new Rectangle(228, 96,188,23));
+    autoIdWidth.addActionListener(new ActionListener()
+    {
+      
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        autoIdWidth_actionPerformed();
+      }
+    });
+    userIdWidthlabel.setFont(JvSwingUtils.getLabelFont());
+    userIdWidthlabel.setText("Figure ID column width");
+    userIdWidthlabel.setBounds(new Rectangle(236, 120,168,23));
+    userIdWidth.setFont(JvSwingUtils.getTextAreaFont());
+    userIdWidth.setText("");
+    userIdWidth.setBounds(new Rectangle(232,144,84,23));
+    userIdWidth.addActionListener(new ActionListener()
+    {
+      
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        userIdWidth_actionPerformed();
+      }
+    });
+    modellerOutput.setFont(JvSwingUtils.getLabelFont());
     modellerOutput.setText("Use Modeller Output");
     modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
+
     dasPanel.setLayout(borderLayout4);
     wsPanel.setLayout(borderLayout5);
-    wrap.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
+    wrap.setFont(JvSwingUtils.getLabelFont());
     wrap.setHorizontalAlignment(SwingConstants.TRAILING);
     wrap.setHorizontalTextPosition(SwingConstants.LEADING);
     wrap.setText("Wrap Alignment");
-    rightAlign.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
+    rightAlign.setFont(JvSwingUtils.getLabelFont());
     rightAlign.setForeground(Color.black);
     rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
     rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
     rightAlign.setText("Right Align Ids");
-    idItalics.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
+    idItalics.setFont(JvSwingUtils.getLabelFont());
     idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
     idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
     idItalics.setText("Sequence Name Italics");
-    openoverv.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
+    openoverv.setFont(JvSwingUtils.getLabelFont());
     openoverv.setActionCommand("Open Overview");
     openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
     openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
@@ -787,10 +827,15 @@ public class GPreferences extends JPanel
     jPanel11.add(pfamjv);
     jPanel11.add(pileupjv);
     jPanel11.add(pirjv);
+    exportTab.add(autoIdWidth);
+    exportTab.add(userIdWidth);
+    exportTab.add(userIdWidthlabel);
     exportTab.add(modellerOutput);
     tabbedPane.add(calcTab, "Editing");
     calcTab.add(autoCalculateConsCheck);
     calcTab.add(padGaps);
+    calcTab.add(sortByTree);
+    
     tabbedPane.add(dasPanel, "DAS Settings");
     tabbedPane.add(wsPanel, "Web Services");
 
@@ -799,6 +844,18 @@ public class GPreferences extends JPanel
     exportTab.add(jPanel11);
   }
 
+  protected void autoIdWidth_actionPerformed()
+  {
+    // TODO Auto-generated method stub
+    
+  }
+
+  protected void userIdWidth_actionPerformed()
+  {
+    // TODO Auto-generated method stub
+    
+  }
+
   protected void maxColour_actionPerformed()
   {
     // TODO Auto-generated method stub