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