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