Ability to apply to all groups added
[jalview.git] / src / jalview / jbgui / GSliderPanel.java
1 package jalview.jbgui;
2
3 import java.awt.*;
4 import javax.swing.*;
5 import java.awt.event.*;
6
7 public class GSliderPanel extends JPanel
8 {
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   FlowLayout flowLayout2 = new FlowLayout();
21
22   public GSliderPanel()
23   {
24     try
25     {
26       jbInit();
27     }
28     catch(Exception e)
29     {
30       e.printStackTrace();
31     }
32   }
33   private void jbInit() throws Exception
34   {
35     this.setLayout(gridLayout1);
36     slider.setMajorTickSpacing(10);
37     slider.setMinorTickSpacing(1);
38     slider.setPaintTicks(true);
39     slider.setBackground(new Color(177, 177, 217));
40     slider.setFont(new java.awt.Font("Verdana", 0, 11));
41     slider.setOpaque(false);
42     valueField.setFont(new java.awt.Font("Verdana", 0, 11));
43     valueField.setMinimumSize(new Dimension(6, 14));
44     valueField.setPreferredSize(new Dimension(50, 21));
45     valueField.setText("");
46     valueField.setHorizontalAlignment(SwingConstants.CENTER);
47     valueField.addActionListener(new java.awt.event.ActionListener()
48     {
49       public void actionPerformed(ActionEvent e)
50       {
51         valueField_actionPerformed(e);
52       }
53     });
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(flowLayout2);
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()
65     {
66       public void actionPerformed(ActionEvent e)
67       {
68         applyButton_actionPerformed(e);
69       }
70     });
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()
76     {
77       public void actionPerformed(ActionEvent e)
78       {
79         undoButton_actionPerformed(e);
80       }
81     });
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()
87     {
88       public void actionPerformed(ActionEvent e)
89       {
90         allGroupsCheck_actionPerformed(e);
91       }
92     });
93     this.setBackground(new Color(177, 177, 217));
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, null);
102     jPanel1.add(valueField, null);
103     jPanel1.add(allGroupsCheck, null);
104
105   }
106
107   protected void valueField_actionPerformed(ActionEvent e)
108   {
109
110   }
111
112   protected void applyButton_actionPerformed(ActionEvent e)
113   {
114
115   }
116
117   protected void undoButton_actionPerformed(ActionEvent e)
118   {
119
120   }
121
122   protected void allGroupsCheck_actionPerformed(ActionEvent e)
123   {
124
125   }
126
127 }