2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\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
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
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
20 package jalview.jbappletgui;
\r
23 import java.awt.event.*;
\r
26 public class GFinder extends Panel
\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
44 e.printStackTrace();
\r
47 private void jbInit() throws Exception
\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
58 public void keyTyped(KeyEvent e)
\r
60 textfield_keyTyped(e);
\r
63 textfield.addActionListener(new java.awt.event.ActionListener()
\r
65 public void actionPerformed(ActionEvent e)
\r
67 textfield_actionPerformed(e);
\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
74 public void actionPerformed(ActionEvent e)
\r
76 findAll_actionPerformed(e);
\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
84 public void actionPerformed(ActionEvent e)
\r
86 findNext_actionPerformed(e);
\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
99 public void actionPerformed(ActionEvent e)
\r
101 createNewGroup_actionPerformed(e);
\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
112 protected void findNext_actionPerformed(ActionEvent e)
\r
117 protected void findAll_actionPerformed(ActionEvent e)
\r
123 protected void textfield_actionPerformed(ActionEvent e)
\r
128 void textfield_keyTyped(KeyEvent e)
\r
130 findNext.setEnabled(true);
\r
133 public void createNewGroup_actionPerformed(ActionEvent e)
\r