JAL-1432 updated copyright notices
[jalview.git] / src / jalview / jbgui / GUserDefinedColours.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.jbgui;
20
21 import jalview.gui.JvSwingUtils;
22
23 import java.awt.*;
24 import java.awt.event.*;
25 import javax.swing.*;
26
27 /**
28  * DOCUMENT ME!
29  * 
30  * @author $author$
31  * @version $Revision$
32  */
33 public class GUserDefinedColours extends JPanel
34 {
35   protected JColorChooser colorChooser = new JColorChooser();
36
37   protected JPanel buttonPanel = new JPanel();
38
39   protected GridLayout gridLayout = new GridLayout();
40
41   JPanel lowerPanel = new JPanel();
42
43   protected JButton okButton = new JButton();
44
45   protected JButton applyButton = new JButton();
46
47   protected JButton loadbutton = new JButton();
48
49   protected JButton savebutton = new JButton();
50
51   protected JButton cancelButton = new JButton();
52
53   JPanel namePanel = new JPanel();
54
55   JLabel jLabel1 = new JLabel();
56
57   protected JTextField schemeName = new JTextField();
58
59   BorderLayout borderLayout1 = new BorderLayout();
60
61   JPanel panel1 = new JPanel();
62
63   JPanel okCancelPanel = new JPanel();
64
65   JPanel saveLoadPanel = new JPanel();
66
67   BorderLayout borderLayout3 = new BorderLayout();
68
69   GridBagLayout gridBagLayout1 = new GridBagLayout();
70
71   BorderLayout borderLayout2 = new BorderLayout();
72
73   FlowLayout flowLayout1 = new FlowLayout();
74
75   BorderLayout borderLayout4 = new BorderLayout();
76
77   JPanel jPanel4 = new JPanel();
78
79   BorderLayout borderLayout5 = new BorderLayout();
80
81   JLabel label = new JLabel();
82
83   protected JPanel casePanel = new JPanel();
84
85   protected JCheckBox caseSensitive = new JCheckBox();
86
87   protected JButton lcaseColour = new JButton();
88
89   /**
90    * Creates a new GUserDefinedColours object.
91    */
92   public GUserDefinedColours()
93   {
94     try
95     {
96       jbInit();
97     } catch (Exception e)
98     {
99       e.printStackTrace();
100     }
101
102   }
103
104   /**
105    * DOCUMENT ME!
106    * 
107    * @throws Exception
108    *           DOCUMENT ME!
109    */
110   private void jbInit() throws Exception
111   {
112     this.setLayout(borderLayout4);
113     buttonPanel.setLayout(gridLayout);
114     gridLayout.setColumns(4);
115     gridLayout.setRows(5);
116     okButton.setFont(new java.awt.Font("Verdana", 0, 11));
117     okButton.setText("OK");
118     okButton.addActionListener(new java.awt.event.ActionListener()
119     {
120       public void actionPerformed(ActionEvent e)
121       {
122         okButton_actionPerformed(e);
123       }
124     });
125     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
126     applyButton.setText("Apply");
127     applyButton.addActionListener(new java.awt.event.ActionListener()
128     {
129       public void actionPerformed(ActionEvent e)
130       {
131         applyButton_actionPerformed(e);
132       }
133     });
134     loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
135     loadbutton.setText("Load scheme");
136     loadbutton.addActionListener(new java.awt.event.ActionListener()
137     {
138       public void actionPerformed(ActionEvent e)
139       {
140         loadbutton_actionPerformed(e);
141       }
142     });
143     savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
144     savebutton.setText("Save scheme");
145     savebutton.addActionListener(new java.awt.event.ActionListener()
146     {
147       public void actionPerformed(ActionEvent e)
148       {
149         savebutton_actionPerformed(e);
150       }
151     });
152     cancelButton.setFont(JvSwingUtils.getLabelFont());
153     cancelButton.setText("Cancel");
154     cancelButton.addActionListener(new java.awt.event.ActionListener()
155     {
156       public void actionPerformed(ActionEvent e)
157       {
158         cancelButton_actionPerformed(e);
159       }
160     });
161     this.setBackground(new Color(212, 208, 223));
162     lowerPanel.setOpaque(false);
163     lowerPanel.setLayout(borderLayout3);
164     colorChooser.setOpaque(false);
165     jLabel1.setFont(JvSwingUtils.getLabelFont());
166     jLabel1.setText("Name");
167     namePanel.setMinimumSize(new Dimension(300, 31));
168     namePanel.setOpaque(false);
169     namePanel.setPreferredSize(new Dimension(240, 25));
170     namePanel.setLayout(borderLayout1);
171     schemeName.setFont(JvSwingUtils.getLabelFont());
172     schemeName.setPreferredSize(new Dimension(105, 21));
173     schemeName.setText("");
174     schemeName.setHorizontalAlignment(SwingConstants.CENTER);
175     panel1.setLayout(flowLayout1);
176     panel1.setOpaque(false);
177     okCancelPanel.setOpaque(false);
178     saveLoadPanel.setOpaque(false);
179     jPanel4.setLayout(borderLayout5);
180     label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
181     label.setOpaque(false);
182     label.setPreferredSize(new Dimension(260, 34));
183     label.setText("<html>Save your colour scheme with a unique name and it will be added "
184             + "to the Colour menu.</html>");
185     caseSensitive.setText("Case Sensitive");
186     caseSensitive.addActionListener(new ActionListener()
187     {
188       public void actionPerformed(ActionEvent e)
189       {
190         caseSensitive_actionPerformed(e);
191       }
192     });
193     lcaseColour.setText("Lower Case Colour");
194     lcaseColour.addActionListener(new ActionListener()
195     {
196       public void actionPerformed(ActionEvent e)
197       {
198         lcaseColour_actionPerformed(e);
199       }
200     });
201
202     saveLoadPanel.add(savebutton);
203     saveLoadPanel.add(loadbutton);
204     okCancelPanel.add(applyButton);
205     okCancelPanel.add(okButton);
206     okCancelPanel.add(cancelButton);
207     lowerPanel.add(saveLoadPanel, java.awt.BorderLayout.NORTH);
208     lowerPanel.add(okCancelPanel, java.awt.BorderLayout.SOUTH);
209
210     namePanel.add(schemeName, java.awt.BorderLayout.CENTER);
211     namePanel.add(jLabel1, java.awt.BorderLayout.WEST);
212     panel1.add(namePanel, null);
213     panel1.add(buttonPanel, null);
214     panel1.add(casePanel);
215     casePanel.add(caseSensitive);
216     casePanel.add(lcaseColour);
217     panel1.add(lowerPanel, null);
218     panel1.add(label);
219
220     jPanel4.add(panel1, java.awt.BorderLayout.CENTER);
221     this.add(jPanel4, java.awt.BorderLayout.CENTER);
222     this.add(colorChooser, java.awt.BorderLayout.EAST);
223   }
224
225   /**
226    * DOCUMENT ME!
227    * 
228    * @param e
229    *          DOCUMENT ME!
230    */
231   protected void okButton_actionPerformed(ActionEvent e)
232   {
233   }
234
235   /**
236    * DOCUMENT ME!
237    * 
238    * @param e
239    *          DOCUMENT ME!
240    */
241   protected void applyButton_actionPerformed(ActionEvent e)
242   {
243   }
244
245   /**
246    * DOCUMENT ME!
247    * 
248    * @param e
249    *          DOCUMENT ME!
250    */
251   protected void loadbutton_actionPerformed(ActionEvent e)
252   {
253   }
254
255   /**
256    * DOCUMENT ME!
257    * 
258    * @param e
259    *          DOCUMENT ME!
260    */
261   protected void savebutton_actionPerformed(ActionEvent e)
262   {
263   }
264
265   /**
266    * DOCUMENT ME!
267    * 
268    * @param e
269    *          DOCUMENT ME!
270    */
271   protected void cancelButton_actionPerformed(ActionEvent e)
272   {
273   }
274
275   public void caseSensitive_actionPerformed(ActionEvent e)
276   {
277
278   }
279
280   public void lcaseColour_actionPerformed(ActionEvent e)
281   {
282
283   }
284 }