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