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