actionlisteners added
[jalview.git] / src / jalview / jbgui / GFontChooser.java
1 package jalview.jbgui;
2
3 import javax.swing.*;
4 import java.awt.*;
5 import java.awt.event.*;
6
7
8 public class GFontChooser extends JPanel
9 {
10   JLabel jLabel1 = new JLabel();
11   protected JComboBox fontSize = new JComboBox();
12   protected JComboBox fontStyle = new JComboBox();
13   JLabel jLabel2 = new JLabel();
14   JLabel jLabel3 = new JLabel();
15   protected JComboBox fontName = new JComboBox();
16   JButton ok = new JButton();
17   JButton cancel = new JButton();
18   JPanel jPanel1 = new JPanel();
19   JPanel jPanel2 = new JPanel();
20   JPanel jPanel3 = new JPanel();
21   BorderLayout borderLayout1 = new BorderLayout();
22   BorderLayout borderLayout2 = new BorderLayout();
23   BorderLayout borderLayout3 = new BorderLayout();
24   FlowLayout flowLayout1 = new FlowLayout();
25
26   public GFontChooser()
27   {
28     try
29     {
30       jbInit();
31     }
32     catch(Exception e)
33     {
34       e.printStackTrace();
35     }
36   }
37   private void jbInit() throws Exception
38   {
39     jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));
40     jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
41     jLabel1.setText("Font: ");
42     jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
43     this.setLayout(flowLayout1);
44     fontSize.setFont(new java.awt.Font("Verdana", 0, 11));
45     fontSize.setOpaque(false);
46     fontSize.setPreferredSize(new Dimension(50, 21));
47     fontSize.addActionListener(new java.awt.event.ActionListener()
48     {
49       public void actionPerformed(ActionEvent e)
50       {
51         fontSize_actionPerformed(e);
52       }
53     });
54     fontStyle.setFont(new java.awt.Font("Verdana", 0, 11));
55     fontStyle.setOpaque(false);
56     fontStyle.setPreferredSize(new Dimension(90, 21));
57     fontStyle.addActionListener(new java.awt.event.ActionListener()
58     {
59       public void actionPerformed(ActionEvent e)
60       {
61         fontStyle_actionPerformed(e);
62       }
63     });
64     jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));
65     jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
66     jLabel2.setText("Size: ");
67     jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
68     jLabel3.setFont(new java.awt.Font("Verdana", 0, 11));
69     jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
70     jLabel3.setText("Style: ");
71     jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
72     fontName.setFont(new java.awt.Font("Verdana", 0, 11));
73     fontName.setMaximumSize(new Dimension(32767, 32767));
74     fontName.setMinimumSize(new Dimension(300, 21));
75     fontName.setOpaque(false);
76     fontName.setPreferredSize(new Dimension(180, 21));
77     fontName.addActionListener(new java.awt.event.ActionListener()
78     {
79       public void actionPerformed(ActionEvent e)
80       {
81         fontName_actionPerformed(e);
82       }
83     });
84     ok.setFont(new java.awt.Font("Verdana", 0, 11));
85     ok.setText("OK");
86     ok.addActionListener(new java.awt.event.ActionListener()
87     {
88       public void actionPerformed(ActionEvent e)
89       {
90         ok_actionPerformed(e);
91       }
92     });
93     cancel.setFont(new java.awt.Font("Verdana", 0, 11));
94     cancel.setText("Cancel");
95     cancel.addActionListener(new java.awt.event.ActionListener()
96     {
97       public void actionPerformed(ActionEvent e)
98       {
99         cancel_actionPerformed(e);
100       }
101     });
102     this.setBackground(Color.white);
103     jPanel1.setOpaque(false);
104     jPanel1.setLayout(borderLayout1);
105     jPanel2.setOpaque(false);
106     jPanel2.setLayout(borderLayout3);
107     jPanel3.setOpaque(false);
108     jPanel3.setLayout(borderLayout2);
109     flowLayout1.setAlignment(FlowLayout.CENTER);
110     flowLayout1.setVgap(10);
111     this.add(jPanel1, null);
112     jPanel1.add(jLabel1, BorderLayout.WEST);
113     jPanel1.add(fontName, BorderLayout.CENTER);
114     this.add(jPanel3, null);
115     this.add(jPanel2, null);
116     jPanel2.add(jLabel3,  BorderLayout.WEST);
117     jPanel2.add(fontStyle,  BorderLayout.CENTER);
118     jPanel3.add(jLabel2, BorderLayout.WEST);
119     jPanel3.add(fontSize, BorderLayout.CENTER);
120     this.add(ok, null);
121     this.add(cancel, null);
122   }
123
124   protected void ok_actionPerformed(ActionEvent e)
125   {
126
127   }
128
129   protected void cancel_actionPerformed(ActionEvent e)
130   {
131
132   }
133
134   protected void fontName_actionPerformed(ActionEvent e)
135   {
136
137   }
138
139   protected void fontSize_actionPerformed(ActionEvent e)
140   {
141
142   }
143
144   protected void fontStyle_actionPerformed(ActionEvent e)
145   {
146
147   }
148 }