memory monitor, garbage collection and changed menu item for groovy console opening
[jalview.git] / src / jalview / jbgui / GUserDefinedColours.java
index 49174a0..1801152 100755 (executable)
 /*\r
-* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 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
 import java.awt.event.*;\r
-\r
 import javax.swing.*;\r
 \r
-\r
 /**\r
  * DOCUMENT ME!\r
  *\r
  * @author $author$\r
  * @version $Revision$\r
  */\r
-public class GUserDefinedColours extends JPanel\r
+public class GUserDefinedColours\r
+    extends JPanel\r
 {\r
-    protected JColorChooser colorChooser = new JColorChooser();\r
-    protected JPanel buttonPanel = new JPanel();\r
-    protected GridLayout gridLayout = new GridLayout();\r
-    JPanel jPanel2 = new JPanel();\r
-    protected JButton okButton = new JButton();\r
-    protected JButton applyButton = new JButton();\r
-    protected JButton loadbutton = new JButton();\r
-    protected JButton savebutton = new JButton();\r
-    protected JButton cancelButton = new JButton();\r
-    FlowLayout flowLayout1 = new FlowLayout();\r
-\r
-    /**\r
-     * Creates a new GUserDefinedColours object.\r
-     */\r
-    public GUserDefinedColours()\r
+  protected JColorChooser colorChooser = new JColorChooser();\r
+  protected JPanel buttonPanel = new JPanel();\r
+  protected GridLayout gridLayout = new GridLayout();\r
+  JPanel lowerPanel = new JPanel();\r
+  protected JButton okButton = new JButton();\r
+  protected JButton applyButton = new JButton();\r
+  protected JButton loadbutton = new JButton();\r
+  protected JButton savebutton = new JButton();\r
+  protected JButton cancelButton = new JButton();\r
+  JPanel namePanel = new JPanel();\r
+  JLabel jLabel1 = new JLabel();\r
+  protected JTextField schemeName = new JTextField();\r
+  BorderLayout borderLayout1 = new BorderLayout();\r
+  JPanel panel1 = new JPanel();\r
+  JPanel okCancelPanel = new JPanel();\r
+  JPanel saveLoadPanel = new JPanel();\r
+  BorderLayout borderLayout3 = new BorderLayout();\r
+  GridBagLayout gridBagLayout1 = new GridBagLayout();\r
+  BorderLayout borderLayout2 = new BorderLayout();\r
+  FlowLayout flowLayout1 = new FlowLayout();\r
+  BorderLayout borderLayout4 = new BorderLayout();\r
+  JPanel jPanel4 = new JPanel();\r
+  BorderLayout borderLayout5 = new BorderLayout();\r
+  JLabel label = new JLabel();\r
+  protected JPanel casePanel = new JPanel();\r
+  protected JCheckBox caseSensitive = new JCheckBox();\r
+  protected JButton lcaseColour = new JButton();\r
+  /**\r
+   * Creates a new GUserDefinedColours object.\r
+   */\r
+  public GUserDefinedColours()\r
+  {\r
+    try\r
     {\r
-        try\r
-        {\r
-            jbInit();\r
-        }\r
-        catch (Exception e)\r
-        {\r
-            e.printStackTrace();\r
-        }\r
+      jbInit();\r
     }\r
-\r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @throws Exception DOCUMENT ME!\r
-     */\r
-    private void jbInit() throws Exception\r
+    catch (Exception e)\r
     {\r
-        this.setLayout(flowLayout1);\r
-        buttonPanel.setLayout(gridLayout);\r
-        gridLayout.setColumns(6);\r
-        gridLayout.setRows(4);\r
-        okButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        okButton.setText("OK");\r
-        okButton.addActionListener(new java.awt.event.ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    okButton_actionPerformed(e);\r
-                }\r
-            });\r
-        applyButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        applyButton.setText("Apply");\r
-        applyButton.addActionListener(new java.awt.event.ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    applyButton_actionPerformed(e);\r
-                }\r
-            });\r
-        loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        loadbutton.setText("Load scheme");\r
-        loadbutton.addActionListener(new java.awt.event.ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    loadbutton_actionPerformed(e);\r
-                }\r
-            });\r
-        savebutton.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        savebutton.setText("Save scheme");\r
-        savebutton.addActionListener(new java.awt.event.ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    savebutton_actionPerformed(e);\r
-                }\r
-            });\r
-        cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        cancelButton.setText("Cancel");\r
-        cancelButton.addActionListener(new java.awt.event.ActionListener()\r
-            {\r
-                public void actionPerformed(ActionEvent e)\r
-                {\r
-                    cancelButton_actionPerformed(e);\r
-                }\r
-            });\r
-        this.setBackground(new Color(212, 208, 223));\r
-        jPanel2.setOpaque(false);\r
-        colorChooser.setOpaque(false);\r
-        this.add(colorChooser, null);\r
-        this.add(buttonPanel, null);\r
-        this.add(jPanel2, null);\r
-        jPanel2.add(okButton, null);\r
-        jPanel2.add(applyButton, null);\r
-        jPanel2.add(loadbutton, null);\r
-        jPanel2.add(savebutton, null);\r
-        jPanel2.add(cancelButton, null);\r
+      e.printStackTrace();\r
     }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    protected void okButton_actionPerformed(ActionEvent e)\r
-    {\r
-    }\r
+  }\r
 \r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    protected void applyButton_actionPerformed(ActionEvent e)\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @throws Exception DOCUMENT ME!\r
+   */\r
+  private void jbInit()\r
+      throws Exception\r
+  {\r
+    this.setLayout(borderLayout4);\r
+    buttonPanel.setLayout(gridLayout);\r
+    gridLayout.setColumns(4);\r
+    gridLayout.setRows(5);\r
+    okButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    okButton.setText("OK");\r
+    okButton.addActionListener(new java.awt.event.ActionListener()\r
     {\r
-    }\r
-\r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    protected void loadbutton_actionPerformed(ActionEvent e)\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        okButton_actionPerformed(e);\r
+      }\r
+    });\r
+    applyButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    applyButton.setText("Apply");\r
+    applyButton.addActionListener(new java.awt.event.ActionListener()\r
     {\r
-    }\r
-\r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    protected void savebutton_actionPerformed(ActionEvent e)\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        applyButton_actionPerformed(e);\r
+      }\r
+    });\r
+    loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    loadbutton.setText("Load scheme");\r
+    loadbutton.addActionListener(new java.awt.event.ActionListener()\r
     {\r
-    }\r
-\r
-    /**\r
-     * DOCUMENT ME!\r
-     *\r
-     * @param e DOCUMENT ME!\r
-     */\r
-    protected void cancelButton_actionPerformed(ActionEvent e)\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        loadbutton_actionPerformed(e);\r
+      }\r
+    });\r
+    savebutton.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    savebutton.setText("Save scheme");\r
+    savebutton.addActionListener(new java.awt.event.ActionListener()\r
     {\r
-    }\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        savebutton_actionPerformed(e);\r
+      }\r
+    });\r
+    cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    cancelButton.setText("Cancel");\r
+    cancelButton.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        cancelButton_actionPerformed(e);\r
+      }\r
+    });\r
+    this.setBackground(new Color(212, 208, 223));\r
+    lowerPanel.setOpaque(false);\r
+    lowerPanel.setLayout(borderLayout3);\r
+    colorChooser.setOpaque(false);\r
+    jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+    jLabel1.setText("Name");\r
+    namePanel.setMinimumSize(new Dimension(300, 31));\r
+    namePanel.setOpaque(false);\r
+    namePanel.setPreferredSize(new Dimension(240, 25));\r
+    namePanel.setLayout(borderLayout1);\r
+    schemeName.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+    schemeName.setPreferredSize(new Dimension(105, 21));\r
+    schemeName.setText("");\r
+    schemeName.setHorizontalAlignment(SwingConstants.CENTER);\r
+    panel1.setLayout(flowLayout1);\r
+    panel1.setOpaque(false);\r
+    okCancelPanel.setOpaque(false);\r
+    saveLoadPanel.setOpaque(false);\r
+    jPanel4.setLayout(borderLayout5);\r
+    label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));\r
+    label.setOpaque(false);\r
+    label.setPreferredSize(new Dimension(260, 34));\r
+    label.setText(\r
+        "<html>Save your colour scheme with a unique name and it will be added " +\r
+        "to the Colour menu.</html>");\r
+    caseSensitive.setText("Case Sensitive");\r
+    caseSensitive.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        caseSensitive_actionPerformed(e);\r
+      }\r
+    });\r
+    lcaseColour.setText("Lower Case Colour");\r
+    lcaseColour.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        lcaseColour_actionPerformed(e);\r
+      }\r
+    });\r
+\r
+    saveLoadPanel.add(savebutton);\r
+    saveLoadPanel.add(loadbutton);\r
+    okCancelPanel.add(applyButton);\r
+    okCancelPanel.add(okButton);\r
+    okCancelPanel.add(cancelButton);\r
+    lowerPanel.add(saveLoadPanel, java.awt.BorderLayout.NORTH);\r
+    lowerPanel.add(okCancelPanel, java.awt.BorderLayout.SOUTH);\r
+\r
+    namePanel.add(schemeName, java.awt.BorderLayout.CENTER);\r
+    namePanel.add(jLabel1, java.awt.BorderLayout.WEST);\r
+    panel1.add(namePanel, null);\r
+    panel1.add(buttonPanel, null);\r
+    panel1.add(casePanel);\r
+    casePanel.add(caseSensitive);\r
+    casePanel.add(lcaseColour);\r
+    panel1.add(lowerPanel, null);\r
+    panel1.add(label);\r
+\r
+    jPanel4.add(panel1, java.awt.BorderLayout.CENTER);\r
+    this.add(jPanel4, java.awt.BorderLayout.CENTER);\r
+    this.add(colorChooser, java.awt.BorderLayout.EAST);\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void okButton_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void applyButton_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void loadbutton_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void savebutton_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void cancelButton_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  public void caseSensitive_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
+\r
+  public void lcaseColour_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
 }\r