2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\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
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
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
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
24 import javax.swing.*;
\r
31 * @version $Revision$
\r
33 public class GUserDefinedColours extends JPanel
\r
35 protected JColorChooser colorChooser = new JColorChooser();
\r
36 protected JPanel buttonPanel = new JPanel();
\r
37 protected GridLayout gridLayout = new GridLayout();
\r
38 JPanel jPanel2 = new JPanel();
\r
39 protected JButton okButton = new JButton();
\r
40 protected JButton applyButton = new JButton();
\r
41 protected JButton loadbutton = new JButton();
\r
42 protected JButton savebutton = new JButton();
\r
43 protected JButton cancelButton = new JButton();
\r
44 JPanel namePanel = new JPanel();
\r
45 JLabel jLabel1 = new JLabel();
\r
46 protected JTextField schemeName = new JTextField();
\r
47 BorderLayout borderLayout1 = new BorderLayout();
\r
48 JPanel panel1 = new JPanel();
\r
49 JPanel jPanel1 = new JPanel();
\r
50 JPanel jPanel3 = new JPanel();
\r
51 BorderLayout borderLayout3 = new BorderLayout();
\r
52 GridBagLayout gridBagLayout1 = new GridBagLayout();
\r
53 BorderLayout borderLayout2 = new BorderLayout();
\r
54 FlowLayout flowLayout1 = new FlowLayout();
\r
55 BorderLayout borderLayout4 = new BorderLayout();
\r
56 JPanel jPanel4 = new JPanel();
\r
57 BorderLayout borderLayout5 = new BorderLayout();
\r
58 JPanel jPanel6 = new JPanel();
\r
59 JTextArea jTextArea1 = new JTextArea();
\r
61 * Creates a new GUserDefinedColours object.
\r
63 public GUserDefinedColours()
\r
71 e.printStackTrace();
\r
78 * @throws Exception DOCUMENT ME!
\r
80 private void jbInit() throws Exception
\r
82 this.setLayout(borderLayout4);
\r
83 buttonPanel.setLayout(gridLayout);
\r
84 gridLayout.setColumns(4);
\r
85 gridLayout.setRows(6);
\r
86 okButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
87 okButton.setText("OK");
\r
88 okButton.addActionListener(new java.awt.event.ActionListener()
\r
90 public void actionPerformed(ActionEvent e)
\r
92 okButton_actionPerformed(e);
\r
95 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
96 applyButton.setText("Apply");
\r
97 applyButton.addActionListener(new java.awt.event.ActionListener()
\r
99 public void actionPerformed(ActionEvent e)
\r
101 applyButton_actionPerformed(e);
\r
104 loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
105 loadbutton.setText("Load scheme");
\r
106 loadbutton.addActionListener(new java.awt.event.ActionListener()
\r
108 public void actionPerformed(ActionEvent e)
\r
110 loadbutton_actionPerformed(e);
\r
113 savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
114 savebutton.setText("Save scheme");
\r
115 savebutton.addActionListener(new java.awt.event.ActionListener()
\r
117 public void actionPerformed(ActionEvent e)
\r
119 savebutton_actionPerformed(e);
\r
122 cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
123 cancelButton.setText("Cancel");
\r
124 cancelButton.addActionListener(new java.awt.event.ActionListener()
\r
126 public void actionPerformed(ActionEvent e)
\r
128 cancelButton_actionPerformed(e);
\r
131 this.setBackground(new Color(212, 208, 223));
\r
132 jPanel2.setOpaque(false);
\r
133 jPanel2.setLayout(borderLayout3);
\r
134 colorChooser.setOpaque(false);
\r
135 jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
136 jLabel1.setText("Name");
\r
137 namePanel.setMinimumSize(new Dimension(300, 31));
\r
138 namePanel.setOpaque(false);
\r
139 namePanel.setPreferredSize(new Dimension(240, 25));
\r
140 namePanel.setToolTipText("");
\r
141 namePanel.setLayout(borderLayout1);
\r
142 schemeName.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
143 schemeName.setPreferredSize(new Dimension(105, 21));
\r
144 schemeName.setText("");
\r
145 schemeName.setHorizontalAlignment(SwingConstants.CENTER);
\r
146 panel1.setLayout(flowLayout1);
\r
147 panel1.setOpaque(false);
\r
148 jPanel1.setOpaque(false);
\r
149 jPanel3.setOpaque(false);
\r
150 jPanel4.setLayout(borderLayout5);
\r
151 jPanel6.setBackground(Color.pink);
\r
152 jPanel6.setMinimumSize(new Dimension(10, 70));
\r
153 jPanel6.setOpaque(false);
\r
154 jPanel6.setPreferredSize(new Dimension(10, 45));
\r
155 jPanel6.setLayout(null);
\r
156 jTextArea1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
\r
157 jTextArea1.setOpaque(false);
\r
158 jTextArea1.setPreferredSize(new Dimension(260, 34));
\r
159 jTextArea1.setText(
\r
160 "Save your colour scheme with a unique name and it will be added " +
\r
161 "to the Colour menu.");
\r
162 jTextArea1.setLineWrap(true);
\r
163 jTextArea1.setRows(2);
\r
164 jTextArea1.setWrapStyleWord(true);
\r
165 jPanel3.add(savebutton);
\r
166 jPanel3.add(loadbutton);
\r
167 jPanel1.add(applyButton);
\r
168 jPanel1.add(okButton);
\r
169 jPanel1.add(cancelButton);
\r
170 jPanel2.add(jPanel3, java.awt.BorderLayout.NORTH);
\r
171 jPanel2.add(jPanel1, java.awt.BorderLayout.SOUTH);
\r
173 namePanel.add(schemeName, java.awt.BorderLayout.CENTER);
\r
174 namePanel.add(jLabel1, java.awt.BorderLayout.WEST);
\r
175 panel1.add(namePanel, null);
\r
176 panel1.add(buttonPanel, null);
\r
177 panel1.add(jPanel2, null);
\r
178 panel1.add(jTextArea1);
\r
180 jPanel4.add(panel1, java.awt.BorderLayout.CENTER);
\r
181 jPanel4.add(jPanel6, java.awt.BorderLayout.NORTH);
\r
182 this.add(jPanel4, java.awt.BorderLayout.CENTER);
\r
183 this.add(colorChooser, java.awt.BorderLayout.EAST);
\r
189 * @param e DOCUMENT ME!
\r
191 protected void okButton_actionPerformed(ActionEvent e)
\r
198 * @param e DOCUMENT ME!
\r
200 protected void applyButton_actionPerformed(ActionEvent e)
\r
207 * @param e DOCUMENT ME!
\r
209 protected void loadbutton_actionPerformed(ActionEvent e)
\r
216 * @param e DOCUMENT ME!
\r
218 protected void savebutton_actionPerformed(ActionEvent e)
\r
225 * @param e DOCUMENT ME!
\r
227 protected void cancelButton_actionPerformed(ActionEvent e)
\r