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
20 package jalview.jbgui;
\r
22 import javax.swing.*;
\r
24 import java.awt.event.*;
\r
27 public class GUserDefinedColours extends JPanel
\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
40 public GUserDefinedColours()
\r
48 e.printStackTrace();
\r
51 private void jbInit() throws Exception
\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
61 public void actionPerformed(ActionEvent e)
\r
63 okButton_actionPerformed(e);
\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
70 public void actionPerformed(ActionEvent e)
\r
72 applyButton_actionPerformed(e);
\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
79 public void actionPerformed(ActionEvent e)
\r
81 loadbutton_actionPerformed(e);
\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
88 public void actionPerformed(ActionEvent e)
\r
90 savebutton_actionPerformed(e);
\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
97 public void actionPerformed(ActionEvent e)
\r
99 cancelButton_actionPerformed(e);
\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
116 protected void okButton_actionPerformed(ActionEvent e)
\r
121 protected void applyButton_actionPerformed(ActionEvent e)
\r
126 protected void loadbutton_actionPerformed(ActionEvent e)
\r
131 protected void savebutton_actionPerformed(ActionEvent e)
\r
136 protected void cancelButton_actionPerformed(ActionEvent e)
\r