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