(JAL-985,JAL-986) documentation and tooltips
[jalview.git] / src / jalview / jbgui / GPreferences.java
index 9eb6cf1..29e11ce 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();
 
@@ -241,6 +246,8 @@ public class GPreferences extends JPanel
 
   protected JCheckBox followHighlight = new JCheckBox();
 
+  protected JCheckBox sortByTree= new JCheckBox();
+
   /**
    * Creates a new GPreferences object.
    */
@@ -447,6 +454,7 @@ public class GPreferences extends JPanel
           maxColour_actionPerformed();
       }
     });
+    
     startupCheckbox.setText("Open file");
     startupCheckbox.setFont(verdana11);
     startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
@@ -626,11 +634,51 @@ public class GPreferences extends JPanel
     autoCalculateConsCheck.setText("AutoCalculate Consensus");
     autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
     padGaps.setFont(JvSwingUtils.getLabelFont());
-    padGaps.setText("Pad gaps when editing");
+    padGaps.setText("Pad Gaps When Editing");
     padGaps.setBounds(new Rectangle(22, 94, 168, 23));
+    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("Automatically set ID width");
+    autoIdWidth.setToolTipText("<html>"+JvSwingUtils.wrapTooltip("Adjusts the width of the generated EPS or PNG file to ensure even the longest sequence ID or annotation label is displayed")+"</html>");
+    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");
+    userIdWidth
+            .setToolTipText("<html>"+JvSwingUtils
+                    .wrapTooltip("Manually specify the width of the left hand column where sequence IDs and annotation labels will be rendered in exported alignment figures. This setting will be ignored if 'Automatically set ID width' is set")+"</html>");
+    userIdWidthlabel
+            .setToolTipText("<html>"+JvSwingUtils
+                    .wrapTooltip("Manually specify the width of the left hand column where sequence IDs and annotation labels will be rendered in exported alignment figures. This setting will be ignored if 'Automatically set ID width' is set")+"</html>");
+    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(JvSwingUtils.getLabelFont());
@@ -786,10 +834,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");
 
@@ -798,6 +851,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