Formatting
[jalview.git] / src / jalview / jbgui / GFontChooser.java
index 4ca3b42..6c04561 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
+ * DOCUMENT ME!\r
+ *\r
+ * @author $author$\r
+ * @version $Revision$\r
+ */\r
+public class GFontChooser\r
+    extends JPanel\r
+{\r
+  JLabel jLabel1 = new JLabel();\r
+  protected JComboBox fontSize = new JComboBox();\r
+  protected JComboBox fontStyle = new JComboBox();\r
+  JLabel jLabel2 = new JLabel();\r
+  JLabel jLabel3 = new JLabel();\r
+  protected JComboBox fontName = new JComboBox();\r
+  JButton ok = new JButton();\r
+  JButton cancel = new JButton();\r
+  JPanel jPanel1 = new JPanel();\r
+  JPanel jPanel2 = new JPanel();\r
+  JPanel jPanel3 = new JPanel();\r
+  BorderLayout borderLayout1 = new BorderLayout();\r
+  BorderLayout borderLayout2 = new BorderLayout();\r
+  BorderLayout borderLayout3 = new BorderLayout();\r
+  protected JButton defaultButton = new JButton();\r
+  protected JCheckBox smoothFont = new JCheckBox();\r
+  BorderLayout borderLayout4 = new BorderLayout();\r
+  protected JCheckBox monospaced = new JCheckBox();\r
+  JPanel jPanel4 = new JPanel();\r
 \r
-public class GFontChooser extends JPanel {\r
-    JLabel jLabel1 = new JLabel();\r
-    protected JComboBox fontSize = new JComboBox();\r
-    protected JComboBox fontStyle = new JComboBox();\r
-    JLabel jLabel2 = new JLabel();\r
-    JLabel jLabel3 = new JLabel();\r
-    protected JComboBox fontName = new JComboBox();\r
-    JButton ok = new JButton();\r
-    JButton cancel = new JButton();\r
-    JPanel jPanel1 = new JPanel();\r
-    JPanel jPanel2 = new JPanel();\r
-    JPanel jPanel3 = new JPanel();\r
-    BorderLayout borderLayout1 = new BorderLayout();\r
-    BorderLayout borderLayout2 = new BorderLayout();\r
-    BorderLayout borderLayout3 = new BorderLayout();\r
-    FlowLayout flowLayout1 = new FlowLayout();\r
-    JButton defaultButton = new JButton();\r
-\r
-    public GFontChooser() {\r
-        try {\r
-            jbInit();\r
-        } catch (Exception e) {\r
-            e.printStackTrace();\r
-        }\r
+  /**\r
+   * Creates a new GFontChooser object.\r
+   */\r
+  public GFontChooser()\r
+  {\r
+    try\r
+    {\r
+      jbInit();\r
     }\r
-\r
-    private void jbInit() throws Exception {\r
-        jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        jLabel1.setText("Font: ");\r
-        jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);\r
-        this.setLayout(flowLayout1);\r
-        fontSize.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        fontSize.setOpaque(false);\r
-        fontSize.setPreferredSize(new Dimension(50, 21));\r
-        fontSize.addActionListener(new java.awt.event.ActionListener() {\r
-                public void actionPerformed(ActionEvent e) {\r
-                    fontSize_actionPerformed(e);\r
-                }\r
-            });\r
-        fontStyle.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        fontStyle.setOpaque(false);\r
-        fontStyle.setPreferredSize(new Dimension(90, 21));\r
-        fontStyle.addActionListener(new java.awt.event.ActionListener() {\r
-                public void actionPerformed(ActionEvent e) {\r
-                    fontStyle_actionPerformed(e);\r
-                }\r
-            });\r
-        jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        jLabel2.setText("Size: ");\r
-        jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);\r
-        jLabel3.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);\r
-        jLabel3.setText("Style: ");\r
-        jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);\r
-        fontName.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        fontName.setMaximumSize(new Dimension(32767, 32767));\r
-        fontName.setMinimumSize(new Dimension(300, 21));\r
-        fontName.setOpaque(false);\r
-        fontName.setPreferredSize(new Dimension(180, 21));\r
-        fontName.addActionListener(new java.awt.event.ActionListener() {\r
-                public void actionPerformed(ActionEvent e) {\r
-                    fontName_actionPerformed(e);\r
-                }\r
-            });\r
-        ok.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        ok.setText("OK");\r
-        ok.addActionListener(new java.awt.event.ActionListener() {\r
-                public void actionPerformed(ActionEvent e) {\r
-                    ok_actionPerformed(e);\r
-                }\r
-            });\r
-        cancel.setFont(new java.awt.Font("Verdana", 0, 11));\r
-        cancel.setText("Cancel");\r
-        cancel.addActionListener(new java.awt.event.ActionListener() {\r
-                public void actionPerformed(ActionEvent e) {\r
-                    cancel_actionPerformed(e);\r
-                }\r
-            });\r
-        this.setBackground(Color.white);\r
-        jPanel1.setOpaque(false);\r
-        jPanel1.setLayout(borderLayout1);\r
-        jPanel2.setOpaque(false);\r
-        jPanel2.setLayout(borderLayout3);\r
-        jPanel3.setOpaque(false);\r
-        jPanel3.setLayout(borderLayout2);\r
-        flowLayout1.setAlignment(FlowLayout.CENTER);\r
-        flowLayout1.setVgap(5);\r
-        defaultButton.setText("Set as Default");\r
-        defaultButton.addActionListener(new ActionListener() {\r
-                public void actionPerformed(ActionEvent e) {\r
-                    defaultButton_actionPerformed(e);\r
-                }\r
-            });\r
-        this.add(jPanel1, null);\r
-        jPanel1.add(jLabel1, BorderLayout.WEST);\r
-        jPanel1.add(fontName, BorderLayout.CENTER);\r
-        this.add(jPanel3, null);\r
-        this.add(jPanel2, null);\r
-        jPanel2.add(jLabel3, BorderLayout.WEST);\r
-        jPanel2.add(fontStyle, BorderLayout.CENTER);\r
-        jPanel3.add(jLabel2, BorderLayout.WEST);\r
-        jPanel3.add(fontSize, BorderLayout.CENTER);\r
-        this.add(ok, null);\r
-        this.add(cancel, null);\r
-        this.add(defaultButton);\r
+    catch (Exception e)\r
+    {\r
+      e.printStackTrace();\r
     }\r
+  }\r
 \r
-    protected void ok_actionPerformed(ActionEvent e) {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @throws Exception DOCUMENT ME!\r
+   */\r
+  private void jbInit()\r
+      throws Exception\r
+  {\r
+    jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    jLabel1.setText("Font: ");\r
+    jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);\r
+    this.setLayout(null);\r
+    fontSize.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    fontSize.setOpaque(false);\r
+    fontSize.setPreferredSize(new Dimension(50, 21));\r
+    fontSize.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        fontSize_actionPerformed(e);\r
+      }\r
+    });\r
+    fontStyle.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    fontStyle.setOpaque(false);\r
+    fontStyle.setPreferredSize(new Dimension(90, 21));\r
+    fontStyle.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        fontStyle_actionPerformed(e);\r
+      }\r
+    });\r
+    jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    jLabel2.setText("Size: ");\r
+    jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);\r
+    jLabel3.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);\r
+    jLabel3.setText("Style: ");\r
+    jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);\r
+    fontName.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    fontName.setMaximumSize(new Dimension(32767, 32767));\r
+    fontName.setMinimumSize(new Dimension(300, 21));\r
+    fontName.setOpaque(false);\r
+    fontName.setPreferredSize(new Dimension(180, 21));\r
+    fontName.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        fontName_actionPerformed(e);\r
+      }\r
+    });\r
+    ok.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    ok.setText("OK");\r
+    ok.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        ok_actionPerformed(e);\r
+      }\r
+    });\r
+    cancel.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    cancel.setText("Cancel");\r
+    cancel.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        cancel_actionPerformed(e);\r
+      }\r
+    });\r
+    this.setBackground(Color.white);\r
+    jPanel1.setOpaque(false);\r
+    jPanel1.setBounds(new Rectangle(5, 6, 308, 23));\r
+    jPanel1.setLayout(borderLayout1);\r
+    jPanel2.setOpaque(false);\r
+    jPanel2.setBounds(new Rectangle(5, 37, 128, 21));\r
+    jPanel2.setLayout(borderLayout3);\r
+    jPanel3.setOpaque(false);\r
+    jPanel3.setBounds(new Rectangle(174, 38, 134, 21));\r
+    jPanel3.setLayout(borderLayout2);\r
+    defaultButton.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+    defaultButton.setText("Set as Default");\r
+    defaultButton.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        defaultButton_actionPerformed(e);\r
+      }\r
+    });\r
+    smoothFont.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+    smoothFont.setOpaque(false);\r
+    smoothFont.setText("Anti-alias Fonts (Slower to render)");\r
+    smoothFont.setBounds(new Rectangle(41, 65, 223, 23));\r
+    smoothFont.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        smoothFont_actionPerformed(e);\r
+      }\r
+    });\r
+    monospaced.setEnabled(false);\r
+    monospaced.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+    monospaced.setOpaque(false);\r
+    monospaced.setToolTipText("Monospaced fonts are faster to render");\r
+    monospaced.setText("Monospaced");\r
+    jPanel4.setOpaque(false);\r
+    jPanel4.setBounds(new Rectangle(24, 92, 259, 35));\r
+    jPanel1.add(jLabel1, BorderLayout.WEST);\r
+    jPanel1.add(fontName, BorderLayout.CENTER);\r
+    jPanel1.add(monospaced, java.awt.BorderLayout.EAST);\r
+    this.add(jPanel3, null);\r
+    this.add(jPanel2, null);\r
+    jPanel2.add(fontSize, java.awt.BorderLayout.CENTER);\r
+    jPanel2.add(jLabel2, java.awt.BorderLayout.WEST);\r
+    jPanel4.add(defaultButton);\r
+    jPanel4.add(ok);\r
+    jPanel4.add(cancel);\r
+    this.add(smoothFont);\r
+    this.add(jPanel4);\r
+    jPanel3.add(jLabel3, java.awt.BorderLayout.WEST);\r
+    jPanel3.add(fontStyle, java.awt.BorderLayout.CENTER);\r
+    this.add(jPanel1, null);\r
+  }\r
 \r
-    protected void cancel_actionPerformed(ActionEvent e) {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void ok_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
-    protected void fontName_actionPerformed(ActionEvent e) {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void cancel_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
-    protected void fontSize_actionPerformed(ActionEvent e) {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void fontName_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
-    protected void fontStyle_actionPerformed(ActionEvent e) {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void fontSize_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
 \r
-    public void defaultButton_actionPerformed(ActionEvent e) {\r
-    }\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  protected void fontStyle_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param e DOCUMENT ME!\r
+   */\r
+  public void defaultButton_actionPerformed(ActionEvent e)\r
+  {\r
+  }\r
+\r
+  public void smoothFont_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
 }\r