GPL license added
[jalview.git] / src / jalview / jbgui / GUserDefinedColours.java
1 /*\r
2 * Jalview - A Sequence Alignment Editor and Viewer\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4 *\r
5 * This program is free software; you can redistribute it and/or\r
6 * modify it under the terms of the GNU General Public License\r
7 * as published by the Free Software Foundation; either version 2\r
8 * of the License, or (at your option) any later version.\r
9 *\r
10 * This program is distributed in the hope that it will be useful,\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 * GNU General Public License for more details.\r
14 *\r
15 * You should have received a copy of the GNU General Public License\r
16 * along with this program; if not, write to the Free Software\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18 */\r
19 \r
20 package jalview.jbgui;\r
21 \r
22 import javax.swing.*;\r
23 import java.awt.*;\r
24 import java.awt.event.*;\r
25 \r
26 \r
27 public class GUserDefinedColours extends JPanel\r
28 {\r
29   protected JColorChooser colorChooser = new JColorChooser();\r
30   protected JPanel buttonPanel = new JPanel();\r
31   protected GridLayout gridLayout = new GridLayout();\r
32   JPanel jPanel2 = new JPanel();\r
33   protected JButton okButton = new JButton();\r
34   protected JButton applyButton = new JButton();\r
35   protected JButton loadbutton = new JButton();\r
36   protected JButton savebutton = new JButton();\r
37   protected JButton cancelButton = new JButton();\r
38   FlowLayout flowLayout1 = new FlowLayout();\r
39 \r
40   public GUserDefinedColours()\r
41   {\r
42     try\r
43     {\r
44       jbInit();\r
45     }\r
46     catch(Exception e)\r
47     {\r
48       e.printStackTrace();\r
49     }\r
50   }\r
51   private void jbInit() throws Exception\r
52   {\r
53     this.setLayout(flowLayout1);\r
54     buttonPanel.setLayout(gridLayout);\r
55     gridLayout.setColumns(6);\r
56     gridLayout.setRows(4);\r
57     okButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
58     okButton.setText("OK");\r
59     okButton.addActionListener(new java.awt.event.ActionListener()\r
60     {\r
61       public void actionPerformed(ActionEvent e)\r
62       {\r
63         okButton_actionPerformed(e);\r
64       }\r
65     });\r
66     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
67     applyButton.setText("Apply");\r
68     applyButton.addActionListener(new java.awt.event.ActionListener()\r
69     {\r
70       public void actionPerformed(ActionEvent e)\r
71       {\r
72         applyButton_actionPerformed(e);\r
73       }\r
74     });\r
75     loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));\r
76     loadbutton.setText("Load scheme");\r
77     loadbutton.addActionListener(new java.awt.event.ActionListener()\r
78     {\r
79       public void actionPerformed(ActionEvent e)\r
80       {\r
81         loadbutton_actionPerformed(e);\r
82       }\r
83     });\r
84     savebutton.setFont(new java.awt.Font("Verdana", 0, 11));\r
85     savebutton.setText("Save scheme");\r
86     savebutton.addActionListener(new java.awt.event.ActionListener()\r
87     {\r
88       public void actionPerformed(ActionEvent e)\r
89       {\r
90         savebutton_actionPerformed(e);\r
91       }\r
92     });\r
93     cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));\r
94     cancelButton.setText("Cancel");\r
95     cancelButton.addActionListener(new java.awt.event.ActionListener()\r
96     {\r
97       public void actionPerformed(ActionEvent e)\r
98       {\r
99         cancelButton_actionPerformed(e);\r
100       }\r
101     });\r
102     this.setBackground(new Color(212, 208, 223));\r
103     jPanel2.setOpaque(false);\r
104     colorChooser.setOpaque(false);\r
105     this.add(colorChooser, null);\r
106     this.add(buttonPanel, null);\r
107      this.add(jPanel2, null);\r
108     jPanel2.add(okButton, null);\r
109     jPanel2.add(applyButton, null);\r
110     jPanel2.add(loadbutton, null);\r
111     jPanel2.add(savebutton, null);\r
112     jPanel2.add(cancelButton, null);\r
113   }\r
114 \r
115 \r
116   protected void okButton_actionPerformed(ActionEvent e)\r
117   {\r
118 \r
119   }\r
120 \r
121   protected void applyButton_actionPerformed(ActionEvent e)\r
122   {\r
123 \r
124   }\r
125 \r
126   protected void loadbutton_actionPerformed(ActionEvent e)\r
127   {\r
128 \r
129   }\r
130 \r
131   protected void savebutton_actionPerformed(ActionEvent e)\r
132   {\r
133 \r
134   }\r
135 \r
136   protected void cancelButton_actionPerformed(ActionEvent e)\r
137   {\r
138 \r
139   }\r
140 }\r