2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\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
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
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
20 package jalview.jbappletgui;
\r
23 import java.awt.event.*;
\r
25 public class GSliderPanel extends Panel
\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
41 public GSliderPanel()
\r
49 e.printStackTrace();
\r
52 private void jbInit() throws Exception
\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
65 public void actionPerformed(ActionEvent e)
\r
67 valueField_actionPerformed(e);
\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
78 public void actionPerformed(ActionEvent e)
\r
80 applyButton_actionPerformed(e);
\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
88 public void actionPerformed(ActionEvent e)
\r
90 undoButton_actionPerformed(e);
\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
99 public void itemStateChanged(ItemEvent e)
\r
101 allGroupsCheck_actionPerformed();
\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
116 protected void valueField_actionPerformed(ActionEvent e)
\r
121 protected void applyButton_actionPerformed(ActionEvent e)
\r
126 protected void undoButton_actionPerformed(ActionEvent e)
\r
131 protected void allGroupsCheck_actionPerformed()
\r