Formatted source
[jalview.git] / src / jalview / jbgui / 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.jbgui;\r
20 \r
21 import java.awt.*;\r
22 import java.awt.event.*;\r
23 \r
24 import javax.swing.*;\r
25 \r
26 \r
27 public class GFinder extends JPanel {\r
28     JLabel jLabel1 = new JLabel();\r
29     protected JTextField textfield = new JTextField();\r
30     protected JButton findAll = new JButton();\r
31     protected JButton findNext = new JButton();\r
32     JPanel jPanel1 = new JPanel();\r
33     GridLayout gridLayout1 = new GridLayout();\r
34     protected JButton createNewGroup = new JButton();\r
35 \r
36     public GFinder() {\r
37         try {\r
38             jbInit();\r
39         } catch (Exception e) {\r
40             e.printStackTrace();\r
41         }\r
42     }\r
43 \r
44     private void jbInit() throws Exception {\r
45         jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));\r
46         jLabel1.setText("Find");\r
47         jLabel1.setBounds(new Rectangle(3, 30, 34, 15));\r
48         this.setLayout(null);\r
49         textfield.setFont(new java.awt.Font("Verdana", 0, 12));\r
50         textfield.setText("");\r
51         textfield.setBounds(new Rectangle(40, 27, 133, 21));\r
52         textfield.addKeyListener(new java.awt.event.KeyAdapter() {\r
53                 public void keyTyped(KeyEvent e) {\r
54                     textfield_keyTyped(e);\r
55                 }\r
56             });\r
57         textfield.addActionListener(new java.awt.event.ActionListener() {\r
58                 public void actionPerformed(ActionEvent e) {\r
59                     textfield_actionPerformed(e);\r
60                 }\r
61             });\r
62         findAll.setFont(new java.awt.Font("Verdana", 0, 12));\r
63         findAll.setText("Find all");\r
64         findAll.addActionListener(new java.awt.event.ActionListener() {\r
65                 public void actionPerformed(ActionEvent e) {\r
66                     findAll_actionPerformed(e);\r
67                 }\r
68             });\r
69         findNext.setEnabled(false);\r
70         findNext.setFont(new java.awt.Font("Verdana", 0, 12));\r
71         findNext.setText("Find Next");\r
72         findNext.addActionListener(new java.awt.event.ActionListener() {\r
73                 public void actionPerformed(ActionEvent e) {\r
74                     findNext_actionPerformed(e);\r
75                 }\r
76             });\r
77         jPanel1.setBounds(new Rectangle(180, 5, 141, 64));\r
78         jPanel1.setLayout(gridLayout1);\r
79         gridLayout1.setHgap(0);\r
80         gridLayout1.setRows(3);\r
81         gridLayout1.setVgap(2);\r
82         createNewGroup.setEnabled(false);\r
83         createNewGroup.setFont(new java.awt.Font("Verdana", 0, 12));\r
84         createNewGroup.setToolTipText("");\r
85         createNewGroup.setMargin(new Insets(0, 0, 0, 0));\r
86         createNewGroup.setText("Create new group");\r
87         createNewGroup.addActionListener(new java.awt.event.ActionListener() {\r
88                 public void actionPerformed(ActionEvent e) {\r
89                     createNewGroup_actionPerformed(e);\r
90                 }\r
91             });\r
92         jPanel1.add(findNext, null);\r
93         jPanel1.add(findAll, null);\r
94         jPanel1.add(createNewGroup, null);\r
95         this.add(textfield, null);\r
96         this.add(jLabel1, null);\r
97         this.add(jPanel1, null);\r
98     }\r
99 \r
100     protected void findNext_actionPerformed(ActionEvent e) {\r
101     }\r
102 \r
103     protected void findAll_actionPerformed(ActionEvent e) {\r
104     }\r
105 \r
106     protected void textfield_actionPerformed(ActionEvent e) {\r
107     }\r
108 \r
109     void textfield_keyTyped(KeyEvent e) {\r
110         findNext.setEnabled(true);\r
111     }\r
112 \r
113     public void createNewGroup_actionPerformed(ActionEvent e) {\r
114     }\r
115 }\r