Use font.getName, not font.getFontName
[jalview.git] / src / jalview / jbappletgui / GFinder.java
1 /*\r
2 * Jalview - A Sequence Alignment Editor and Viewer\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4 *\r
5 * This program is free software; you can redistribute it and/or\r
6 * modify it under the terms of the GNU General Public License\r
7 * as published by the Free Software Foundation; either version 2\r
8 * of the License, or (at your option) any later version.\r
9 *\r
10 * This program is distributed in the hope that it will be useful,\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 * GNU General Public License for more details.\r
14 *\r
15 * You should have received a copy of the GNU General Public License\r
16 * along with this program; if not, write to the Free Software\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18 */\r
19 package jalview.jbappletgui;\r
20 \r
21 import java.awt.*;\r
22 import java.awt.event.*;\r
23 \r
24 \r
25 public class GFinder extends Panel {\r
26     Label jLabel1 = new Label();\r
27     protected TextField textfield = new TextField();\r
28     protected Button findAll = new Button();\r
29     protected Button findNext = new Button();\r
30     Panel jPanel1 = new Panel();\r
31     GridLayout gridLayout1 = new GridLayout();\r
32     protected Button createNewGroup = new Button();\r
33 \r
34     public GFinder() {\r
35         try {\r
36             jbInit();\r
37         } catch (Exception e) {\r
38             e.printStackTrace();\r
39         }\r
40     }\r
41 \r
42     private void jbInit() throws Exception {\r
43         jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));\r
44         jLabel1.setText("Find");\r
45         jLabel1.setBounds(new Rectangle(3, 30, 34, 15));\r
46         this.setLayout(null);\r
47         textfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
48         textfield.setText("");\r
49         textfield.setBounds(new Rectangle(40, 27, 133, 21));\r
50         textfield.addKeyListener(new java.awt.event.KeyAdapter() {\r
51                 public void keyTyped(KeyEvent e) {\r
52                     textfield_keyTyped(e);\r
53                 }\r
54             });\r
55         textfield.addActionListener(new java.awt.event.ActionListener() {\r
56                 public void actionPerformed(ActionEvent e) {\r
57                     textfield_actionPerformed(e);\r
58                 }\r
59             });\r
60         findAll.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
61         findAll.setLabel("Find all");\r
62         findAll.addActionListener(new java.awt.event.ActionListener() {\r
63                 public void actionPerformed(ActionEvent e) {\r
64                     findAll_actionPerformed(e);\r
65                 }\r
66             });\r
67         findNext.setEnabled(false);\r
68         findNext.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
69         findNext.setLabel("Find Next");\r
70         findNext.addActionListener(new java.awt.event.ActionListener() {\r
71                 public void actionPerformed(ActionEvent e) {\r
72                     findNext_actionPerformed(e);\r
73                 }\r
74             });\r
75         jPanel1.setBounds(new Rectangle(180, 5, 141, 64));\r
76         jPanel1.setLayout(gridLayout1);\r
77         gridLayout1.setHgap(0);\r
78         gridLayout1.setRows(3);\r
79         gridLayout1.setVgap(2);\r
80         createNewGroup.setEnabled(false);\r
81         createNewGroup.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
82         createNewGroup.setLabel("Create new group");\r
83         createNewGroup.addActionListener(new java.awt.event.ActionListener() {\r
84                 public void actionPerformed(ActionEvent e) {\r
85                     createNewGroup_actionPerformed(e);\r
86                 }\r
87             });\r
88         jPanel1.add(findNext, null);\r
89         jPanel1.add(findAll, null);\r
90         jPanel1.add(createNewGroup, null);\r
91         this.add(textfield, null);\r
92         this.add(jLabel1, null);\r
93         this.add(jPanel1, null);\r
94     }\r
95 \r
96     protected void findNext_actionPerformed(ActionEvent e) {\r
97     }\r
98 \r
99     protected void findAll_actionPerformed(ActionEvent e) {\r
100     }\r
101 \r
102     protected void textfield_actionPerformed(ActionEvent e) {\r
103     }\r
104 \r
105     void textfield_keyTyped(KeyEvent e) {\r
106         findNext.setEnabled(true);\r
107     }\r
108 \r
109     public void createNewGroup_actionPerformed(ActionEvent e) {\r
110     }\r
111 }\r