1 package jalview.jbappletgui;
\r
4 import java.awt.event.*;
\r
6 public class GSliderPanel extends Panel
\r
8 // this is used for conservation colours, PID colours and redundancy threshold
\r
9 protected Scrollbar slider = new Scrollbar();
\r
10 protected TextField valueField = new TextField();
\r
11 protected Label label = new Label();
\r
12 Panel jPanel1 = new Panel();
\r
13 Panel jPanel2 = new Panel();
\r
14 protected Button applyButton = new Button();
\r
15 protected Button undoButton = new Button();
\r
16 FlowLayout flowLayout1 = new FlowLayout();
\r
17 protected Checkbox allGroupsCheck = new Checkbox();
\r
18 BorderLayout borderLayout1 = new BorderLayout();
\r
19 BorderLayout borderLayout2 = new BorderLayout();
\r
20 FlowLayout flowLayout2 = new FlowLayout();
\r
22 public GSliderPanel()
\r
30 e.printStackTrace();
\r
33 private void jbInit() throws Exception
\r
35 this.setLayout(borderLayout2);
\r
36 // slider.setMajorTickSpacing(10);
\r
37 // slider.setMinorTickSpacing(1);
\r
38 // slider.setPaintTicks(true);
\r
39 slider.setBackground(Color.white);
\r
40 slider.setFont(new java.awt.Font("Verdana", 0, 11));
\r
41 slider.setOrientation(0);
\r
42 valueField.setFont(new java.awt.Font("Verdana", 0, 11));
\r
43 valueField.setText(" ");
\r
44 valueField.addActionListener(new java.awt.event.ActionListener()
\r
46 public void actionPerformed(ActionEvent e)
\r
48 valueField_actionPerformed(e);
\r
51 label.setFont(new java.awt.Font("Verdana", 0, 11));
\r
52 label.setText("set this label text");
\r
53 jPanel1.setLayout(borderLayout1);
\r
54 jPanel2.setLayout(flowLayout1);
\r
55 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
56 applyButton.setLabel("Apply");
\r
57 applyButton.addActionListener(new java.awt.event.ActionListener()
\r
59 public void actionPerformed(ActionEvent e)
\r
61 applyButton_actionPerformed(e);
\r
64 undoButton.setEnabled(false);
\r
65 undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
66 undoButton.setLabel("Undo");
\r
67 undoButton.addActionListener(new java.awt.event.ActionListener()
\r
69 public void actionPerformed(ActionEvent e)
\r
71 undoButton_actionPerformed(e);
\r
74 allGroupsCheck.setEnabled(false);
\r
75 allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
\r
76 allGroupsCheck.setLabel("Apply threshold to all groups");
\r
77 allGroupsCheck.setName("Apply to all Groups");
\r
78 allGroupsCheck.addItemListener(new java.awt.event.ItemListener()
\r
80 public void itemStateChanged(ItemEvent e)
\r
82 allGroupsCheck_actionPerformed();
\r
85 this.setBackground(Color.white);
\r
86 this.setForeground(Color.black);
\r
87 jPanel2.add(label, null);
\r
88 jPanel2.add(applyButton, null);
\r
89 jPanel2.add(undoButton, null);
\r
90 jPanel2.add(allGroupsCheck);
\r
91 jPanel1.add(valueField, java.awt.BorderLayout.EAST);
\r
92 jPanel1.add(slider, java.awt.BorderLayout.CENTER);
\r
93 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
\r
94 this.add(jPanel2, java.awt.BorderLayout.CENTER);
\r
97 protected void valueField_actionPerformed(ActionEvent e)
\r
102 protected void applyButton_actionPerformed(ActionEvent e)
\r
107 protected void undoButton_actionPerformed(ActionEvent e)
\r
112 protected void allGroupsCheck_actionPerformed()
\r