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
27 public class GUserDefinedColours extends JPanel {
\r
28 protected JColorChooser colorChooser = new JColorChooser();
\r
29 protected JPanel buttonPanel = new JPanel();
\r
30 protected GridLayout gridLayout = new GridLayout();
\r
31 JPanel jPanel2 = new JPanel();
\r
32 protected JButton okButton = new JButton();
\r
33 protected JButton applyButton = new JButton();
\r
34 protected JButton loadbutton = new JButton();
\r
35 protected JButton savebutton = new JButton();
\r
36 protected JButton cancelButton = new JButton();
\r
37 FlowLayout flowLayout1 = new FlowLayout();
\r
39 public GUserDefinedColours() {
\r
42 } catch (Exception e) {
\r
43 e.printStackTrace();
\r
47 private void jbInit() throws Exception {
\r
48 this.setLayout(flowLayout1);
\r
49 buttonPanel.setLayout(gridLayout);
\r
50 gridLayout.setColumns(6);
\r
51 gridLayout.setRows(4);
\r
52 okButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
53 okButton.setText("OK");
\r
54 okButton.addActionListener(new java.awt.event.ActionListener() {
\r
55 public void actionPerformed(ActionEvent e) {
\r
56 okButton_actionPerformed(e);
\r
59 applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
60 applyButton.setText("Apply");
\r
61 applyButton.addActionListener(new java.awt.event.ActionListener() {
\r
62 public void actionPerformed(ActionEvent e) {
\r
63 applyButton_actionPerformed(e);
\r
66 loadbutton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
67 loadbutton.setText("Load scheme");
\r
68 loadbutton.addActionListener(new java.awt.event.ActionListener() {
\r
69 public void actionPerformed(ActionEvent e) {
\r
70 loadbutton_actionPerformed(e);
\r
73 savebutton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
74 savebutton.setText("Save scheme");
\r
75 savebutton.addActionListener(new java.awt.event.ActionListener() {
\r
76 public void actionPerformed(ActionEvent e) {
\r
77 savebutton_actionPerformed(e);
\r
80 cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));
\r
81 cancelButton.setText("Cancel");
\r
82 cancelButton.addActionListener(new java.awt.event.ActionListener() {
\r
83 public void actionPerformed(ActionEvent e) {
\r
84 cancelButton_actionPerformed(e);
\r
87 this.setBackground(new Color(212, 208, 223));
\r
88 jPanel2.setOpaque(false);
\r
89 colorChooser.setOpaque(false);
\r
90 this.add(colorChooser, null);
\r
91 this.add(buttonPanel, null);
\r
92 this.add(jPanel2, null);
\r
93 jPanel2.add(okButton, null);
\r
94 jPanel2.add(applyButton, null);
\r
95 jPanel2.add(loadbutton, null);
\r
96 jPanel2.add(savebutton, null);
\r
97 jPanel2.add(cancelButton, null);
\r
100 protected void okButton_actionPerformed(ActionEvent e) {
\r
103 protected void applyButton_actionPerformed(ActionEvent e) {
\r
106 protected void loadbutton_actionPerformed(ActionEvent e) {
\r
109 protected void savebutton_actionPerformed(ActionEvent e) {
\r
112 protected void cancelButton_actionPerformed(ActionEvent e) {
\r