Add pdb ref
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 /*\r
2 * Jalview - A Sequence Alignment Editor and Viewer\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4 *\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
9 *\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
14 *\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
18 */\r
19 package jalview.jbgui;\r
20 \r
21 import java.awt.*;\r
22 import java.awt.event.*;\r
23 \r
24 import javax.swing.*;\r
25 import java.awt.BorderLayout;\r
26 \r
27 /**\r
28  * DOCUMENT ME!\r
29  *\r
30  * @author $author$\r
31  * @version $Revision$\r
32  */\r
33 public class GSliderPanel extends JPanel\r
34 {\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
49 \r
50   /**\r
51      * Creates a new GSliderPanel object.\r
52      */\r
53     public GSliderPanel()\r
54     {\r
55         try\r
56         {\r
57             jbInit();\r
58         }\r
59         catch (Exception e)\r
60         {\r
61             e.printStackTrace();\r
62         }\r
63     }\r
64 \r
65     /**\r
66      * DOCUMENT ME!\r
67      *\r
68      * @throws Exception DOCUMENT ME!\r
69      */\r
70     private void jbInit() throws Exception\r
71     {\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
85             {\r
86                 public void actionPerformed(ActionEvent e)\r
87                 {\r
88                     valueField_actionPerformed(e);\r
89                 }\r
90             });\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
102             {\r
103                 public void actionPerformed(ActionEvent e)\r
104                 {\r
105                     applyButton_actionPerformed(e);\r
106                 }\r
107             });\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
113             {\r
114                 public void actionPerformed(ActionEvent e)\r
115                 {\r
116                     undoButton_actionPerformed(e);\r
117                 }\r
118             });\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
124             {\r
125                 public void actionPerformed(ActionEvent e)\r
126                 {\r
127                     allGroupsCheck_actionPerformed(e);\r
128                 }\r
129             });\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
145   }\r
146 \r
147     /**\r
148      * DOCUMENT ME!\r
149      *\r
150      * @param e DOCUMENT ME!\r
151      */\r
152     protected void valueField_actionPerformed(ActionEvent e)\r
153     {\r
154     }\r
155 \r
156     /**\r
157      * DOCUMENT ME!\r
158      *\r
159      * @param e DOCUMENT ME!\r
160      */\r
161     protected void applyButton_actionPerformed(ActionEvent e)\r
162     {\r
163     }\r
164 \r
165     /**\r
166      * DOCUMENT ME!\r
167      *\r
168      * @param e DOCUMENT ME!\r
169      */\r
170     protected void undoButton_actionPerformed(ActionEvent e)\r
171     {\r
172     }\r
173 \r
174     /**\r
175      * DOCUMENT ME!\r
176      *\r
177      * @param e DOCUMENT ME!\r
178      */\r
179     protected void allGroupsCheck_actionPerformed(ActionEvent e)\r
180     {\r
181     }\r
182 }\r