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