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 FlowLayout flowLayout1 = new FlowLayout();
\r
47 * Creates a new GUserDefinedColours object.
\r
49 public GUserDefinedColours()
\r
57 e.printStackTrace();
\r
64 * @throws Exception DOCUMENT ME!
\r
66 private void jbInit() throws Exception
\r
68 this.setLayout(flowLayout1);
\r
69 buttonPanel.setLayout(gridLayout);
\r
70 gridLayout.setColumns(6);
\r
71 gridLayout.setRows(4);
\r
72 okButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
73 okButton.setText("OK");
\r
74 okButton.addActionListener(new java.awt.event.ActionListener()
\r
76 public void actionPerformed(ActionEvent e)
\r
78 okButton_actionPerformed(e);
\r
81 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
82 applyButton.setText("Apply");
\r
83 applyButton.addActionListener(new java.awt.event.ActionListener()
\r
85 public void actionPerformed(ActionEvent e)
\r
87 applyButton_actionPerformed(e);
\r
90 loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
91 loadbutton.setText("Load scheme");
\r
92 loadbutton.addActionListener(new java.awt.event.ActionListener()
\r
94 public void actionPerformed(ActionEvent e)
\r
96 loadbutton_actionPerformed(e);
\r
99 savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
100 savebutton.setText("Save scheme");
\r
101 savebutton.addActionListener(new java.awt.event.ActionListener()
\r
103 public void actionPerformed(ActionEvent e)
\r
105 savebutton_actionPerformed(e);
\r
108 cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
109 cancelButton.setText("Cancel");
\r
110 cancelButton.addActionListener(new java.awt.event.ActionListener()
\r
112 public void actionPerformed(ActionEvent e)
\r
114 cancelButton_actionPerformed(e);
\r
117 this.setBackground(new Color(212, 208, 223));
\r
118 jPanel2.setOpaque(false);
\r
119 colorChooser.setOpaque(false);
\r
120 this.add(colorChooser, null);
\r
121 this.add(buttonPanel, null);
\r
122 this.add(jPanel2, null);
\r
123 jPanel2.add(okButton, null);
\r
124 jPanel2.add(applyButton, null);
\r
125 jPanel2.add(loadbutton, null);
\r
126 jPanel2.add(savebutton, null);
\r
127 jPanel2.add(cancelButton, null);
\r
133 * @param e DOCUMENT ME!
\r
135 protected void okButton_actionPerformed(ActionEvent e)
\r
142 * @param e DOCUMENT ME!
\r
144 protected void applyButton_actionPerformed(ActionEvent e)
\r
151 * @param e DOCUMENT ME!
\r
153 protected void loadbutton_actionPerformed(ActionEvent e)
\r
160 * @param e DOCUMENT ME!
\r
162 protected void savebutton_actionPerformed(ActionEvent e)
\r
169 * @param e DOCUMENT ME!
\r
171 protected void cancelButton_actionPerformed(ActionEvent e)
\r