applied copyright 2008
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3  * Copyright (C) 2008 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 import javax.swing.*;
24
25 /**
26  * DOCUMENT ME!
27  *
28  * @author $author$
29  * @version $Revision$
30  */
31 public class GSliderPanel
32     extends JPanel
33 {
34   // this is used for conservation colours, PID colours and redundancy threshold
35   protected JSlider slider = new JSlider();
36   protected JTextField valueField = new JTextField();
37   protected JLabel label = new JLabel();
38   protected JPanel southPanel = new JPanel();
39   GridLayout gridLayout1 = new GridLayout();
40   JPanel jPanel2 = new JPanel();
41   protected JButton applyButton = new JButton();
42   protected JButton undoButton = new JButton();
43   FlowLayout flowLayout1 = new FlowLayout();
44   protected JCheckBox allGroupsCheck = new JCheckBox();
45   BorderLayout borderLayout1 = new BorderLayout();
46   JPanel jPanel1 = new JPanel();
47   BorderLayout borderLayout2 = new BorderLayout();
48
49   /**
50    * Creates a new GSliderPanel object.
51    */
52   public GSliderPanel()
53   {
54     try
55     {
56       jbInit();
57     }
58     catch (Exception e)
59     {
60       e.printStackTrace();
61     }
62   }
63
64   /**
65    * DOCUMENT ME!
66    *
67    * @throws Exception DOCUMENT ME!
68    */
69   private void jbInit()
70       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 }