update author list in license for (JAL-826)
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  * 
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package jalview.jbgui;
19
20 import java.awt.*;
21 import java.awt.event.*;
22 import javax.swing.*;
23
24 /**
25  * DOCUMENT ME!
26  * 
27  * @author $author$
28  * @version $Revision$
29  */
30 public class GSliderPanel extends JPanel
31 {
32   // this is used for conservation colours, PID colours and redundancy threshold
33   protected JSlider slider = new JSlider();
34
35   protected JTextField valueField = new JTextField();
36
37   protected JLabel label = new JLabel();
38
39   protected JPanel southPanel = new JPanel();
40
41   GridLayout gridLayout1 = new GridLayout();
42
43   JPanel jPanel2 = new JPanel();
44
45   protected JButton applyButton = new JButton();
46
47   protected JButton undoButton = new JButton();
48
49   FlowLayout flowLayout1 = new FlowLayout();
50
51   protected JCheckBox allGroupsCheck = new JCheckBox();
52
53   BorderLayout borderLayout1 = new BorderLayout();
54
55   JPanel jPanel1 = new JPanel();
56
57   BorderLayout borderLayout2 = new BorderLayout();
58
59   /**
60    * Creates a new GSliderPanel object.
61    */
62   public GSliderPanel()
63   {
64     try
65     {
66       jbInit();
67     } catch (Exception e)
68     {
69       e.printStackTrace();
70     }
71   }
72
73   /**
74    * DOCUMENT ME!
75    * 
76    * @throws Exception
77    *           DOCUMENT ME!
78    */
79   private void jbInit() throws Exception
80   {
81     this.setLayout(gridLayout1);
82     slider.setMajorTickSpacing(10);
83     slider.setMinorTickSpacing(1);
84     slider.setPaintTicks(true);
85     slider.setBackground(Color.white);
86     slider.setFont(new java.awt.Font("Verdana", 0, 11));
87     slider.setDoubleBuffered(true);
88     slider.addMouseListener(new MouseAdapter()
89     {
90       public void mouseReleased(MouseEvent e)
91       {
92         slider_mouseReleased(e);
93       }
94     });
95     valueField.setFont(new java.awt.Font("Verdana", 0, 11));
96     valueField.setMinimumSize(new Dimension(6, 14));
97     valueField.setPreferredSize(new Dimension(50, 12));
98     valueField.setText("");
99     valueField.setHorizontalAlignment(SwingConstants.CENTER);
100     valueField.addActionListener(new java.awt.event.ActionListener()
101     {
102       public void actionPerformed(ActionEvent e)
103       {
104         valueField_actionPerformed(e);
105       }
106     });
107     label.setFont(new java.awt.Font("Verdana", 0, 11));
108     label.setOpaque(false);
109     label.setHorizontalAlignment(SwingConstants.CENTER);
110     label.setText("set this label text");
111     southPanel.setLayout(borderLayout1);
112     gridLayout1.setRows(2);
113     jPanel2.setLayout(flowLayout1);
114     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
115     applyButton.setOpaque(false);
116     applyButton.setText("Apply");
117     applyButton.addActionListener(new java.awt.event.ActionListener()
118     {
119       public void actionPerformed(ActionEvent e)
120       {
121         applyButton_actionPerformed(e);
122       }
123     });
124     undoButton.setEnabled(false);
125     undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
126     undoButton.setOpaque(false);
127     undoButton.setText("Undo");
128     undoButton.addActionListener(new java.awt.event.ActionListener()
129     {
130       public void actionPerformed(ActionEvent e)
131       {
132         undoButton_actionPerformed(e);
133       }
134     });
135     allGroupsCheck.setEnabled(false);
136     allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
137     allGroupsCheck.setOpaque(false);
138     allGroupsCheck.setText("Apply to all Groups");
139     allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
140     {
141       public void actionPerformed(ActionEvent e)
142       {
143         allGroupsCheck_actionPerformed(e);
144       }
145     });
146     this.setBackground(Color.white);
147     this.setPreferredSize(new Dimension(415, 84));
148     jPanel2.setOpaque(false);
149     southPanel.setOpaque(false);
150     jPanel1.setLayout(borderLayout2);
151     jPanel1.setOpaque(false);
152     this.add(jPanel2, null);
153     jPanel2.add(label, null);
154     jPanel2.add(applyButton, null);
155     jPanel2.add(undoButton, null);
156     this.add(southPanel, null);
157     southPanel.add(jPanel1, java.awt.BorderLayout.EAST);
158     southPanel.add(slider, java.awt.BorderLayout.CENTER);
159     jPanel1.add(valueField, java.awt.BorderLayout.CENTER);
160     jPanel1.add(allGroupsCheck, java.awt.BorderLayout.EAST);
161   }
162
163   /**
164    * DOCUMENT ME!
165    * 
166    * @param e
167    *          DOCUMENT ME!
168    */
169   protected void valueField_actionPerformed(ActionEvent e)
170   {
171   }
172
173   /**
174    * DOCUMENT ME!
175    * 
176    * @param e
177    *          DOCUMENT ME!
178    */
179   protected void applyButton_actionPerformed(ActionEvent e)
180   {
181   }
182
183   /**
184    * DOCUMENT ME!
185    * 
186    * @param e
187    *          DOCUMENT ME!
188    */
189   protected void undoButton_actionPerformed(ActionEvent e)
190   {
191   }
192
193   /**
194    * DOCUMENT ME!
195    * 
196    * @param e
197    *          DOCUMENT ME!
198    */
199   protected void allGroupsCheck_actionPerformed(ActionEvent e)
200   {
201   }
202
203   public void slider_mouseReleased(MouseEvent e)
204   {
205
206   }
207 }