1cc1f117956b31fada4877dd3915b047867f4cbc
[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(
187             "label.html_content",
188             new String[]
189             { MessageManager
190                     .getString("label.save_colour_scheme_with_unique_name_added_to_colour_menu") }));
191     caseSensitive.setText(MessageManager.getString("label.case_sensitive"));
192     caseSensitive.addActionListener(new ActionListener()
193     {
194       public void actionPerformed(ActionEvent e)
195       {
196         caseSensitive_actionPerformed(e);
197       }
198     });
199     lcaseColour
200             .setText(MessageManager.getString("label.lower_case_colour"));
201     lcaseColour.addActionListener(new ActionListener()
202     {
203       public void actionPerformed(ActionEvent e)
204       {
205         lcaseColour_actionPerformed(e);
206       }
207     });
208
209     saveLoadPanel.add(savebutton);
210     saveLoadPanel.add(loadbutton);
211     okCancelPanel.add(applyButton);
212     okCancelPanel.add(okButton);
213     okCancelPanel.add(cancelButton);
214     lowerPanel.add(saveLoadPanel, java.awt.BorderLayout.NORTH);
215     lowerPanel.add(okCancelPanel, java.awt.BorderLayout.SOUTH);
216
217     namePanel.add(schemeName, java.awt.BorderLayout.CENTER);
218     namePanel.add(jLabel1, java.awt.BorderLayout.WEST);
219     panel1.add(namePanel, null);
220     panel1.add(buttonPanel, null);
221     panel1.add(casePanel);
222     casePanel.add(caseSensitive);
223     casePanel.add(lcaseColour);
224     panel1.add(lowerPanel, null);
225     panel1.add(label);
226
227     jPanel4.add(panel1, java.awt.BorderLayout.CENTER);
228     this.add(jPanel4, java.awt.BorderLayout.CENTER);
229     this.add(colorChooser, java.awt.BorderLayout.EAST);
230   }
231
232   /**
233    * DOCUMENT ME!
234    * 
235    * @param e
236    *          DOCUMENT ME!
237    */
238   protected void okButton_actionPerformed(ActionEvent e)
239   {
240   }
241
242   /**
243    * DOCUMENT ME!
244    * 
245    * @param e
246    *          DOCUMENT ME!
247    */
248   protected void applyButton_actionPerformed(ActionEvent e)
249   {
250   }
251
252   /**
253    * DOCUMENT ME!
254    * 
255    * @param e
256    *          DOCUMENT ME!
257    */
258   protected void loadbutton_actionPerformed(ActionEvent e)
259   {
260   }
261
262   /**
263    * DOCUMENT ME!
264    * 
265    * @param e
266    *          DOCUMENT ME!
267    */
268   protected void savebutton_actionPerformed(ActionEvent e)
269   {
270   }
271
272   /**
273    * DOCUMENT ME!
274    * 
275    * @param e
276    *          DOCUMENT ME!
277    */
278   protected void cancelButton_actionPerformed(ActionEvent e)
279   {
280   }
281
282   public void caseSensitive_actionPerformed(ActionEvent e)
283   {
284
285   }
286
287   public void lcaseColour_actionPerformed(ActionEvent e)
288   {
289
290   }
291 }