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