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
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
24 import javax.swing.*;
\r
25 import java.awt.BorderLayout;
\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 protected JPanel southPanel = 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
47 JPanel jPanel1 = new JPanel();
\r
48 BorderLayout borderLayout2 = new BorderLayout();
\r
51 * Creates a new GSliderPanel object.
\r
53 public GSliderPanel()
\r
61 e.printStackTrace();
\r
68 * @throws Exception DOCUMENT ME!
\r
70 private void jbInit() throws Exception
\r
72 this.setLayout(gridLayout1);
\r
73 slider.setMajorTickSpacing(10);
\r
74 slider.setMinorTickSpacing(1);
\r
75 slider.setPaintTicks(true);
\r
76 slider.setBackground(Color.white);
\r
77 slider.setFont(new java.awt.Font("Verdana", 0, 11));
\r
78 slider.setDoubleBuffered(true);
\r
79 valueField.setFont(new java.awt.Font("Verdana", 0, 11));
\r
80 valueField.setMinimumSize(new Dimension(6, 14));
\r
81 valueField.setPreferredSize(new Dimension(50, 12));
\r
82 valueField.setText("");
\r
83 valueField.setHorizontalAlignment(SwingConstants.CENTER);
\r
84 valueField.addActionListener(new java.awt.event.ActionListener()
\r
86 public void actionPerformed(ActionEvent e)
\r
88 valueField_actionPerformed(e);
\r
91 label.setFont(new java.awt.Font("Verdana", 0, 11));
\r
92 label.setOpaque(false);
\r
93 label.setHorizontalAlignment(SwingConstants.CENTER);
\r
94 label.setText("set this label text");
\r
95 southPanel.setLayout(borderLayout1);
\r
96 gridLayout1.setRows(2);
\r
97 jPanel2.setLayout(flowLayout1);
\r
98 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
99 applyButton.setOpaque(false);
\r
100 applyButton.setText("Apply");
\r
101 applyButton.addActionListener(new java.awt.event.ActionListener()
\r
103 public void actionPerformed(ActionEvent e)
\r
105 applyButton_actionPerformed(e);
\r
108 undoButton.setEnabled(false);
\r
109 undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
110 undoButton.setOpaque(false);
\r
111 undoButton.setText("Undo");
\r
112 undoButton.addActionListener(new java.awt.event.ActionListener()
\r
114 public void actionPerformed(ActionEvent e)
\r
116 undoButton_actionPerformed(e);
\r
119 allGroupsCheck.setEnabled(false);
\r
120 allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
\r
121 allGroupsCheck.setOpaque(false);
\r
122 allGroupsCheck.setText("Apply to all Groups");
\r
123 allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
\r
125 public void actionPerformed(ActionEvent e)
\r
127 allGroupsCheck_actionPerformed(e);
\r
130 this.setBackground(Color.white);
\r
131 this.setPreferredSize(new Dimension(415, 84));
\r
132 jPanel2.setOpaque(false);
\r
133 southPanel.setOpaque(false);
\r
134 jPanel1.setLayout(borderLayout2);
\r
135 jPanel1.setOpaque(false);
\r
136 this.add(jPanel2, null);
\r
137 jPanel2.add(label, null);
\r
138 jPanel2.add(applyButton, null);
\r
139 jPanel2.add(undoButton, null);
\r
140 this.add(southPanel, null);
\r
141 southPanel.add(jPanel1, java.awt.BorderLayout.EAST);
\r
142 southPanel.add(slider, java.awt.BorderLayout.CENTER);
\r
143 jPanel1.add(valueField, java.awt.BorderLayout.CENTER);
\r
144 jPanel1.add(allGroupsCheck, java.awt.BorderLayout.EAST);
\r
150 * @param e DOCUMENT ME!
\r
152 protected void valueField_actionPerformed(ActionEvent e)
\r
159 * @param e DOCUMENT ME!
\r
161 protected void applyButton_actionPerformed(ActionEvent e)
\r
168 * @param e DOCUMENT ME!
\r
170 protected void undoButton_actionPerformed(ActionEvent e)
\r
177 * @param e DOCUMENT ME!
\r
179 protected void allGroupsCheck_actionPerformed(ActionEvent e)
\r