added help and documentation for annotation editing.
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4 *
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.
9 *
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.
14 *
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
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 \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     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
47 \r
48     /**\r
49      * Creates a new GSliderPanel object.\r
50      */\r
51     public GSliderPanel()\r
52     {\r
53         try\r
54         {\r
55             jbInit();\r
56         }\r
57         catch (Exception e)\r
58         {\r
59             e.printStackTrace();\r
60         }\r
61     }\r
62 \r
63     /**\r
64      * DOCUMENT ME!\r
65      *\r
66      * @throws Exception DOCUMENT ME!\r
67      */\r
68     private void jbInit() throws Exception\r
69     {\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
83             {\r
84                 public void actionPerformed(ActionEvent e)\r
85                 {\r
86                     valueField_actionPerformed(e);\r
87                 }\r
88             });\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
100             {\r
101                 public void actionPerformed(ActionEvent e)\r
102                 {\r
103                     applyButton_actionPerformed(e);\r
104                 }\r
105             });\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
111             {\r
112                 public void actionPerformed(ActionEvent e)\r
113                 {\r
114                     undoButton_actionPerformed(e);\r
115                 }\r
116             });\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
122             {\r
123                 public void actionPerformed(ActionEvent e)\r
124                 {\r
125                     allGroupsCheck_actionPerformed(e);\r
126                 }\r
127             });\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
140     }\r
141 \r
142     /**\r
143      * DOCUMENT ME!\r
144      *\r
145      * @param e DOCUMENT ME!\r
146      */\r
147     protected void valueField_actionPerformed(ActionEvent e)\r
148     {\r
149     }\r
150 \r
151     /**\r
152      * DOCUMENT ME!\r
153      *\r
154      * @param e DOCUMENT ME!\r
155      */\r
156     protected void applyButton_actionPerformed(ActionEvent e)\r
157     {\r
158     }\r
159 \r
160     /**\r
161      * DOCUMENT ME!\r
162      *\r
163      * @param e DOCUMENT ME!\r
164      */\r
165     protected void undoButton_actionPerformed(ActionEvent e)\r
166     {\r
167     }\r
168 \r
169     /**\r
170      * DOCUMENT ME!\r
171      *\r
172      * @param e DOCUMENT ME!\r
173      */\r
174     protected void allGroupsCheck_actionPerformed(ActionEvent e)\r
175     {\r
176     }\r
177 }\r