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.jbgui;
\r
22 import javax.swing.*;
\r
24 import java.awt.event.*;
\r
27 public class GFinder extends JPanel
\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
45 e.printStackTrace();
\r
48 private void jbInit() throws Exception
\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
59 public void keyTyped(KeyEvent e)
\r
61 textfield_keyTyped(e);
\r
64 textfield.addActionListener(new java.awt.event.ActionListener()
\r
66 public void actionPerformed(ActionEvent e)
\r
68 textfield_actionPerformed(e);
\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
75 public void actionPerformed(ActionEvent e)
\r
77 findAll_actionPerformed(e);
\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
85 public void actionPerformed(ActionEvent e)
\r
87 findNext_actionPerformed(e);
\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
102 public void actionPerformed(ActionEvent e)
\r
104 createNewGroup_actionPerformed(e);
\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
115 protected void findNext_actionPerformed(ActionEvent e)
\r
120 protected void findAll_actionPerformed(ActionEvent e)
\r
126 protected void textfield_actionPerformed(ActionEvent e)
\r
131 void textfield_keyTyped(KeyEvent e)
\r
133 findNext.setEnabled(true);
\r
136 public void createNewGroup_actionPerformed(ActionEvent e)
\r