GPL license added
[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 \r
20 package jalview.jbappletgui;\r
21 \r
22 import java.awt.*;\r
23 import java.awt.event.*;\r
24 \r
25 \r
26 public class GFinder extends Panel\r
27 {\r
28   Label jLabel1 = new Label();\r
29   protected TextField textfield = new TextField();\r
30   protected Button findAll = new Button();\r
31   protected Button findNext = new Button();\r
32   Panel jPanel1 = new Panel();\r
33   GridLayout gridLayout1 = new GridLayout();\r
34   protected Button createNewGroup = new Button();\r
35 \r
36   public GFinder()\r
37   {\r
38     try\r
39     {\r
40       jbInit();\r
41     }\r
42     catch(Exception e)\r
43     {\r
44       e.printStackTrace();\r
45     }\r
46   }\r
47   private void jbInit() throws Exception\r
48   {\r
49     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));\r
50     jLabel1.setText("Find");\r
51     jLabel1.setBounds(new Rectangle(3, 30, 34, 15));\r
52     this.setLayout(null);\r
53     textfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
54     textfield.setText("");\r
55     textfield.setBounds(new Rectangle(40, 27, 133, 21));\r
56     textfield.addKeyListener(new java.awt.event.KeyAdapter()\r
57     {\r
58       public void keyTyped(KeyEvent e)\r
59       {\r
60         textfield_keyTyped(e);\r
61       }\r
62     });\r
63     textfield.addActionListener(new java.awt.event.ActionListener()\r
64     {\r
65       public void actionPerformed(ActionEvent e)\r
66       {\r
67         textfield_actionPerformed(e);\r
68       }\r
69     });\r
70     findAll.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
71     findAll.setLabel("Find all");\r
72     findAll.addActionListener(new java.awt.event.ActionListener()\r
73     {\r
74       public void actionPerformed(ActionEvent e)\r
75       {\r
76         findAll_actionPerformed(e);\r
77       }\r
78     });\r
79     findNext.setEnabled(false);\r
80     findNext.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
81     findNext.setLabel("Find Next");\r
82     findNext.addActionListener(new java.awt.event.ActionListener()\r
83     {\r
84       public void actionPerformed(ActionEvent e)\r
85       {\r
86         findNext_actionPerformed(e);\r
87       }\r
88     });\r
89     jPanel1.setBounds(new Rectangle(180, 5, 141, 64));\r
90     jPanel1.setLayout(gridLayout1);\r
91     gridLayout1.setHgap(0);\r
92     gridLayout1.setRows(3);\r
93     gridLayout1.setVgap(2);\r
94     createNewGroup.setEnabled(false);\r
95     createNewGroup.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));\r
96     createNewGroup.setLabel("Create new group");\r
97     createNewGroup.addActionListener(new java.awt.event.ActionListener()\r
98     {\r
99       public void actionPerformed(ActionEvent e)\r
100       {\r
101         createNewGroup_actionPerformed(e);\r
102       }\r
103     });\r
104     jPanel1.add(findNext, null);\r
105     jPanel1.add(findAll, null);\r
106     jPanel1.add(createNewGroup, null);\r
107     this.add(textfield, null);\r
108     this.add(jLabel1, null);\r
109     this.add(jPanel1, null);\r
110   }\r
111 \r
112   protected void findNext_actionPerformed(ActionEvent e)\r
113   {\r
114 \r
115   }\r
116 \r
117   protected void findAll_actionPerformed(ActionEvent e)\r
118   {\r
119 \r
120   }\r
121 \r
122 \r
123   protected void textfield_actionPerformed(ActionEvent e)\r
124   {\r
125 \r
126   }\r
127 \r
128   void textfield_keyTyped(KeyEvent e)\r
129   {\r
130     findNext.setEnabled(true);\r
131   }\r
132 \r
133   public void createNewGroup_actionPerformed(ActionEvent e)\r
134   {\r
135 \r
136   }\r
137 \r
138 }\r