added preferences for usage stats, questionnaire check and version check.
[jalview.git] / src / jalview / jbgui / GPreferences.java
index fd142fc..47959df 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4.0.b2)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -27,93 +27,173 @@ import java.awt.Rectangle;
 
 /**
  * DOCUMENT ME!
- *
+ * 
  * @author $author$
  * @version $Revision$
  */
-public class GPreferences
-    extends JPanel
+public class GPreferences extends JPanel
 {
   JTabbedPane tabbedPane = new JTabbedPane();
 
   JButton ok = new JButton();
+
   JButton cancel = new JButton();
+
   JPanel okCancelPanel = new JPanel();
+
   BorderLayout borderLayout1 = new BorderLayout();
+
   protected JCheckBox quality = new JCheckBox();
+
   JPanel visualTab = new JPanel();
+
   protected JCheckBox fullScreen = new JCheckBox();
+
   protected JCheckBox conservation = new JCheckBox();
+
   protected JCheckBox identity = new JCheckBox();
+
   protected JCheckBox annotations = new JCheckBox();
+
   JLabel gapLabel = new JLabel();
+
   protected JComboBox colour = new JComboBox();
+
   JLabel colourLabel = new JLabel();
+
   JLabel fontLabel = new JLabel();
+
   protected JComboBox fontSizeCB = new JComboBox();
+
   protected JComboBox fontStyleCB = new JComboBox();
+
   protected JComboBox fontNameCB = new JComboBox();
+
   protected JComboBox gapSymbolCB = new JComboBox();
+
   protected JCheckBox startupCheckbox = new JCheckBox();
+
   protected JTextField startupFileTextfield = new JTextField();
+
   JPanel connectTab = new JPanel();
+
   JLabel serverLabel = new JLabel();
+
   protected JList linkURLList = new JList();
+
   protected JTextField proxyServerTB = new JTextField();
+
   protected JTextField proxyPortTB = new JTextField();
+
   JLabel portLabel = new JLabel();
+
   JLabel browserLabel = new JLabel();
+
   protected JTextField defaultBrowser = new JTextField();
+
   JButton newLink = new JButton();
+
   JButton editLink = new JButton();
+
   JButton deleteLink = new JButton();
+
   JScrollPane linkScrollPane = new JScrollPane();
+
   JPanel linkPanel = new JPanel();
+
   BorderLayout borderLayout2 = new BorderLayout();
+
   JPanel editLinkButtons = new JPanel();
+
   GridLayout gridLayout1 = new GridLayout();
+
   protected JList linkNameList = new JList();
+
   JPanel linkPanel2 = new JPanel();
+
   BorderLayout borderLayout3 = new BorderLayout();
+
   protected JCheckBox useProxy = new JCheckBox();
+
   JPanel jPanel1 = new JPanel();
+
   TitledBorder titledBorder1 = new TitledBorder("Proxy Server");
+
   TitledBorder titledBorder2 = new TitledBorder("File Output");
+
   GridBagLayout gridBagLayout2 = new GridBagLayout();
+
   GridBagLayout gridBagLayout1 = new GridBagLayout();
+
   GridBagLayout gridBagLayout3 = new GridBagLayout();
+
   protected JComboBox sortby = new JComboBox();
+
   JLabel sortLabel = new JLabel();
+
   JPanel jPanel2 = new JPanel();
+
   GridLayout gridLayout2 = new GridLayout();
+
   JPanel jPanel3 = new JPanel();
+
   JPanel exportTab = new JPanel();
+
   JLabel epsLabel = new JLabel();
+
   protected JComboBox epsRendering = new JComboBox();
+
   JLabel jLabel1 = new JLabel();
+
   protected JCheckBox blcjv = new JCheckBox();
+
   protected JCheckBox pileupjv = new JCheckBox();
+
   protected JCheckBox clustaljv = new JCheckBox();
+
   protected JCheckBox msfjv = new JCheckBox();
+
   protected JCheckBox fastajv = new JCheckBox();
+
   protected JCheckBox pfamjv = new JCheckBox();
+
   FlowLayout flowLayout1 = new FlowLayout();
+
   protected JCheckBox pirjv = new JCheckBox();
+
   JPanel jPanel11 = new JPanel();
+
   Font verdana11 = new java.awt.Font("Verdana", Font.PLAIN, 11);
+
   protected JCheckBox seqLimit = new JCheckBox();
+
   GridLayout gridLayout3 = new GridLayout();
+
   protected JCheckBox smoothFont = new JCheckBox();
+
   JPanel calcTab = new JPanel();
+
   protected JCheckBox autoCalculateConsCheck = new JCheckBox();
+
   protected JCheckBox padGaps = new JCheckBox();
+
   protected JCheckBox modellerOutput = new JCheckBox();
+
   protected JPanel dasPanel = new JPanel();
+
   BorderLayout borderLayout4 = new BorderLayout();
+
   protected JCheckBox wrap = new JCheckBox();
+
   protected JCheckBox rightAlign = new JCheckBox();
+
   protected JCheckBox idItalics = new JCheckBox();
+
   protected JCheckBox openoverv = new JCheckBox();
+  protected JCheckBox usagestats = new JCheckBox(); 
+  protected JCheckBox questionnaire = new JCheckBox();
+  protected JCheckBox versioncheck = new JCheckBox();
+
   /**
    * Creates a new GPreferences object.
    */
@@ -122,8 +202,7 @@ public class GPreferences
     try
     {
       jbInit();
-    }
-    catch (Exception ex)
+    } catch (Exception ex)
     {
       ex.printStackTrace();
     }
@@ -131,11 +210,11 @@ public class GPreferences
 
   /**
    * DOCUMENT ME!
-   *
-   * @throws Exception DOCUMENT ME!
+   * 
+   * @throws Exception
+   *                 DOCUMENT ME!
    */
-  private void jbInit()
-      throws Exception
+  private void jbInit() throws Exception
   {
     this.setLayout(borderLayout1);
     ok.setText("OK");
@@ -241,6 +320,18 @@ public class GPreferences
     browserLabel.setText("Default Browser (Unix)");
     defaultBrowser.setFont(verdana11);
     defaultBrowser.setText("");
+    usagestats.setText("Send usage statistics");
+    usagestats.setFont(verdana11);
+    usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
+    usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
+    questionnaire.setText("Check for questionnaires");
+    questionnaire.setFont(verdana11);
+    questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
+    questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
+    versioncheck.setText("Check for latest version");
+    versioncheck.setFont(verdana11);
+    versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
+    versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
     newLink.setText("New");
     newLink.addActionListener(new java.awt.event.ActionListener()
     {
@@ -373,7 +464,8 @@ public class GPreferences
     smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
     smoothFont.setText("Smooth Font");
     calcTab.setLayout(null);
-    autoCalculateConsCheck.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
+    autoCalculateConsCheck.setFont(new java.awt.Font("Verdana", Font.PLAIN,
+            11));
     autoCalculateConsCheck.setText("AutoCalculate Consensus");
     autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
     padGaps.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
@@ -440,37 +532,43 @@ public class GPreferences
     this.add(tabbedPane, java.awt.BorderLayout.CENTER);
 
     this.add(okCancelPanel, java.awt.BorderLayout.SOUTH);
-    jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
-        , GridBagConstraints.WEST, GridBagConstraints.NONE,
-        new Insets(0, 2, 4, 0), 5, 0));
-    jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0
-                                                  , GridBagConstraints.WEST,
-                                                  GridBagConstraints.NONE,
-                                                  new Insets(0, 0, 4, 0), 11, 6));
-    connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0
-        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-        new Insets(16, 0, 0, 12), 359, -17));
-    connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0
-        , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-        new Insets(21, 0, 35, 12), 4, 6));
-    connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
-        , GridBagConstraints.WEST, GridBagConstraints.NONE,
-        new Insets(16, 0, 0, 0), 5, 1));
-    jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0
-        , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
-        new Insets(0, 2, 4, 2), 54, 1));
-    jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0
-        , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
-        new Insets(0, 2, 4, 0), 263, 1));
-    connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0
-        , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
-        new Insets(15, 0, 0, 15), 307, 1));
-
-    jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
-                                                 , GridBagConstraints.WEST,
-                                                 GridBagConstraints.NONE,
-                                                 new Insets(0, 2, 5, 185), 2,
-                                                 -4));
+    jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
+            GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+                    2, 4, 0), 5, 0));
+    jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
+            GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+                    0, 4, 0), 11, 6));
+    connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
+            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
+                    16, 0, 0, 12), 359, -17));
+    connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
+            GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
+                    21, 0, 35, 12), 4, 6));
+    connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
+            0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
+            new Insets(16, 0, 0, 0), 5, 1));
+    jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
+            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+            new Insets(0, 2, 4, 2), 54, 1));
+    jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
+            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+            new Insets(0, 2, 4, 0), 263, 1));
+    connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
+            0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+            new Insets(15, 0, 0, 15), 307, 1));
+    connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0,
+            0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+            new Insets(0, 2, 4,2), 70, 1));
+    connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
+            0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+            new Insets(0, 2, 4,2), 70, 1));
+    connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
+            0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+            new Insets(0, 2, 4,2), 70, 1));
+
+    jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
+            GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+                    2, 5, 185), 2, -4));
     DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
     dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
     gapSymbolCB.setRenderer(dlcr);
@@ -499,8 +597,9 @@ public class GPreferences
 
   /**
    * DOCUMENT ME!
-   *
-   * @param e DOCUMENT ME!
+   * 
+   * @param e
+   *                DOCUMENT ME!
    */
   public void ok_actionPerformed(ActionEvent e)
   {
@@ -508,8 +607,9 @@ public class GPreferences
 
   /**
    * DOCUMENT ME!
-   *
-   * @param e DOCUMENT ME!
+   * 
+   * @param e
+   *                DOCUMENT ME!
    */
   public void cancel_actionPerformed(ActionEvent e)
   {
@@ -517,8 +617,9 @@ public class GPreferences
 
   /**
    * DOCUMENT ME!
-   *
-   * @param e DOCUMENT ME!
+   * 
+   * @param e
+   *                DOCUMENT ME!
    */
   public void annotations_actionPerformed(ActionEvent e)
   {