/* * Jalview - A Sequence Alignment Editor and Viewer * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package jalview.jbgui; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class GFinder extends JPanel { JLabel jLabel1 = new JLabel(); protected JTextField textfield = new JTextField(); protected JButton findAll = new JButton(); protected JButton findNext = new JButton(); JPanel jPanel1 = new JPanel(); GridLayout gridLayout1 = new GridLayout(); protected JButton createNewGroup = new JButton(); public GFinder() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { jLabel1.setFont(new java.awt.Font("Verdana", 0, 12)); jLabel1.setText("Find"); jLabel1.setBounds(new Rectangle(3, 30, 34, 15)); this.setLayout(null); textfield.setFont(new java.awt.Font("Verdana", 0, 12)); textfield.setText(""); textfield.setBounds(new Rectangle(40, 27, 133, 21)); textfield.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(KeyEvent e) { textfield_keyTyped(e); } }); textfield.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { textfield_actionPerformed(e); } }); findAll.setFont(new java.awt.Font("Verdana", 0, 12)); findAll.setText("Find all"); findAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { findAll_actionPerformed(e); } }); findNext.setEnabled(false); findNext.setFont(new java.awt.Font("Verdana", 0, 12)); findNext.setText("Find Next"); findNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { findNext_actionPerformed(e); } }); jPanel1.setBounds(new Rectangle(180, 5, 141, 64)); jPanel1.setLayout(gridLayout1); gridLayout1.setHgap(0); gridLayout1.setRows(3); gridLayout1.setVgap(2); createNewGroup.setEnabled(false); createNewGroup.setFont(new java.awt.Font("Verdana", 0, 12)); createNewGroup.setToolTipText(""); createNewGroup.setMargin(new Insets(0, 0, 0, 0)); createNewGroup.setText("Create new group"); createNewGroup.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { createNewGroup_actionPerformed(e); } }); jPanel1.add(findNext, null); jPanel1.add(findAll, null); jPanel1.add(createNewGroup, null); this.add(textfield, null); this.add(jLabel1, null); this.add(jPanel1, null); } protected void findNext_actionPerformed(ActionEvent e) { } protected void findAll_actionPerformed(ActionEvent e) { } protected void textfield_actionPerformed(ActionEvent e) { } void textfield_keyTyped(KeyEvent e) { findNext.setEnabled(true); } public void createNewGroup_actionPerformed(ActionEvent e) { } }