d8120b4f19bbfb69e283ad5a8dc0d33df4cac709
[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 \r
20 package jalview.jbappletgui;\r
21 \r
22 import java.awt.*;\r
23 import java.awt.event.*;\r
24 \r
25 public class GSliderPanel extends Panel\r
26 {\r
27   // this is used for conservation colours, PID colours and redundancy threshold\r
28   protected Scrollbar slider = new Scrollbar();\r
29   protected TextField valueField = new TextField();\r
30   protected Label label = new Label();\r
31   Panel jPanel1 = new Panel();\r
32   Panel jPanel2 = new Panel();\r
33   protected Button applyButton = new Button();\r
34   protected Button undoButton = new Button();\r
35   FlowLayout flowLayout1 = new FlowLayout();\r
36   protected Checkbox allGroupsCheck = new Checkbox();\r
37   BorderLayout borderLayout1 = new BorderLayout();\r
38   BorderLayout borderLayout2 = new BorderLayout();\r
39   FlowLayout flowLayout2 = new FlowLayout();\r
40 \r
41   public GSliderPanel()\r
42   {\r
43     try\r
44     {\r
45       jbInit();\r
46     }\r
47     catch(Exception e)\r
48     {\r
49       e.printStackTrace();\r
50     }\r
51   }\r
52   private void jbInit() throws Exception\r
53   {\r
54     this.setLayout(borderLayout2);\r
55    // slider.setMajorTickSpacing(10);\r
56   //  slider.setMinorTickSpacing(1);\r
57   //  slider.setPaintTicks(true);\r
58     slider.setBackground(Color.white);\r
59     slider.setFont(new java.awt.Font("Verdana", 0, 11));\r
60     slider.setOrientation(0);\r
61     valueField.setFont(new java.awt.Font("Verdana", 0, 11));\r
62     valueField.setText("      ");\r
63     valueField.addActionListener(new java.awt.event.ActionListener()\r
64     {\r
65       public void actionPerformed(ActionEvent e)\r
66       {\r
67         valueField_actionPerformed(e);\r
68       }\r
69     });\r
70     label.setFont(new java.awt.Font("Verdana", 0, 11));\r
71     label.setText("set this label text");\r
72     jPanel1.setLayout(borderLayout1);\r
73     jPanel2.setLayout(flowLayout1);\r
74     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
75     applyButton.setLabel("Apply");\r
76     applyButton.addActionListener(new java.awt.event.ActionListener()\r
77     {\r
78       public void actionPerformed(ActionEvent e)\r
79       {\r
80         applyButton_actionPerformed(e);\r
81       }\r
82     });\r
83     undoButton.setEnabled(false);\r
84     undoButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
85     undoButton.setLabel("Undo");\r
86     undoButton.addActionListener(new java.awt.event.ActionListener()\r
87     {\r
88       public void actionPerformed(ActionEvent e)\r
89       {\r
90         undoButton_actionPerformed(e);\r
91       }\r
92     });\r
93     allGroupsCheck.setEnabled(false);\r
94     allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));\r
95     allGroupsCheck.setLabel("Apply threshold to all groups");\r
96     allGroupsCheck.setName("Apply to all Groups");\r
97     allGroupsCheck.addItemListener(new java.awt.event.ItemListener()\r
98     {\r
99       public void itemStateChanged(ItemEvent e)\r
100       {\r
101         allGroupsCheck_actionPerformed();\r
102       }\r
103     });\r
104     this.setBackground(Color.white);\r
105     this.setForeground(Color.black);\r
106     jPanel2.add(label, null);\r
107     jPanel2.add(applyButton, null);\r
108     jPanel2.add(undoButton, null);\r
109     jPanel2.add(allGroupsCheck);\r
110     jPanel1.add(valueField, java.awt.BorderLayout.EAST);\r
111     jPanel1.add(slider, java.awt.BorderLayout.CENTER);\r
112     this.add(jPanel1, java.awt.BorderLayout.SOUTH);\r
113     this.add(jPanel2, java.awt.BorderLayout.CENTER);\r
114   }\r
115 \r
116   protected void valueField_actionPerformed(ActionEvent e)\r
117   {\r
118 \r
119   }\r
120 \r
121   protected void applyButton_actionPerformed(ActionEvent e)\r
122   {\r
123 \r
124   }\r
125 \r
126   protected void undoButton_actionPerformed(ActionEvent e)\r
127   {\r
128 \r
129   }\r
130 \r
131   protected void allGroupsCheck_actionPerformed()\r
132   {\r
133 \r
134   }\r
135 \r
136 }\r