updated to jalview 2.1 and begun ArchiveClient/VamsasClient/VamsasStore updates.
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 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 */
19 package jalview.jbgui;
20
21 import java.awt.*;
22 import java.awt.event.*;
23
24 import javax.swing.*;
25 import java.awt.BorderLayout;
26
27 /**
28  * DOCUMENT ME!
29  *
30  * @author $author$
31  * @version $Revision$
32  */
33 public class GSliderPanel extends JPanel
34 {
35     // this is used for conservation colours, PID colours and redundancy threshold
36     protected JSlider slider = new JSlider();
37     protected JTextField valueField = new JTextField();
38     protected JLabel label = new JLabel();
39     protected JPanel southPanel = new JPanel();
40     GridLayout gridLayout1 = new GridLayout();
41     JPanel jPanel2 = new JPanel();
42     protected JButton applyButton = new JButton();
43     protected JButton undoButton = new JButton();
44     FlowLayout flowLayout1 = new FlowLayout();
45     protected JCheckBox allGroupsCheck = new JCheckBox();
46     BorderLayout borderLayout1 = new BorderLayout();
47   JPanel jPanel1 = new JPanel();
48   BorderLayout borderLayout2 = new BorderLayout();
49
50   /**
51      * Creates a new GSliderPanel object.
52      */
53     public GSliderPanel()
54     {
55         try
56         {
57             jbInit();
58         }
59         catch (Exception e)
60         {
61             e.printStackTrace();
62         }
63     }
64
65     /**
66      * DOCUMENT ME!
67      *
68      * @throws Exception DOCUMENT ME!
69      */
70     private void jbInit() throws Exception
71     {
72         this.setLayout(gridLayout1);
73         slider.setMajorTickSpacing(10);
74         slider.setMinorTickSpacing(1);
75         slider.setPaintTicks(true);
76         slider.setBackground(Color.white);
77         slider.setFont(new java.awt.Font("Verdana", 0, 11));
78         slider.setDoubleBuffered(true);
79     slider.addMouseListener(new MouseAdapter()
80     {
81       public void mouseReleased(MouseEvent e)
82       {
83         slider_mouseReleased(e);
84       }
85     });
86     valueField.setFont(new java.awt.Font("Verdana", 0, 11));
87         valueField.setMinimumSize(new Dimension(6, 14));
88         valueField.setPreferredSize(new Dimension(50, 12));
89         valueField.setText("");
90         valueField.setHorizontalAlignment(SwingConstants.CENTER);
91         valueField.addActionListener(new java.awt.event.ActionListener()
92             {
93                 public void actionPerformed(ActionEvent e)
94                 {
95                     valueField_actionPerformed(e);
96                 }
97             });
98         label.setFont(new java.awt.Font("Verdana", 0, 11));
99         label.setOpaque(false);
100         label.setHorizontalAlignment(SwingConstants.CENTER);
101         label.setText("set this label text");
102     southPanel.setLayout(borderLayout1);
103         gridLayout1.setRows(2);
104         jPanel2.setLayout(flowLayout1);
105         applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
106         applyButton.setOpaque(false);
107         applyButton.setText("Apply");
108         applyButton.addActionListener(new java.awt.event.ActionListener()
109             {
110                 public void actionPerformed(ActionEvent e)
111                 {
112                     applyButton_actionPerformed(e);
113                 }
114             });
115         undoButton.setEnabled(false);
116         undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
117         undoButton.setOpaque(false);
118         undoButton.setText("Undo");
119         undoButton.addActionListener(new java.awt.event.ActionListener()
120             {
121                 public void actionPerformed(ActionEvent e)
122                 {
123                     undoButton_actionPerformed(e);
124                 }
125             });
126         allGroupsCheck.setEnabled(false);
127         allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
128         allGroupsCheck.setOpaque(false);
129         allGroupsCheck.setText("Apply to all Groups");
130         allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
131             {
132                 public void actionPerformed(ActionEvent e)
133                 {
134                     allGroupsCheck_actionPerformed(e);
135                 }
136             });
137         this.setBackground(Color.white);
138         this.setPreferredSize(new Dimension(415, 84));
139         jPanel2.setOpaque(false);
140     southPanel.setOpaque(false);
141     jPanel1.setLayout(borderLayout2);
142     jPanel1.setOpaque(false);
143     this.add(jPanel2, null);
144         jPanel2.add(label, null);
145         jPanel2.add(applyButton, null);
146         jPanel2.add(undoButton, null);
147         this.add(southPanel, null);
148     southPanel.add(jPanel1, java.awt.BorderLayout.EAST);
149     southPanel.add(slider, java.awt.BorderLayout.CENTER);
150     jPanel1.add(valueField, java.awt.BorderLayout.CENTER);
151     jPanel1.add(allGroupsCheck, java.awt.BorderLayout.EAST);
152   }
153
154     /**
155      * DOCUMENT ME!
156      *
157      * @param e DOCUMENT ME!
158      */
159     protected void valueField_actionPerformed(ActionEvent e)
160     {
161     }
162
163     /**
164      * DOCUMENT ME!
165      *
166      * @param e DOCUMENT ME!
167      */
168     protected void applyButton_actionPerformed(ActionEvent e)
169     {
170     }
171
172     /**
173      * DOCUMENT ME!
174      *
175      * @param e DOCUMENT ME!
176      */
177     protected void undoButton_actionPerformed(ActionEvent e)
178     {
179     }
180
181     /**
182      * DOCUMENT ME!
183      *
184      * @param e DOCUMENT ME!
185      */
186     protected void allGroupsCheck_actionPerformed(ActionEvent e)
187     {
188     }
189
190     public void slider_mouseReleased(MouseEvent e)
191     {
192
193     }
194   }