5 import java.awt.event.*;
7 public class GSliderPanel extends JPanel
9 // this is used for conservation colours, PID colours and redundancy threshold
10 protected JSlider slider = new JSlider();
11 protected JTextField valueField = new JTextField();
12 protected JLabel label = new JLabel();
13 JPanel jPanel1 = new JPanel();
14 GridLayout gridLayout1 = new GridLayout();
15 JPanel jPanel2 = new JPanel();
16 protected JButton applyButton = new JButton();
17 protected JButton undoButton = new JButton();
18 FlowLayout flowLayout1 = new FlowLayout();
19 protected JCheckBox allGroupsCheck = new JCheckBox();
20 BorderLayout borderLayout1 = new BorderLayout();
33 private void jbInit() throws Exception
35 this.setLayout(gridLayout1);
36 slider.setMajorTickSpacing(10);
37 slider.setMinorTickSpacing(1);
38 slider.setPaintTicks(true);
39 slider.setBackground(Color.white);
40 slider.setFont(new java.awt.Font("Verdana", 0, 11));
41 slider.setDoubleBuffered(true);
42 valueField.setFont(new java.awt.Font("Verdana", 0, 11));
43 valueField.setMinimumSize(new Dimension(6, 14));
44 valueField.setPreferredSize(new Dimension(50, 12));
45 valueField.setText("");
46 valueField.setHorizontalAlignment(SwingConstants.CENTER);
47 valueField.addActionListener(new java.awt.event.ActionListener()
49 public void actionPerformed(ActionEvent e)
51 valueField_actionPerformed(e);
54 label.setFont(new java.awt.Font("Verdana", 0, 11));
55 label.setOpaque(false);
56 label.setHorizontalAlignment(SwingConstants.CENTER);
57 label.setText("set this label text");
58 jPanel1.setLayout(borderLayout1);
59 gridLayout1.setRows(2);
60 jPanel2.setLayout(flowLayout1);
61 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
62 applyButton.setOpaque(false);
63 applyButton.setText("Apply");
64 applyButton.addActionListener(new java.awt.event.ActionListener()
66 public void actionPerformed(ActionEvent e)
68 applyButton_actionPerformed(e);
71 undoButton.setEnabled(false);
72 undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
73 undoButton.setOpaque(false);
74 undoButton.setText("Undo");
75 undoButton.addActionListener(new java.awt.event.ActionListener()
77 public void actionPerformed(ActionEvent e)
79 undoButton_actionPerformed(e);
82 allGroupsCheck.setEnabled(false);
83 allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
84 allGroupsCheck.setOpaque(false);
85 allGroupsCheck.setText("Apply to all Groups");
86 allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
88 public void actionPerformed(ActionEvent e)
90 allGroupsCheck_actionPerformed(e);
93 this.setBackground(Color.white);
94 this.setPreferredSize(new Dimension(415, 84));
95 jPanel2.setOpaque(false);
96 jPanel1.setOpaque(false);
97 this.add(jPanel2, null);
98 jPanel2.add(label, null);
99 jPanel2.add(applyButton, null);
100 jPanel2.add(undoButton, null);this.add(jPanel1, null);
101 jPanel1.add(slider, BorderLayout.WEST);
102 jPanel1.add(valueField, BorderLayout.CENTER);
103 jPanel1.add(allGroupsCheck, BorderLayout.EAST);
107 protected void valueField_actionPerformed(ActionEvent e)
112 protected void applyButton_actionPerformed(ActionEvent e)
117 protected void undoButton_actionPerformed(ActionEvent e)
122 protected void allGroupsCheck_actionPerformed(ActionEvent e)