updated to jalview 2.1 and begun ArchiveClient/VamsasClient/VamsasStore updates.
[jalview.git] / src / jalview / jbgui / GUserDefinedColours.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 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
24 import javax.swing.*;
25 import java.awt.Dimension;
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     protected JPanel buttonPanel = new JPanel();
37     protected GridLayout gridLayout = new GridLayout();
38     JPanel lowerPanel = new JPanel();
39     protected JButton okButton = new JButton();
40     protected JButton applyButton = new JButton();
41     protected JButton loadbutton = new JButton();
42     protected JButton savebutton = new JButton();
43     protected JButton cancelButton = new JButton();
44   JPanel namePanel = new JPanel();
45   JLabel jLabel1 = new JLabel();
46   protected JTextField schemeName = new JTextField();
47   BorderLayout borderLayout1 = new BorderLayout();
48   JPanel panel1 = new JPanel();
49   JPanel okCancelPanel = new JPanel();
50   JPanel saveLoadPanel = new JPanel();
51   BorderLayout borderLayout3 = new BorderLayout();
52   GridBagLayout gridBagLayout1 = new GridBagLayout();
53   BorderLayout borderLayout2 = new BorderLayout();
54   FlowLayout flowLayout1 = new FlowLayout();
55   BorderLayout borderLayout4 = new BorderLayout();
56   JPanel jPanel4 = new JPanel();
57   BorderLayout borderLayout5 = new BorderLayout();
58   JLabel label = new JLabel();
59   JPanel casePanel = new JPanel();
60   protected JCheckBox caseSensitive = new JCheckBox();
61   protected JButton lcaseColour = new JButton();
62   /**
63      * Creates a new GUserDefinedColours object.
64      */
65     public GUserDefinedColours()
66     {
67         try
68         {
69             jbInit();
70         }
71         catch (Exception e)
72         {
73             e.printStackTrace();
74         }
75     }
76
77     /**
78      * DOCUMENT ME!
79      *
80      * @throws Exception DOCUMENT ME!
81      */
82     private void jbInit() throws Exception
83     {
84         this.setLayout(borderLayout4);
85         buttonPanel.setLayout(gridLayout);
86         gridLayout.setColumns(4);
87         gridLayout.setRows(5);
88         okButton.setFont(new java.awt.Font("Verdana", 0, 11));
89         okButton.setText("OK");
90         okButton.addActionListener(new java.awt.event.ActionListener()
91             {
92                 public void actionPerformed(ActionEvent e)
93                 {
94                     okButton_actionPerformed(e);
95                 }
96             });
97         applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
98         applyButton.setText("Apply");
99         applyButton.addActionListener(new java.awt.event.ActionListener()
100             {
101                 public void actionPerformed(ActionEvent e)
102                 {
103                     applyButton_actionPerformed(e);
104                 }
105             });
106         loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
107         loadbutton.setText("Load scheme");
108         loadbutton.addActionListener(new java.awt.event.ActionListener()
109             {
110                 public void actionPerformed(ActionEvent e)
111                 {
112                     loadbutton_actionPerformed(e);
113                 }
114             });
115         savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
116         savebutton.setText("Save scheme");
117         savebutton.addActionListener(new java.awt.event.ActionListener()
118             {
119                 public void actionPerformed(ActionEvent e)
120                 {
121                     savebutton_actionPerformed(e);
122                 }
123             });
124         cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));
125         cancelButton.setText("Cancel");
126         cancelButton.addActionListener(new java.awt.event.ActionListener()
127             {
128                 public void actionPerformed(ActionEvent e)
129                 {
130                     cancelButton_actionPerformed(e);
131                 }
132             });
133         this.setBackground(new Color(212, 208, 223));
134     lowerPanel.setOpaque(false);
135     lowerPanel.setLayout(borderLayout3);
136     colorChooser.setOpaque(false);
137     jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
138     jLabel1.setText("Name");
139     namePanel.setMinimumSize(new Dimension(300, 31));
140     namePanel.setOpaque(false);
141     namePanel.setPreferredSize(new Dimension(240, 25));
142     namePanel.setToolTipText("");
143     namePanel.setLayout(borderLayout1);
144     schemeName.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
145     schemeName.setPreferredSize(new Dimension(105, 21));
146     schemeName.setText("");
147     schemeName.setHorizontalAlignment(SwingConstants.CENTER);
148     panel1.setLayout(flowLayout1);
149     panel1.setOpaque(false);
150     okCancelPanel.setOpaque(false);
151     saveLoadPanel.setOpaque(false);
152     jPanel4.setLayout(borderLayout5);
153     label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
154     label.setOpaque(false);
155     label.setPreferredSize(new Dimension(260, 34));
156     label.setText(
157         "<html>Save your colour scheme with a unique name and it will be added " +
158         "to the Colour menu.</html>");
159     caseSensitive.setText("Case Sensitive");
160     caseSensitive.addActionListener(new ActionListener()
161     {
162       public void actionPerformed(ActionEvent e)
163       {
164         caseSensitive_actionPerformed(e);
165       }
166     });
167     lcaseColour.setText("Lower Case Colour");
168     lcaseColour.addActionListener(new ActionListener()
169     {
170       public void actionPerformed(ActionEvent e)
171       {
172         lcaseColour_actionPerformed(e);
173       }
174     });
175
176     saveLoadPanel.add(savebutton);
177     saveLoadPanel.add(loadbutton);
178     okCancelPanel.add(applyButton);
179     okCancelPanel.add(okButton);
180     okCancelPanel.add(cancelButton);
181     lowerPanel.add(saveLoadPanel, java.awt.BorderLayout.NORTH);
182     lowerPanel.add(okCancelPanel, java.awt.BorderLayout.SOUTH);
183
184     namePanel.add(schemeName, java.awt.BorderLayout.CENTER);
185     namePanel.add(jLabel1, java.awt.BorderLayout.WEST);
186     panel1.add(namePanel, null);
187     panel1.add(buttonPanel, null);
188     panel1.add(casePanel);
189     casePanel.add(caseSensitive);
190     casePanel.add(lcaseColour);
191     panel1.add(lowerPanel, null);
192     panel1.add(label);
193
194     jPanel4.add(panel1, java.awt.BorderLayout.CENTER);
195     this.add(jPanel4, java.awt.BorderLayout.CENTER);
196     this.add(colorChooser, java.awt.BorderLayout.EAST);
197   }
198
199     /**
200      * DOCUMENT ME!
201      *
202      * @param e DOCUMENT ME!
203      */
204     protected void okButton_actionPerformed(ActionEvent e)
205     {
206     }
207
208     /**
209      * DOCUMENT ME!
210      *
211      * @param e DOCUMENT ME!
212      */
213     protected void applyButton_actionPerformed(ActionEvent e)
214     {
215     }
216
217     /**
218      * DOCUMENT ME!
219      *
220      * @param e DOCUMENT ME!
221      */
222     protected void loadbutton_actionPerformed(ActionEvent e)
223     {
224     }
225
226     /**
227      * DOCUMENT ME!
228      *
229      * @param e DOCUMENT ME!
230      */
231     protected void savebutton_actionPerformed(ActionEvent e)
232     {
233     }
234
235     /**
236      * DOCUMENT ME!
237      *
238      * @param e DOCUMENT ME!
239      */
240     protected void cancelButton_actionPerformed(ActionEvent e)
241     {
242     }
243
244     public void caseSensitive_actionPerformed(ActionEvent e)
245     {
246
247     }
248
249     public void lcaseColour_actionPerformed(ActionEvent e)
250     {
251
252     }
253 }