JAL-1432 updated copyright notices
[jalview.git] / src / jalview / jbgui / GFontChooser.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.jbgui;
20
21 import jalview.gui.JvSwingUtils;
22
23 import java.awt.*;
24 import java.awt.event.*;
25 import javax.swing.*;
26
27 /**
28  * DOCUMENT ME!
29  * 
30  * @author $author$
31  * @version $Revision$
32  */
33 public class GFontChooser extends JPanel
34 {
35   JLabel jLabel1 = new JLabel();
36
37   protected JComboBox fontSize = new JComboBox();
38
39   protected JComboBox fontStyle = new JComboBox();
40
41   JLabel jLabel2 = new JLabel();
42
43   JLabel jLabel3 = new JLabel();
44
45   protected JComboBox fontName = new JComboBox();
46
47   JButton ok = new JButton();
48
49   JButton cancel = new JButton();
50
51   JPanel jPanel1 = new JPanel();
52
53   JPanel jPanel2 = new JPanel();
54
55   JPanel jPanel3 = new JPanel();
56
57   BorderLayout borderLayout1 = new BorderLayout();
58
59   BorderLayout borderLayout2 = new BorderLayout();
60
61   BorderLayout borderLayout3 = new BorderLayout();
62
63   protected JButton defaultButton = new JButton();
64
65   protected JCheckBox smoothFont = new JCheckBox();
66
67   BorderLayout borderLayout4 = new BorderLayout();
68
69   protected JCheckBox monospaced = new JCheckBox();
70
71   JPanel jPanel4 = new JPanel();
72
73   /**
74    * Creates a new GFontChooser object.
75    */
76   public GFontChooser()
77   {
78     try
79     {
80       jbInit();
81     } catch (Exception e)
82     {
83       e.printStackTrace();
84     }
85   }
86
87   /**
88    * DOCUMENT ME!
89    * 
90    * @throws Exception
91    *           DOCUMENT ME!
92    */
93   private void jbInit() throws Exception
94   {
95     jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));
96     jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
97     jLabel1.setText("Font: ");
98     jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
99     this.setLayout(null);
100     fontSize.setFont(new java.awt.Font("Verdana", 0, 11));
101     fontSize.setOpaque(false);
102     fontSize.setPreferredSize(new Dimension(50, 21));
103     fontSize.addActionListener(new java.awt.event.ActionListener()
104     {
105       public void actionPerformed(ActionEvent e)
106       {
107         fontSize_actionPerformed(e);
108       }
109     });
110     fontStyle.setFont(new java.awt.Font("Verdana", 0, 11));
111     fontStyle.setOpaque(false);
112     fontStyle.setPreferredSize(new Dimension(90, 21));
113     fontStyle.addActionListener(new java.awt.event.ActionListener()
114     {
115       public void actionPerformed(ActionEvent e)
116       {
117         fontStyle_actionPerformed(e);
118       }
119     });
120     jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));
121     jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
122     jLabel2.setText("Size: ");
123     jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
124     jLabel3.setFont(new java.awt.Font("Verdana", 0, 11));
125     jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
126     jLabel3.setText("Style: ");
127     jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
128     fontName.setFont(new java.awt.Font("Verdana", 0, 11));
129     fontName.setMaximumSize(new Dimension(32767, 32767));
130     fontName.setMinimumSize(new Dimension(300, 21));
131     fontName.setOpaque(false);
132     fontName.setPreferredSize(new Dimension(180, 21));
133     fontName.addActionListener(new java.awt.event.ActionListener()
134     {
135       public void actionPerformed(ActionEvent e)
136       {
137         fontName_actionPerformed(e);
138       }
139     });
140     ok.setFont(new java.awt.Font("Verdana", 0, 11));
141     ok.setText("OK");
142     ok.addActionListener(new java.awt.event.ActionListener()
143     {
144       public void actionPerformed(ActionEvent e)
145       {
146         ok_actionPerformed(e);
147       }
148     });
149     cancel.setFont(new java.awt.Font("Verdana", 0, 11));
150     cancel.setText("Cancel");
151     cancel.addActionListener(new java.awt.event.ActionListener()
152     {
153       public void actionPerformed(ActionEvent e)
154       {
155         cancel_actionPerformed(e);
156       }
157     });
158     this.setBackground(Color.white);
159     jPanel1.setOpaque(false);
160     jPanel1.setBounds(new Rectangle(5, 6, 308, 23));
161     jPanel1.setLayout(borderLayout1);
162     jPanel2.setOpaque(false);
163     jPanel2.setBounds(new Rectangle(5, 37, 128, 21));
164     jPanel2.setLayout(borderLayout3);
165     jPanel3.setOpaque(false);
166     jPanel3.setBounds(new Rectangle(174, 38, 134, 21));
167     jPanel3.setLayout(borderLayout2);
168     defaultButton.setFont(JvSwingUtils.getLabelFont());
169     defaultButton.setText("Set as Default");
170     defaultButton.addActionListener(new ActionListener()
171     {
172       public void actionPerformed(ActionEvent e)
173       {
174         defaultButton_actionPerformed(e);
175       }
176     });
177     smoothFont.setFont(JvSwingUtils.getLabelFont());
178     smoothFont.setOpaque(false);
179     smoothFont.setText("Anti-alias Fonts (Slower to render)");
180     smoothFont.setBounds(new Rectangle(41, 65, 223, 23));
181     smoothFont.addActionListener(new ActionListener()
182     {
183       public void actionPerformed(ActionEvent e)
184       {
185         smoothFont_actionPerformed(e);
186       }
187     });
188     monospaced.setEnabled(false);
189     monospaced.setFont(JvSwingUtils.getLabelFont());
190     monospaced.setOpaque(false);
191     monospaced.setToolTipText("Monospaced fonts are faster to render");
192     monospaced.setText("Monospaced");
193     jPanel4.setOpaque(false);
194     jPanel4.setBounds(new Rectangle(24, 92, 259, 35));
195     jPanel1.add(jLabel1, BorderLayout.WEST);
196     jPanel1.add(fontName, BorderLayout.CENTER);
197     jPanel1.add(monospaced, java.awt.BorderLayout.EAST);
198     this.add(jPanel3, null);
199     this.add(jPanel2, null);
200     jPanel2.add(fontSize, java.awt.BorderLayout.CENTER);
201     jPanel2.add(jLabel2, java.awt.BorderLayout.WEST);
202     jPanel4.add(defaultButton);
203     jPanel4.add(ok);
204     jPanel4.add(cancel);
205     this.add(smoothFont);
206     this.add(jPanel4);
207     jPanel3.add(jLabel3, java.awt.BorderLayout.WEST);
208     jPanel3.add(fontStyle, java.awt.BorderLayout.CENTER);
209     this.add(jPanel1, null);
210   }
211
212   /**
213    * DOCUMENT ME!
214    * 
215    * @param e
216    *          DOCUMENT ME!
217    */
218   protected void ok_actionPerformed(ActionEvent e)
219   {
220   }
221
222   /**
223    * DOCUMENT ME!
224    * 
225    * @param e
226    *          DOCUMENT ME!
227    */
228   protected void cancel_actionPerformed(ActionEvent e)
229   {
230   }
231
232   /**
233    * DOCUMENT ME!
234    * 
235    * @param e
236    *          DOCUMENT ME!
237    */
238   protected void fontName_actionPerformed(ActionEvent e)
239   {
240   }
241
242   /**
243    * DOCUMENT ME!
244    * 
245    * @param e
246    *          DOCUMENT ME!
247    */
248   protected void fontSize_actionPerformed(ActionEvent e)
249   {
250   }
251
252   /**
253    * DOCUMENT ME!
254    * 
255    * @param e
256    *          DOCUMENT ME!
257    */
258   protected void fontStyle_actionPerformed(ActionEvent e)
259   {
260   }
261
262   /**
263    * DOCUMENT ME!
264    * 
265    * @param e
266    *          DOCUMENT ME!
267    */
268   public void defaultButton_actionPerformed(ActionEvent e)
269   {
270   }
271
272   public void smoothFont_actionPerformed(ActionEvent e)
273   {
274
275   }
276 }