Formatting
[jalview.git] / src / jalview / jbgui / GPreferences.java
index 2b194bf..f5e6604 100755 (executable)
@@ -1,32 +1,28 @@
 /*\r
-* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
-*\r
-* This program is free software; you can redistribute it and/or\r
-* modify it under the terms of the GNU General Public License\r
-* as published by the Free Software Foundation; either version 2\r
-* of the License, or (at your option) any later version.\r
-*\r
-* This program is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-* GNU General Public License for more details.\r
-*\r
-* You should have received a copy of the GNU General Public License\r
-* along with this program; if not, write to the Free Software\r
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
-*/\r
+ * Jalview - A Sequence Alignment Editor and Viewer\r
+ * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
+ */\r
 package jalview.jbgui;\r
 \r
 import java.awt.*;\r
-\r
-import javax.swing.*;\r
-import javax.swing.border.TitledBorder;\r
 import java.awt.event.*;\r
+import javax.swing.*;\r
+import javax.swing.border.*;\r
 import javax.swing.event.*;\r
-import java.awt.Font;\r
-import java.awt.Rectangle;\r
-import java.awt.Insets;\r
 \r
 /**\r
  * DOCUMENT ME!\r
@@ -34,30 +30,31 @@ import java.awt.Insets;
  * @author $author$\r
  * @version $Revision$\r
  */\r
-public class GPreferences extends JPanel\r
+public class GPreferences\r
+    extends JPanel\r
 {\r
-    JTabbedPane tabbedPane = new JTabbedPane();\r
-\r
-    JButton ok = new JButton();\r
-    JButton cancel = new JButton();\r
-    JPanel okCancelPanel = new JPanel();\r
-    BorderLayout borderLayout1 = new BorderLayout();\r
-    protected JCheckBox quality = new JCheckBox();\r
-    JPanel visualTab = new JPanel();\r
+  JTabbedPane tabbedPane = new JTabbedPane();\r
+\r
+  JButton ok = new JButton();\r
+  JButton cancel = new JButton();\r
+  JPanel okCancelPanel = new JPanel();\r
+  BorderLayout borderLayout1 = new BorderLayout();\r
+  protected JCheckBox quality = new JCheckBox();\r
+  JPanel visualTab = new JPanel();\r
   protected JCheckBox fullScreen = new JCheckBox();\r
-    protected JCheckBox conservation = new JCheckBox();\r
-    protected JCheckBox identity = new JCheckBox();\r
-    protected JCheckBox annotations = new JCheckBox();\r
-    JLabel gapLabel = new JLabel();\r
-    protected JComboBox colour = new JComboBox();\r
-    JLabel colourLabel = new JLabel();\r
-    JLabel fontLabel = new JLabel();\r
-    protected JComboBox fontSizeCB = new JComboBox();\r
-    protected JComboBox fontStyleCB = new JComboBox();\r
-    protected JComboBox fontNameCB = new JComboBox();\r
-    protected JComboBox gapSymbolCB = new JComboBox();\r
-    protected JCheckBox startupCheckbox = new JCheckBox();\r
-    protected JTextField startupFileTextfield = new JTextField();\r
+  protected JCheckBox conservation = new JCheckBox();\r
+  protected JCheckBox identity = new JCheckBox();\r
+  protected JCheckBox annotations = new JCheckBox();\r
+  JLabel gapLabel = new JLabel();\r
+  protected JComboBox colour = new JComboBox();\r
+  JLabel colourLabel = new JLabel();\r
+  JLabel fontLabel = new JLabel();\r
+  protected JComboBox fontSizeCB = new JComboBox();\r
+  protected JComboBox fontStyleCB = new JComboBox();\r
+  protected JComboBox fontNameCB = new JComboBox();\r
+  protected JComboBox gapSymbolCB = new JComboBox();\r
+  protected JCheckBox startupCheckbox = new JCheckBox();\r
+  protected JTextField startupFileTextfield = new JTextField();\r
   JPanel connectTab = new JPanel();\r
   JLabel serverLabel = new JLabel();\r
   protected JList linkURLList = new JList();\r
@@ -93,14 +90,14 @@ public class GPreferences extends JPanel
   JLabel epsLabel = new JLabel();\r
   protected JComboBox epsRendering = new JComboBox();\r
   JLabel jLabel1 = new JLabel();\r
-  protected  JCheckBox blcjv = new JCheckBox();\r
-  protected  JCheckBox pileupjv = new JCheckBox();\r
-  protected  JCheckBox clustaljv = new JCheckBox();\r
-  protected  JCheckBox msfjv = new JCheckBox();\r
-  protected  JCheckBox fastajv = new JCheckBox();\r
-  protected  JCheckBox pfamjv = new JCheckBox();\r
+  protected JCheckBox blcjv = new JCheckBox();\r
+  protected JCheckBox pileupjv = new JCheckBox();\r
+  protected JCheckBox clustaljv = new JCheckBox();\r
+  protected JCheckBox msfjv = new JCheckBox();\r
+  protected JCheckBox fastajv = new JCheckBox();\r
+  protected JCheckBox pfamjv = new JCheckBox();\r
   FlowLayout flowLayout1 = new FlowLayout();\r
-  protected  JCheckBox pirjv = new JCheckBox();\r
+  protected JCheckBox pirjv = new JCheckBox();\r
   JPanel jPanel11 = new JPanel();\r
   Font verdana11 = new java.awt.Font("Verdana", Font.PLAIN, 11);\r
   protected JCheckBox seqLimit = new JCheckBox();\r
@@ -116,118 +113,119 @@ public class GPreferences extends JPanel
   protected JCheckBox rightAlign = new JCheckBox();\r
   protected JCheckBox idItalics = new JCheckBox();\r
   /**\r
-     * Creates a new GPreferences object.\r
-     */\r
-    public GPreferences()\r
+   * Creates a new GPreferences object.\r
+   */\r
+  public GPreferences()\r
+  {\r
+    try\r
     {\r
-        try\r
-        {\r
-            jbInit();\r
-        }\r
-        catch (Exception ex)\r
-        {\r
-            ex.printStackTrace();\r
-        }\r
+      jbInit();\r
+    }\r
+    catch (Exception ex)\r
+    {\r
+      ex.printStackTrace();\r
     }\r
+  }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @throws Exception DOCUMENT ME!\r
-     */\r
-    private void jbInit() throws Exception\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @throws Exception DOCUMENT ME!\r
+   */\r
+  private void jbInit()\r
+      throws Exception\r
+  {\r
+    this.setLayout(borderLayout1);\r
+    ok.setText("OK");\r
+    ok.addActionListener(new ActionListener()\r
     {\r
-        this.setLayout(borderLayout1);\r
-        ok.setText("OK");\r
-        ok.addActionListener(new ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    ok_actionPerformed(e);\r
-                }\r
-            });\r
-        cancel.setText("Cancel");\r
-        cancel.addActionListener(new ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    cancel_actionPerformed(e);\r
-                }\r
-            });\r
-        quality.setEnabled(false);\r
-        quality.setFont(verdana11);\r
-        quality.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        quality.setHorizontalTextPosition(SwingConstants.LEFT);\r
-        quality.setSelected(true);\r
-        quality.setText("Quality");\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        ok_actionPerformed(e);\r
+      }\r
+    });\r
+    cancel.setText("Cancel");\r
+    cancel.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        cancel_actionPerformed(e);\r
+      }\r
+    });\r
+    quality.setEnabled(false);\r
+    quality.setFont(verdana11);\r
+    quality.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    quality.setHorizontalTextPosition(SwingConstants.LEFT);\r
+    quality.setSelected(true);\r
+    quality.setText("Quality");\r
     visualTab.setBorder(new TitledBorder("Open new alignment"));\r
     visualTab.setLayout(null);\r
     fullScreen.setFont(verdana11);\r
-        fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);\r
+    fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);\r
     fullScreen.setText("Maximise Window");\r
     conservation.setEnabled(false);\r
-        conservation.setFont(verdana11);\r
-        conservation.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        conservation.setHorizontalTextPosition(SwingConstants.LEFT);\r
-        conservation.setSelected(true);\r
-        conservation.setText("Conservation");\r
+    conservation.setFont(verdana11);\r
+    conservation.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    conservation.setHorizontalTextPosition(SwingConstants.LEFT);\r
+    conservation.setSelected(true);\r
+    conservation.setText("Conservation");\r
     identity.setEnabled(false);\r
-        identity.setFont(verdana11);\r
-        identity.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        identity.setHorizontalTextPosition(SwingConstants.LEFT);\r
-        identity.setSelected(true);\r
-        identity.setText("Consensus");\r
+    identity.setFont(verdana11);\r
+    identity.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    identity.setHorizontalTextPosition(SwingConstants.LEFT);\r
+    identity.setSelected(true);\r
+    identity.setText("Consensus");\r
     annotations.setFont(verdana11);\r
-        annotations.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        annotations.setHorizontalTextPosition(SwingConstants.LEFT);\r
+    annotations.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    annotations.setHorizontalTextPosition(SwingConstants.LEFT);\r
     annotations.setSelected(true);\r
-        annotations.setText("Show Annotations");\r
+    annotations.setText("Show Annotations");\r
     annotations.addActionListener(new ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    annotations_actionPerformed(e);\r
-                }\r
-            });\r
-        gapLabel.setFont(verdana11);\r
-        gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        gapLabel.setText("Gap Symbol ");\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        annotations_actionPerformed(e);\r
+      }\r
+    });\r
+    gapLabel.setFont(verdana11);\r
+    gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    gapLabel.setText("Gap Symbol ");\r
     colour.setFont(verdana11);\r
-        colour.setBounds(new Rectangle(172, 225, 155, 21));\r
-        colourLabel.setFont(verdana11);\r
-        colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        colourLabel.setText("Colour ");\r
+    colour.setBounds(new Rectangle(172, 225, 155, 21));\r
+    colourLabel.setFont(verdana11);\r
+    colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    colourLabel.setText("Colour ");\r
     fontLabel.setFont(verdana11);\r
-        fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        fontLabel.setText("Font ");\r
+    fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    fontLabel.setText("Font ");\r
     fontSizeCB.setFont(verdana11);\r
-        fontSizeCB.setBounds(new Rectangle(319, 111, 49, 21));\r
-        fontStyleCB.setFont(verdana11);\r
-        fontStyleCB.setBounds(new Rectangle(367, 111, 70, 21));\r
-        fontNameCB.setFont(verdana11);\r
-        fontNameCB.setBounds(new Rectangle(172, 111, 147, 21));\r
-        gapSymbolCB.setFont(verdana11);\r
-        gapSymbolCB.setBounds(new Rectangle(172, 204, 69, 21));\r
-        startupCheckbox.setText("Open file");\r
+    fontSizeCB.setBounds(new Rectangle(319, 111, 49, 21));\r
+    fontStyleCB.setFont(verdana11);\r
+    fontStyleCB.setBounds(new Rectangle(367, 111, 70, 21));\r
+    fontNameCB.setFont(verdana11);\r
+    fontNameCB.setBounds(new Rectangle(172, 111, 147, 21));\r
+    gapSymbolCB.setFont(verdana11);\r
+    gapSymbolCB.setBounds(new Rectangle(172, 204, 69, 21));\r
+    startupCheckbox.setText("Open file");\r
     startupCheckbox.setFont(verdana11);\r
-        startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);\r
-        startupCheckbox.setSelected(true);\r
-        startupFileTextfield.setFont(verdana11);\r
-        startupFileTextfield.setBounds(new Rectangle(172, 273, 270, 20));\r
-        startupFileTextfield.addMouseListener(new MouseAdapter()\r
-            {\r
-                public void mouseClicked(MouseEvent e)\r
-                {\r
-                    if (e.getClickCount() > 1)\r
-                    {\r
-                        startupFileTextfield_mouseClicked();\r
-                    }\r
-                }\r
-            });\r
+    startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);\r
+    startupCheckbox.setSelected(true);\r
+    startupFileTextfield.setFont(verdana11);\r
+    startupFileTextfield.setBounds(new Rectangle(172, 273, 270, 20));\r
+    startupFileTextfield.addMouseListener(new MouseAdapter()\r
+    {\r
+      public void mouseClicked(MouseEvent e)\r
+      {\r
+        if (e.getClickCount() > 1)\r
+        {\r
+          startupFileTextfield_mouseClicked();\r
+        }\r
+      }\r
+    });\r
 \r
-     connectTab.setLayout(gridBagLayout3);\r
+    connectTab.setLayout(gridBagLayout3);\r
     serverLabel.setText("Address");\r
     serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
     serverLabel.setFont(verdana11);\r
@@ -242,41 +240,47 @@ public class GPreferences extends JPanel
     defaultBrowser.setFont(verdana11);\r
     defaultBrowser.setText("");\r
     newLink.setText("New");\r
-    newLink.addActionListener(new java.awt.event.ActionListener() {\r
-      public void actionPerformed(ActionEvent e) {\r
+    newLink.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
         newLink_actionPerformed(e);\r
       }\r
     });\r
     editLink.setText("Edit");\r
-    editLink.addActionListener(new java.awt.event.ActionListener() {\r
-      public void actionPerformed(ActionEvent e) {\r
+    editLink.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
         editLink_actionPerformed(e);\r
       }\r
     });\r
     deleteLink.setText("Delete");\r
-    deleteLink.addActionListener(new java.awt.event.ActionListener() {\r
-      public void actionPerformed(ActionEvent e) {\r
+    deleteLink.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
         deleteLink_actionPerformed(e);\r
       }\r
     });\r
 \r
     linkURLList.addListSelectionListener(new ListSelectionListener()\r
-         {\r
-            public void valueChanged(ListSelectionEvent e)\r
-            {\r
-               int index = linkURLList.getSelectedIndex();\r
-               linkNameList.setSelectedIndex(index);\r
-            }\r
-         });\r
+    {\r
+      public void valueChanged(ListSelectionEvent e)\r
+      {\r
+        int index = linkURLList.getSelectedIndex();\r
+        linkNameList.setSelectedIndex(index);\r
+      }\r
+    });\r
 \r
     linkNameList.addListSelectionListener(new ListSelectionListener()\r
-        {\r
-          public void valueChanged(ListSelectionEvent e)\r
-          {\r
-              int index = linkNameList.getSelectedIndex();\r
-              linkURLList.setSelectedIndex(index);\r
-          }\r
-        });\r
+    {\r
+      public void valueChanged(ListSelectionEvent e)\r
+      {\r
+        int index = linkNameList.getSelectedIndex();\r
+        linkURLList.setSelectedIndex(index);\r
+      }\r
+    });\r
 \r
     linkScrollPane.setBorder(null);\r
     linkPanel.setBorder(new TitledBorder("URL link from Sequence ID"));\r
@@ -294,9 +298,9 @@ public class GPreferences extends JPanel
       public void mouseClicked(MouseEvent e)\r
       {\r
         if (e.getClickCount() > 1)\r
-            {\r
-              defaultBrowser_mouseClicked(e);\r
-            }\r
+        {\r
+          defaultBrowser_mouseClicked(e);\r
+        }\r
       }\r
     });\r
     useProxy.setFont(verdana11);\r
@@ -422,11 +426,11 @@ public class GPreferences extends JPanel
     linkScrollPane.getViewport().add(linkPanel2, null);\r
     linkPanel2.add(linkURLList, BorderLayout.CENTER);\r
     linkPanel2.add(linkNameList, BorderLayout.WEST);\r
-        okCancelPanel.add(ok);\r
-        okCancelPanel.add(cancel);\r
+    okCancelPanel.add(ok);\r
+    okCancelPanel.add(cancel);\r
     this.add(tabbedPane, java.awt.BorderLayout.CENTER);\r
 \r
-        this.add(okCancelPanel, java.awt.BorderLayout.SOUTH);\r
+    this.add(okCancelPanel, java.awt.BorderLayout.SOUTH);\r
     jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0\r
         , GridBagConstraints.WEST, GridBagConstraints.NONE,\r
         new Insets(0, 2, 4, 0), 5, 0));\r
@@ -453,18 +457,17 @@ public class GPreferences extends JPanel
         , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,\r
         new Insets(15, 0, 0, 15), 307, 1));\r
 \r
-\r
     jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0\r
                                                  , GridBagConstraints.WEST,\r
                                                  GridBagConstraints.NONE,\r
                                                  new Insets(0, 2, 5, 185), 2,\r
                                                  -4));\r
     DefaultListCellRenderer dlcr = new DefaultListCellRenderer();\r
-        dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);\r
-        gapSymbolCB.setRenderer(dlcr);\r
+    dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);\r
+    gapSymbolCB.setRenderer(dlcr);\r
 \r
     tabbedPane.add(visualTab, "Visual");\r
-    tabbedPane.add(connectTab,"Connections");\r
+    tabbedPane.add(connectTab, "Connections");\r
     tabbedPane.add(exportTab, "Output");\r
     jPanel11.add(jLabel1);\r
     jPanel11.add(blcjv);\r
@@ -485,51 +488,52 @@ public class GPreferences extends JPanel
     exportTab.add(jPanel11);\r
   }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    public void ok_actionPerformed(ActionEvent e)\r
-    {\r
-    }\r
-\r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    public void cancel_actionPerformed(ActionEvent e)\r
-    {\r
-    }\r
-\r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    public void annotations_actionPerformed(ActionEvent e)\r
-    {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  public void ok_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  public void cancel_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     */\r
-    public void startupFileTextfield_mouseClicked()\r
-    {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  public void annotations_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
+  /**\r
+   * DOCUMENT ME!\r
+   */\r
+  public void startupFileTextfield_mouseClicked()\r
+  {\r
+  }\r
 \r
-  public void newLink_actionPerformed(ActionEvent e) {\r
+  public void newLink_actionPerformed(ActionEvent e)\r
+  {\r
 \r
   }\r
 \r
-  public void editLink_actionPerformed(ActionEvent e) {\r
+  public void editLink_actionPerformed(ActionEvent e)\r
+  {\r
 \r
   }\r
 \r
-  public void deleteLink_actionPerformed(ActionEvent e) {\r
+  public void deleteLink_actionPerformed(ActionEvent e)\r
+  {\r
 \r
   }\r
 \r
@@ -545,8 +549,8 @@ public class GPreferences extends JPanel
 \r
   public void useProxy_actionPerformed()\r
   {\r
-      proxyServerTB.setEnabled(useProxy.isSelected());\r
-      proxyPortTB.setEnabled(useProxy.isSelected());\r
+    proxyServerTB.setEnabled(useProxy.isSelected());\r
+    proxyPortTB.setEnabled(useProxy.isSelected());\r
   }\r
 \r
 }\r