5e333005e88d5627ced78ce0c9e53a73fb40c2cd
[jalview.git] / src / jalview / jbappletgui / GSliderPanel.java
1 /*\r
2 * Jalview - A Sequence Alignment Editor and Viewer\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4 *\r
5 * This program is free software; you can redistribute it and/or\r
6 * modify it under the terms of the GNU General Public License\r
7 * as published by the Free Software Foundation; either version 2\r
8 * of the License, or (at your option) any later version.\r
9 *\r
10 * This program is distributed in the hope that it will be useful,\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 * GNU General Public License for more details.\r
14 *\r
15 * You should have received a copy of the GNU General Public License\r
16 * along with this program; if not, write to the Free Software\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18 */\r
19 package jalview.jbappletgui;\r
20 \r
21 import java.awt.*;\r
22 import java.awt.event.*;\r
23 \r
24 \r
25 public class GSliderPanel extends Panel {\r
26     // this is used for conservation colours, PID colours and redundancy threshold\r
27     protected Scrollbar slider = new Scrollbar();\r
28     protected TextField valueField = new TextField();\r
29     protected Label label = new Label();\r
30     Panel jPanel1 = new Panel();\r
31     Panel jPanel2 = new Panel();\r
32     protected Button applyButton = new Button();\r
33     protected Button undoButton = new Button();\r
34     FlowLayout flowLayout1 = new FlowLayout();\r
35     protected Checkbox allGroupsCheck = new Checkbox();\r
36     BorderLayout borderLayout1 = new BorderLayout();\r
37     BorderLayout borderLayout2 = new BorderLayout();\r
38     FlowLayout flowLayout2 = new FlowLayout();\r
39 \r
40     public GSliderPanel() {\r
41         try {\r
42             jbInit();\r
43         } catch (Exception e) {\r
44             e.printStackTrace();\r
45         }\r
46     }\r
47 \r
48     private void jbInit() throws Exception {\r
49         this.setLayout(borderLayout2);\r
50 \r
51         // slider.setMajorTickSpacing(10);\r
52         //  slider.setMinorTickSpacing(1);\r
53         //  slider.setPaintTicks(true);\r
54         slider.setBackground(Color.white);\r
55         slider.setFont(new java.awt.Font("Verdana", 0, 11));\r
56         slider.setOrientation(0);\r
57         valueField.setFont(new java.awt.Font("Verdana", 0, 11));\r
58         valueField.setText("      ");\r
59         valueField.addActionListener(new java.awt.event.ActionListener() {\r
60                 public void actionPerformed(ActionEvent e) {\r
61                     valueField_actionPerformed(e);\r
62                 }\r
63             });\r
64         label.setFont(new java.awt.Font("Verdana", 0, 11));\r
65         label.setText("set this label text");\r
66         jPanel1.setLayout(borderLayout1);\r
67         jPanel2.setLayout(flowLayout1);\r
68         applyButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
69         applyButton.setLabel("Apply");\r
70         applyButton.addActionListener(new java.awt.event.ActionListener() {\r
71                 public void actionPerformed(ActionEvent e) {\r
72                     applyButton_actionPerformed(e);\r
73                 }\r
74             });\r
75         undoButton.setEnabled(false);\r
76         undoButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
77         undoButton.setLabel("Undo");\r
78         undoButton.addActionListener(new java.awt.event.ActionListener() {\r
79                 public void actionPerformed(ActionEvent e) {\r
80                     undoButton_actionPerformed(e);\r
81                 }\r
82             });\r
83         allGroupsCheck.setEnabled(false);\r
84         allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));\r
85         allGroupsCheck.setLabel("Apply threshold to all groups");\r
86         allGroupsCheck.setName("Apply to all Groups");\r
87         allGroupsCheck.addItemListener(new java.awt.event.ItemListener() {\r
88                 public void itemStateChanged(ItemEvent e) {\r
89                     allGroupsCheck_actionPerformed();\r
90                 }\r
91             });\r
92         this.setBackground(Color.white);\r
93         this.setForeground(Color.black);\r
94         jPanel2.add(label, null);\r
95         jPanel2.add(applyButton, null);\r
96         jPanel2.add(undoButton, null);\r
97         jPanel2.add(allGroupsCheck);\r
98         jPanel1.add(valueField, java.awt.BorderLayout.EAST);\r
99         jPanel1.add(slider, java.awt.BorderLayout.CENTER);\r
100         this.add(jPanel1, java.awt.BorderLayout.SOUTH);\r
101         this.add(jPanel2, java.awt.BorderLayout.CENTER);\r
102     }\r
103 \r
104     protected void valueField_actionPerformed(ActionEvent e) {\r
105     }\r
106 \r
107     protected void applyButton_actionPerformed(ActionEvent e) {\r
108     }\r
109 \r
110     protected void undoButton_actionPerformed(ActionEvent e) {\r
111     }\r
112 \r
113     protected void allGroupsCheck_actionPerformed() {\r
114     }\r
115 }\r