2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
24 import javax.swing.*;
\r
31 * @version $Revision$
\r
33 public class GSliderPanel extends JPanel
\r
35 // this is used for conservation colours, PID colours and redundancy threshold
\r
36 protected JSlider slider = new JSlider();
\r
37 protected JTextField valueField = new JTextField();
\r
38 protected JLabel label = new JLabel();
\r
39 JPanel jPanel1 = new JPanel();
\r
40 GridLayout gridLayout1 = new GridLayout();
\r
41 JPanel jPanel2 = new JPanel();
\r
42 protected JButton applyButton = new JButton();
\r
43 protected JButton undoButton = new JButton();
\r
44 FlowLayout flowLayout1 = new FlowLayout();
\r
45 protected JCheckBox allGroupsCheck = new JCheckBox();
\r
46 BorderLayout borderLayout1 = new BorderLayout();
\r
49 * Creates a new GSliderPanel object.
\r
51 public GSliderPanel()
\r
59 e.printStackTrace();
\r
66 * @throws Exception DOCUMENT ME!
\r
68 private void jbInit() throws Exception
\r
70 this.setLayout(gridLayout1);
\r
71 slider.setMajorTickSpacing(10);
\r
72 slider.setMinorTickSpacing(1);
\r
73 slider.setPaintTicks(true);
\r
74 slider.setBackground(Color.white);
\r
75 slider.setFont(new java.awt.Font("Verdana", 0, 11));
\r
76 slider.setDoubleBuffered(true);
\r
77 valueField.setFont(new java.awt.Font("Verdana", 0, 11));
\r
78 valueField.setMinimumSize(new Dimension(6, 14));
\r
79 valueField.setPreferredSize(new Dimension(50, 12));
\r
80 valueField.setText("");
\r
81 valueField.setHorizontalAlignment(SwingConstants.CENTER);
\r
82 valueField.addActionListener(new java.awt.event.ActionListener()
\r
84 public void actionPerformed(ActionEvent e)
\r
86 valueField_actionPerformed(e);
\r
89 label.setFont(new java.awt.Font("Verdana", 0, 11));
\r
90 label.setOpaque(false);
\r
91 label.setHorizontalAlignment(SwingConstants.CENTER);
\r
92 label.setText("set this label text");
\r
93 jPanel1.setLayout(borderLayout1);
\r
94 gridLayout1.setRows(2);
\r
95 jPanel2.setLayout(flowLayout1);
\r
96 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
97 applyButton.setOpaque(false);
\r
98 applyButton.setText("Apply");
\r
99 applyButton.addActionListener(new java.awt.event.ActionListener()
\r
101 public void actionPerformed(ActionEvent e)
\r
103 applyButton_actionPerformed(e);
\r
106 undoButton.setEnabled(false);
\r
107 undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
108 undoButton.setOpaque(false);
\r
109 undoButton.setText("Undo");
\r
110 undoButton.addActionListener(new java.awt.event.ActionListener()
\r
112 public void actionPerformed(ActionEvent e)
\r
114 undoButton_actionPerformed(e);
\r
117 allGroupsCheck.setEnabled(false);
\r
118 allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
\r
119 allGroupsCheck.setOpaque(false);
\r
120 allGroupsCheck.setText("Apply to all Groups");
\r
121 allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
\r
123 public void actionPerformed(ActionEvent e)
\r
125 allGroupsCheck_actionPerformed(e);
\r
128 this.setBackground(Color.white);
\r
129 this.setPreferredSize(new Dimension(415, 84));
\r
130 jPanel2.setOpaque(false);
\r
131 jPanel1.setOpaque(false);
\r
132 this.add(jPanel2, null);
\r
133 jPanel2.add(label, null);
\r
134 jPanel2.add(applyButton, null);
\r
135 jPanel2.add(undoButton, null);
\r
136 this.add(jPanel1, null);
\r
137 jPanel1.add(slider, BorderLayout.WEST);
\r
138 jPanel1.add(valueField, BorderLayout.CENTER);
\r
139 jPanel1.add(allGroupsCheck, BorderLayout.EAST);
\r
145 * @param e DOCUMENT ME!
\r
147 protected void valueField_actionPerformed(ActionEvent e)
\r
154 * @param e DOCUMENT ME!
\r
156 protected void applyButton_actionPerformed(ActionEvent e)
\r
163 * @param e DOCUMENT ME!
\r
165 protected void undoButton_actionPerformed(ActionEvent e)
\r
172 * @param e DOCUMENT ME!
\r
174 protected void allGroupsCheck_actionPerformed(ActionEvent e)
\r