update author list in license for (JAL-826)
[jalview.git] / src / jalview / jbgui / GFontChooser.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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  */
18 package jalview.jbgui;
19
20 import jalview.gui.JvSwingUtils;
21
22 import java.awt.*;
23 import java.awt.event.*;
24 import javax.swing.*;
25
26 /**
27  * DOCUMENT ME!
28  * 
29  * @author $author$
30  * @version $Revision$
31  */
32 public class GFontChooser extends JPanel
33 {
34   JLabel jLabel1 = new JLabel();
35
36   protected JComboBox fontSize = new JComboBox();
37
38   protected JComboBox fontStyle = new JComboBox();
39
40   JLabel jLabel2 = new JLabel();
41
42   JLabel jLabel3 = new JLabel();
43
44   protected JComboBox fontName = new JComboBox();
45
46   JButton ok = new JButton();
47
48   JButton cancel = new JButton();
49
50   JPanel jPanel1 = new JPanel();
51
52   JPanel jPanel2 = new JPanel();
53
54   JPanel jPanel3 = new JPanel();
55
56   BorderLayout borderLayout1 = new BorderLayout();
57
58   BorderLayout borderLayout2 = new BorderLayout();
59
60   BorderLayout borderLayout3 = new BorderLayout();
61
62   protected JButton defaultButton = new JButton();
63
64   protected JCheckBox smoothFont = new JCheckBox();
65
66   BorderLayout borderLayout4 = new BorderLayout();
67
68   protected JCheckBox monospaced = new JCheckBox();
69
70   JPanel jPanel4 = new JPanel();
71
72   /**
73    * Creates a new GFontChooser object.
74    */
75   public GFontChooser()
76   {
77     try
78     {
79       jbInit();
80     } catch (Exception e)
81     {
82       e.printStackTrace();
83     }
84   }
85
86   /**
87    * DOCUMENT ME!
88    * 
89    * @throws Exception
90    *           DOCUMENT ME!
91    */
92   private void jbInit() throws Exception
93   {
94     jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));
95     jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
96     jLabel1.setText("Font: ");
97     jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
98     this.setLayout(null);
99     fontSize.setFont(new java.awt.Font("Verdana", 0, 11));
100     fontSize.setOpaque(false);
101     fontSize.setPreferredSize(new Dimension(50, 21));
102     fontSize.addActionListener(new java.awt.event.ActionListener()
103     {
104       public void actionPerformed(ActionEvent e)
105       {
106         fontSize_actionPerformed(e);
107       }
108     });
109     fontStyle.setFont(new java.awt.Font("Verdana", 0, 11));
110     fontStyle.setOpaque(false);
111     fontStyle.setPreferredSize(new Dimension(90, 21));
112     fontStyle.addActionListener(new java.awt.event.ActionListener()
113     {
114       public void actionPerformed(ActionEvent e)
115       {
116         fontStyle_actionPerformed(e);
117       }
118     });
119     jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));
120     jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
121     jLabel2.setText("Size: ");
122     jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
123     jLabel3.setFont(new java.awt.Font("Verdana", 0, 11));
124     jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
125     jLabel3.setText("Style: ");
126     jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
127     fontName.setFont(new java.awt.Font("Verdana", 0, 11));
128     fontName.setMaximumSize(new Dimension(32767, 32767));
129     fontName.setMinimumSize(new Dimension(300, 21));
130     fontName.setOpaque(false);
131     fontName.setPreferredSize(new Dimension(180, 21));
132     fontName.addActionListener(new java.awt.event.ActionListener()
133     {
134       public void actionPerformed(ActionEvent e)
135       {
136         fontName_actionPerformed(e);
137       }
138     });
139     ok.setFont(new java.awt.Font("Verdana", 0, 11));
140     ok.setText("OK");
141     ok.addActionListener(new java.awt.event.ActionListener()
142     {
143       public void actionPerformed(ActionEvent e)
144       {
145         ok_actionPerformed(e);
146       }
147     });
148     cancel.setFont(new java.awt.Font("Verdana", 0, 11));
149     cancel.setText("Cancel");
150     cancel.addActionListener(new java.awt.event.ActionListener()
151     {
152       public void actionPerformed(ActionEvent e)
153       {
154         cancel_actionPerformed(e);
155       }
156     });
157     this.setBackground(Color.white);
158     jPanel1.setOpaque(false);
159     jPanel1.setBounds(new Rectangle(5, 6, 308, 23));
160     jPanel1.setLayout(borderLayout1);
161     jPanel2.setOpaque(false);
162     jPanel2.setBounds(new Rectangle(5, 37, 128, 21));
163     jPanel2.setLayout(borderLayout3);
164     jPanel3.setOpaque(false);
165     jPanel3.setBounds(new Rectangle(174, 38, 134, 21));
166     jPanel3.setLayout(borderLayout2);
167     defaultButton.setFont(JvSwingUtils.getLabelFont());
168     defaultButton.setText("Set as Default");
169     defaultButton.addActionListener(new ActionListener()
170     {
171       public void actionPerformed(ActionEvent e)
172       {
173         defaultButton_actionPerformed(e);
174       }
175     });
176     smoothFont.setFont(JvSwingUtils.getLabelFont());
177     smoothFont.setOpaque(false);
178     smoothFont.setText("Anti-alias Fonts (Slower to render)");
179     smoothFont.setBounds(new Rectangle(41, 65, 223, 23));
180     smoothFont.addActionListener(new ActionListener()
181     {
182       public void actionPerformed(ActionEvent e)
183       {
184         smoothFont_actionPerformed(e);
185       }
186     });
187     monospaced.setEnabled(false);
188     monospaced.setFont(JvSwingUtils.getLabelFont());
189     monospaced.setOpaque(false);
190     monospaced.setToolTipText("Monospaced fonts are faster to render");
191     monospaced.setText("Monospaced");
192     jPanel4.setOpaque(false);
193     jPanel4.setBounds(new Rectangle(24, 92, 259, 35));
194     jPanel1.add(jLabel1, BorderLayout.WEST);
195     jPanel1.add(fontName, BorderLayout.CENTER);
196     jPanel1.add(monospaced, java.awt.BorderLayout.EAST);
197     this.add(jPanel3, null);
198     this.add(jPanel2, null);
199     jPanel2.add(fontSize, java.awt.BorderLayout.CENTER);
200     jPanel2.add(jLabel2, java.awt.BorderLayout.WEST);
201     jPanel4.add(defaultButton);
202     jPanel4.add(ok);
203     jPanel4.add(cancel);
204     this.add(smoothFont);
205     this.add(jPanel4);
206     jPanel3.add(jLabel3, java.awt.BorderLayout.WEST);
207     jPanel3.add(fontStyle, java.awt.BorderLayout.CENTER);
208     this.add(jPanel1, null);
209   }
210
211   /**
212    * DOCUMENT ME!
213    * 
214    * @param e
215    *          DOCUMENT ME!
216    */
217   protected void ok_actionPerformed(ActionEvent e)
218   {
219   }
220
221   /**
222    * DOCUMENT ME!
223    * 
224    * @param e
225    *          DOCUMENT ME!
226    */
227   protected void cancel_actionPerformed(ActionEvent e)
228   {
229   }
230
231   /**
232    * DOCUMENT ME!
233    * 
234    * @param e
235    *          DOCUMENT ME!
236    */
237   protected void fontName_actionPerformed(ActionEvent e)
238   {
239   }
240
241   /**
242    * DOCUMENT ME!
243    * 
244    * @param e
245    *          DOCUMENT ME!
246    */
247   protected void fontSize_actionPerformed(ActionEvent e)
248   {
249   }
250
251   /**
252    * DOCUMENT ME!
253    * 
254    * @param e
255    *          DOCUMENT ME!
256    */
257   protected void fontStyle_actionPerformed(ActionEvent e)
258   {
259   }
260
261   /**
262    * DOCUMENT ME!
263    * 
264    * @param e
265    *          DOCUMENT ME!
266    */
267   public void defaultButton_actionPerformed(ActionEvent e)
268   {
269   }
270
271   public void smoothFont_actionPerformed(ActionEvent e)
272   {
273
274   }
275 }