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