JAL-1355 (basic i18n support)
[jalview.git] / src / jalview / jbgui / GUserDefinedColours.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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 import jalview.util.MessageManager;
22
23 import java.awt.*;
24 import java.awt.event.*;
25 import javax.swing.*;
26
27 /**
28  * DOCUMENT ME!
29  * 
30  * @author $author$
31  * @version $Revision$
32  */
33 public class GUserDefinedColours extends JPanel
34 {
35   protected JColorChooser colorChooser = new JColorChooser();
36
37   protected JPanel buttonPanel = new JPanel();
38
39   protected GridLayout gridLayout = new GridLayout();
40
41   JPanel lowerPanel = new JPanel();
42
43   protected JButton okButton = new JButton();
44
45   protected JButton applyButton = new JButton();
46
47   protected JButton loadbutton = new JButton();
48
49   protected JButton savebutton = new JButton();
50
51   protected JButton cancelButton = new JButton();
52
53   JPanel namePanel = new JPanel();
54
55   JLabel jLabel1 = new JLabel();
56
57   protected JTextField schemeName = new JTextField();
58
59   BorderLayout borderLayout1 = new BorderLayout();
60
61   JPanel panel1 = new JPanel();
62
63   JPanel okCancelPanel = new JPanel();
64
65   JPanel saveLoadPanel = new JPanel();
66
67   BorderLayout borderLayout3 = new BorderLayout();
68
69   GridBagLayout gridBagLayout1 = new GridBagLayout();
70
71   BorderLayout borderLayout2 = new BorderLayout();
72
73   FlowLayout flowLayout1 = new FlowLayout();
74
75   BorderLayout borderLayout4 = new BorderLayout();
76
77   JPanel jPanel4 = new JPanel();
78
79   BorderLayout borderLayout5 = new BorderLayout();
80
81   JLabel label = new JLabel();
82
83   protected JPanel casePanel = new JPanel();
84
85   protected JCheckBox caseSensitive = new JCheckBox();
86
87   protected JButton lcaseColour = new JButton();
88
89   /**
90    * Creates a new GUserDefinedColours object.
91    */
92   public GUserDefinedColours()
93   {
94     try
95     {
96       jbInit();
97     } catch (Exception e)
98     {
99       e.printStackTrace();
100     }
101
102   }
103
104   /**
105    * DOCUMENT ME!
106    * 
107    * @throws Exception
108    *           DOCUMENT ME!
109    */
110   private void jbInit() throws Exception
111   {
112     this.setLayout(borderLayout4);
113     buttonPanel.setLayout(gridLayout);
114     gridLayout.setColumns(4);
115     gridLayout.setRows(5);
116     okButton.setFont(new java.awt.Font("Verdana", 0, 11));
117     okButton.setText(MessageManager.getString("action.ok"));
118     okButton.addActionListener(new java.awt.event.ActionListener()
119     {
120       public void actionPerformed(ActionEvent e)
121       {
122         okButton_actionPerformed(e);
123       }
124     });
125     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
126     applyButton.setText(MessageManager.getString("action.apply"));
127     applyButton.addActionListener(new java.awt.event.ActionListener()
128     {
129       public void actionPerformed(ActionEvent e)
130       {
131         applyButton_actionPerformed(e);
132       }
133     });
134     loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
135     loadbutton.setText(MessageManager.getString("action.load_scheme"));
136     loadbutton.addActionListener(new java.awt.event.ActionListener()
137     {
138       public void actionPerformed(ActionEvent e)
139       {
140         loadbutton_actionPerformed(e);
141       }
142     });
143     savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
144     savebutton.setText(MessageManager.getString("action.save_scheme"));
145     savebutton.addActionListener(new java.awt.event.ActionListener()
146     {
147       public void actionPerformed(ActionEvent e)
148       {
149         savebutton_actionPerformed(e);
150       }
151     });
152     cancelButton.setFont(JvSwingUtils.getLabelFont());
153     cancelButton.setText(MessageManager.getString("action.cancel"));
154     cancelButton.addActionListener(new java.awt.event.ActionListener()
155     {
156       public void actionPerformed(ActionEvent e)
157       {
158         cancelButton_actionPerformed(e);
159       }
160     });
161     this.setBackground(new Color(212, 208, 223));
162     lowerPanel.setOpaque(false);
163     lowerPanel.setLayout(borderLayout3);
164     colorChooser.setOpaque(false);
165     jLabel1.setFont(JvSwingUtils.getLabelFont());
166     jLabel1.setText(MessageManager.getString("label.name"));
167     namePanel.setMinimumSize(new Dimension(300, 31));
168     namePanel.setOpaque(false);
169     namePanel.setPreferredSize(new Dimension(240, 25));
170     namePanel.setLayout(borderLayout1);
171     schemeName.setFont(JvSwingUtils.getLabelFont());
172     schemeName.setPreferredSize(new Dimension(105, 21));
173     schemeName.setText("");
174     schemeName.setHorizontalAlignment(SwingConstants.CENTER);
175     panel1.setLayout(flowLayout1);
176     panel1.setOpaque(false);
177     okCancelPanel.setOpaque(false);
178     saveLoadPanel.setOpaque(false);
179     jPanel4.setLayout(borderLayout5);
180     label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
181     label.setOpaque(false);
182     label.setPreferredSize(new Dimension(260, 34));
183     label.setText(MessageManager.formatMessage("label.html_content", new String[]{MessageManager.getString("label.save_colour_scheme_with_unique_name_added_to_colour_menu")}));
184     caseSensitive.setText(MessageManager.getString("label.case_sensitive"));
185     caseSensitive.addActionListener(new ActionListener()
186     {
187       public void actionPerformed(ActionEvent e)
188       {
189         caseSensitive_actionPerformed(e);
190       }
191     });
192     lcaseColour.setText(MessageManager.getString("label.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 }