Jalview 2.6 source licence
[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
181             .setText("<html>Save your colour scheme with a unique name and it will be added "
182                     + "to the Colour menu.</html>");
183     caseSensitive.setText("Case Sensitive");
184     caseSensitive.addActionListener(new ActionListener()
185     {
186       public void actionPerformed(ActionEvent e)
187       {
188         caseSensitive_actionPerformed(e);
189       }
190     });
191     lcaseColour.setText("Lower Case Colour");
192     lcaseColour.addActionListener(new ActionListener()
193     {
194       public void actionPerformed(ActionEvent e)
195       {
196         lcaseColour_actionPerformed(e);
197       }
198     });
199
200     saveLoadPanel.add(savebutton);
201     saveLoadPanel.add(loadbutton);
202     okCancelPanel.add(applyButton);
203     okCancelPanel.add(okButton);
204     okCancelPanel.add(cancelButton);
205     lowerPanel.add(saveLoadPanel, java.awt.BorderLayout.NORTH);
206     lowerPanel.add(okCancelPanel, java.awt.BorderLayout.SOUTH);
207
208     namePanel.add(schemeName, java.awt.BorderLayout.CENTER);
209     namePanel.add(jLabel1, java.awt.BorderLayout.WEST);
210     panel1.add(namePanel, null);
211     panel1.add(buttonPanel, null);
212     panel1.add(casePanel);
213     casePanel.add(caseSensitive);
214     casePanel.add(lcaseColour);
215     panel1.add(lowerPanel, null);
216     panel1.add(label);
217
218     jPanel4.add(panel1, java.awt.BorderLayout.CENTER);
219     this.add(jPanel4, java.awt.BorderLayout.CENTER);
220     this.add(colorChooser, java.awt.BorderLayout.EAST);
221   }
222
223   /**
224    * DOCUMENT ME!
225    * 
226    * @param e
227    *          DOCUMENT ME!
228    */
229   protected void okButton_actionPerformed(ActionEvent e)
230   {
231   }
232
233   /**
234    * DOCUMENT ME!
235    * 
236    * @param e
237    *          DOCUMENT ME!
238    */
239   protected void applyButton_actionPerformed(ActionEvent e)
240   {
241   }
242
243   /**
244    * DOCUMENT ME!
245    * 
246    * @param e
247    *          DOCUMENT ME!
248    */
249   protected void loadbutton_actionPerformed(ActionEvent e)
250   {
251   }
252
253   /**
254    * DOCUMENT ME!
255    * 
256    * @param e
257    *          DOCUMENT ME!
258    */
259   protected void savebutton_actionPerformed(ActionEvent e)
260   {
261   }
262
263   /**
264    * DOCUMENT ME!
265    * 
266    * @param e
267    *          DOCUMENT ME!
268    */
269   protected void cancelButton_actionPerformed(ActionEvent e)
270   {
271   }
272
273   public void caseSensitive_actionPerformed(ActionEvent e)
274   {
275
276   }
277
278   public void lcaseColour_actionPerformed(ActionEvent e)
279   {
280
281   }
282 }