apply gpl development license
[jalview.git] / src / jalview / jbgui / GUserDefinedColours.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3  * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18  */
19 package jalview.jbgui;
20
21 import java.awt.*;
22 import java.awt.event.*;
23 import javax.swing.*;
24
25 /**
26  * DOCUMENT ME!
27  * 
28  * @author $author$
29  * @version $Revision$
30  */
31 public class GUserDefinedColours extends JPanel
32 {
33   protected JColorChooser colorChooser = new JColorChooser();
34
35   protected JPanel buttonPanel = new JPanel();
36
37   protected GridLayout gridLayout = new GridLayout();
38
39   JPanel lowerPanel = new JPanel();
40
41   protected JButton okButton = new JButton();
42
43   protected JButton applyButton = new JButton();
44
45   protected JButton loadbutton = new JButton();
46
47   protected JButton savebutton = new JButton();
48
49   protected JButton cancelButton = new JButton();
50
51   JPanel namePanel = new JPanel();
52
53   JLabel jLabel1 = new JLabel();
54
55   protected JTextField schemeName = new JTextField();
56
57   BorderLayout borderLayout1 = new BorderLayout();
58
59   JPanel panel1 = new JPanel();
60
61   JPanel okCancelPanel = new JPanel();
62
63   JPanel saveLoadPanel = new JPanel();
64
65   BorderLayout borderLayout3 = new BorderLayout();
66
67   GridBagLayout gridBagLayout1 = new GridBagLayout();
68
69   BorderLayout borderLayout2 = new BorderLayout();
70
71   FlowLayout flowLayout1 = new FlowLayout();
72
73   BorderLayout borderLayout4 = new BorderLayout();
74
75   JPanel jPanel4 = new JPanel();
76
77   BorderLayout borderLayout5 = new BorderLayout();
78
79   JLabel label = new JLabel();
80
81   protected JPanel casePanel = new JPanel();
82
83   protected JCheckBox caseSensitive = new JCheckBox();
84
85   protected JButton lcaseColour = new JButton();
86
87   /**
88    * Creates a new GUserDefinedColours object.
89    */
90   public GUserDefinedColours()
91   {
92     try
93     {
94       jbInit();
95     } catch (Exception e)
96     {
97       e.printStackTrace();
98     }
99
100   }
101
102   /**
103    * DOCUMENT ME!
104    * 
105    * @throws Exception
106    *                 DOCUMENT ME!
107    */
108   private void jbInit() throws Exception
109   {
110     this.setLayout(borderLayout4);
111     buttonPanel.setLayout(gridLayout);
112     gridLayout.setColumns(4);
113     gridLayout.setRows(5);
114     okButton.setFont(new java.awt.Font("Verdana", 0, 11));
115     okButton.setText("OK");
116     okButton.addActionListener(new java.awt.event.ActionListener()
117     {
118       public void actionPerformed(ActionEvent e)
119       {
120         okButton_actionPerformed(e);
121       }
122     });
123     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
124     applyButton.setText("Apply");
125     applyButton.addActionListener(new java.awt.event.ActionListener()
126     {
127       public void actionPerformed(ActionEvent e)
128       {
129         applyButton_actionPerformed(e);
130       }
131     });
132     loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
133     loadbutton.setText("Load scheme");
134     loadbutton.addActionListener(new java.awt.event.ActionListener()
135     {
136       public void actionPerformed(ActionEvent e)
137       {
138         loadbutton_actionPerformed(e);
139       }
140     });
141     savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
142     savebutton.setText("Save scheme");
143     savebutton.addActionListener(new java.awt.event.ActionListener()
144     {
145       public void actionPerformed(ActionEvent e)
146       {
147         savebutton_actionPerformed(e);
148       }
149     });
150     cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));
151     cancelButton.setText("Cancel");
152     cancelButton.addActionListener(new java.awt.event.ActionListener()
153     {
154       public void actionPerformed(ActionEvent e)
155       {
156         cancelButton_actionPerformed(e);
157       }
158     });
159     this.setBackground(new Color(212, 208, 223));
160     lowerPanel.setOpaque(false);
161     lowerPanel.setLayout(borderLayout3);
162     colorChooser.setOpaque(false);
163     jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
164     jLabel1.setText("Name");
165     namePanel.setMinimumSize(new Dimension(300, 31));
166     namePanel.setOpaque(false);
167     namePanel.setPreferredSize(new Dimension(240, 25));
168     namePanel.setLayout(borderLayout1);
169     schemeName.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
170     schemeName.setPreferredSize(new Dimension(105, 21));
171     schemeName.setText("");
172     schemeName.setHorizontalAlignment(SwingConstants.CENTER);
173     panel1.setLayout(flowLayout1);
174     panel1.setOpaque(false);
175     okCancelPanel.setOpaque(false);
176     saveLoadPanel.setOpaque(false);
177     jPanel4.setLayout(borderLayout5);
178     label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
179     label.setOpaque(false);
180     label.setPreferredSize(new Dimension(260, 34));
181     label
182             .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 }