17fdb341ef92a7bc7b3c482d921dc15524c1ebf1
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2005 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
20 package jalview.jbgui;
21
22 import java.awt.*;
23 import javax.swing.*;
24 import java.awt.event.*;
25
26 public class GSliderPanel extends JPanel
27 {
28   // this is used for conservation colours, PID colours and redundancy threshold
29   protected JSlider slider = new JSlider();
30   protected JTextField valueField = new JTextField();
31   protected JLabel label = new JLabel();
32   JPanel jPanel1 = new JPanel();
33   GridLayout gridLayout1 = new GridLayout();
34   JPanel jPanel2 = new JPanel();
35   protected JButton applyButton = new JButton();
36   protected JButton undoButton = new JButton();
37   FlowLayout flowLayout1 = new FlowLayout();
38   protected JCheckBox allGroupsCheck = new JCheckBox();
39   BorderLayout borderLayout1 = new BorderLayout();
40
41   public GSliderPanel()
42   {
43     try
44     {
45       jbInit();
46     }
47     catch(Exception e)
48     {
49       e.printStackTrace();
50     }
51   }
52   private void jbInit() throws Exception
53   {
54     this.setLayout(gridLayout1);
55     slider.setMajorTickSpacing(10);
56     slider.setMinorTickSpacing(1);
57     slider.setPaintTicks(true);
58     slider.setBackground(Color.white);
59     slider.setFont(new java.awt.Font("Verdana", 0, 11));
60     slider.setDoubleBuffered(true);
61     valueField.setFont(new java.awt.Font("Verdana", 0, 11));
62     valueField.setMinimumSize(new Dimension(6, 14));
63     valueField.setPreferredSize(new Dimension(50, 12));
64     valueField.setText("");
65     valueField.setHorizontalAlignment(SwingConstants.CENTER);
66     valueField.addActionListener(new java.awt.event.ActionListener()
67     {
68       public void actionPerformed(ActionEvent e)
69       {
70         valueField_actionPerformed(e);
71       }
72     });
73     label.setFont(new java.awt.Font("Verdana", 0, 11));
74     label.setOpaque(false);
75     label.setHorizontalAlignment(SwingConstants.CENTER);
76     label.setText("set this label text");
77     jPanel1.setLayout(borderLayout1);
78     gridLayout1.setRows(2);
79     jPanel2.setLayout(flowLayout1);
80     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
81     applyButton.setOpaque(false);
82     applyButton.setText("Apply");
83     applyButton.addActionListener(new java.awt.event.ActionListener()
84     {
85       public void actionPerformed(ActionEvent e)
86       {
87         applyButton_actionPerformed(e);
88       }
89     });
90     undoButton.setEnabled(false);
91     undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
92     undoButton.setOpaque(false);
93     undoButton.setText("Undo");
94     undoButton.addActionListener(new java.awt.event.ActionListener()
95     {
96       public void actionPerformed(ActionEvent e)
97       {
98         undoButton_actionPerformed(e);
99       }
100     });
101     allGroupsCheck.setEnabled(false);
102     allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
103     allGroupsCheck.setOpaque(false);
104     allGroupsCheck.setText("Apply to all Groups");
105     allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
106     {
107       public void actionPerformed(ActionEvent e)
108       {
109         allGroupsCheck_actionPerformed(e);
110       }
111     });
112     this.setBackground(Color.white);
113     this.setPreferredSize(new Dimension(415, 84));
114     jPanel2.setOpaque(false);
115     jPanel1.setOpaque(false);
116     this.add(jPanel2, null);
117     jPanel2.add(label, null);
118     jPanel2.add(applyButton, null);
119     jPanel2.add(undoButton, null);this.add(jPanel1, null);
120     jPanel1.add(slider,  BorderLayout.WEST);
121     jPanel1.add(valueField,  BorderLayout.CENTER);
122     jPanel1.add(allGroupsCheck, BorderLayout.EAST);
123
124   }
125
126   protected void valueField_actionPerformed(ActionEvent e)
127   {
128
129   }
130
131   protected void applyButton_actionPerformed(ActionEvent e)
132   {
133
134   }
135
136   protected void undoButton_actionPerformed(ActionEvent e)
137   {
138
139   }
140
141   protected void allGroupsCheck_actionPerformed(ActionEvent e)
142   {
143
144   }
145
146 }