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