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.ActionListener;
\r
25 import java.awt.event.ActionEvent;
\r
26 import javax.swing.border.TitledBorder;
\r
27 import java.awt.event.MouseAdapter;
\r
28 import java.awt.event.MouseEvent;
\r
30 public class GPreferences
\r
33 public GPreferences()
\r
39 catch (Exception ex)
\r
41 ex.printStackTrace();
\r
45 private void jbInit()
\r
48 this.setLayout(borderLayout1);
\r
50 ok.addActionListener(new ActionListener()
\r
52 public void actionPerformed(ActionEvent e)
\r
54 ok_actionPerformed(e);
\r
57 cancel.setText("Cancel");
\r
58 cancel.addActionListener(new ActionListener()
\r
60 public void actionPerformed(ActionEvent e)
\r
62 cancel_actionPerformed(e);
\r
65 visual.setLayout(null);
\r
66 quality.setEnabled(false);
\r
67 quality.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
68 quality.setHorizontalAlignment(SwingConstants.RIGHT);
\r
69 quality.setHorizontalTextPosition(SwingConstants.LEFT);
\r
70 quality.setSelected(true);
\r
71 quality.setText("Quality");
\r
72 quality.setBounds(new Rectangle(248, 53, 81, 23));
\r
73 jPanel2.setBorder(titledBorder1);
\r
74 jPanel2.setBounds(new Rectangle(9, 20, 442, 241));
\r
75 jPanel2.setLayout(null);
\r
76 fullID.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
77 fullID.setHorizontalAlignment(SwingConstants.RIGHT);
\r
78 fullID.setHorizontalTextPosition(SwingConstants.LEFT);
\r
79 fullID.setText("Full Sequence ID");
\r
80 fullID.setBounds(new Rectangle(9, 78, 129, 23));
\r
81 fullScreen.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
82 fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
\r
83 fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
\r
84 fullScreen.setText("Maximise Window");
\r
85 fullScreen.setBounds(new Rectangle(5, 29, 132, 23));
\r
86 conservation.setEnabled(false);
\r
87 conservation.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
88 conservation.setHorizontalAlignment(SwingConstants.RIGHT);
\r
89 conservation.setHorizontalTextPosition(SwingConstants.LEFT);
\r
90 conservation.setSelected(true);
\r
91 conservation.setText("Conservation");
\r
92 conservation.setBounds(new Rectangle(137, 53, 113, 23));
\r
93 identity.setEnabled(false);
\r
94 identity.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
95 identity.setHorizontalAlignment(SwingConstants.RIGHT);
\r
96 identity.setHorizontalTextPosition(SwingConstants.LEFT);
\r
97 identity.setSelected(true);
\r
98 identity.setText("Consensus");
\r
99 identity.setBounds(new Rectangle(326, 53, 99, 23));
\r
100 annotations.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
101 annotations.setHorizontalAlignment(SwingConstants.RIGHT);
\r
102 annotations.setHorizontalTextPosition(SwingConstants.LEFT);
\r
103 annotations.setSelected(true);
\r
104 annotations.setText("Show Annotations");
\r
105 annotations.setBounds(new Rectangle(10, 53, 128, 23));
\r
106 annotations.addActionListener(new ActionListener()
\r
108 public void actionPerformed(ActionEvent e)
\r
110 annotations_actionPerformed(e);
\r
113 jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
114 jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
\r
115 jLabel1.setText("Gap Symbol");
\r
116 jLabel1.setBounds(new Rectangle(41, 142, 76, 15));
\r
117 colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
118 colour.setBounds(new Rectangle(121, 168, 154, 21));
\r
119 jLabel2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
120 jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
\r
121 jLabel2.setText("Colour");
\r
122 jLabel2.setBounds(new Rectangle(60, 172, 58, 15));
\r
123 jLabel3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
124 jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
\r
125 jLabel3.setText("Font");
\r
126 jLabel3.setBounds(new Rectangle(83, 114, 34, 15));
\r
127 fontSizeCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
128 fontSizeCB.setBounds(new Rectangle(304, 109, 49, 21));
\r
129 fontStyleCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
130 fontStyleCB.setBounds(new Rectangle(353, 109, 80, 21));
\r
131 fontNameCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
132 fontNameCB.setBounds(new Rectangle(121, 109, 183, 21));
\r
133 gapSymbolCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
134 gapSymbolCB.setBounds(new Rectangle(121, 140, 67, 21));
\r
135 startupCheckbox.setText("Open file");
\r
136 startupCheckbox.setBounds(new Rectangle(4, 200, 115, 23));
\r
137 startupCheckbox.addActionListener(new ActionListener()
\r
139 public void actionPerformed(ActionEvent e)
\r
141 jCheckBox1_actionPerformed(e);
\r
144 startupCheckbox.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
145 startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
\r
146 startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
\r
147 startupCheckbox.setSelected(true);
\r
148 startupFileTextfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
149 startupFileTextfield.setBounds(new Rectangle(122, 202, 309, 20));
\r
150 startupFileTextfield.addMouseListener(new MouseAdapter()
\r
152 public void mouseClicked(MouseEvent e)
\r
154 startupFileTextfield_mouseClicked();
\r
158 jPanel2.add(annotations);
\r
159 jPanel2.add(conservation);
\r
160 jPanel2.add(quality);
\r
161 jPanel2.add(fullID);
\r
162 jPanel2.add(gapSymbolCB);
\r
163 jPanel2.add(jLabel1);
\r
164 jPanel2.add(fontNameCB);
\r
165 jPanel2.add(jLabel2);
\r
166 jPanel2.add(jLabel3);
\r
167 jPanel2.add(colour);
\r
168 jPanel2.add(fontSizeCB);
\r
169 jPanel2.add(fontStyleCB);
\r
170 jPanel2.add(identity);
\r
171 jPanel2.add(fullScreen);
\r
172 jPanel2.add(startupCheckbox);
\r
173 jPanel2.add(startupFileTextfield);
\r
175 jPanel1.add(cancel);
\r
176 this.add(visaulTab, java.awt.BorderLayout.CENTER);
\r
177 visaulTab.add(visual, "visual");
\r
178 visual.add(jPanel2);
\r
179 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
\r
180 DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
\r
181 dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
\r
182 gapSymbolCB.setRenderer(dlcr);
\r
186 JTabbedPane visaulTab = new JTabbedPane();
\r
187 JPanel visual = new JPanel();
\r
188 JButton ok = new JButton();
\r
189 JButton cancel = new JButton();
\r
190 JPanel jPanel1 = new JPanel();
\r
191 BorderLayout borderLayout1 = new BorderLayout();
\r
192 protected JCheckBox quality = new JCheckBox();
\r
193 JPanel jPanel2 = new JPanel();
\r
194 TitledBorder titledBorder1 = new TitledBorder("Open new alignment");
\r
195 protected JCheckBox fullID = new JCheckBox();
\r
196 protected JCheckBox fullScreen = new JCheckBox();
\r
197 protected JCheckBox conservation = new JCheckBox();
\r
198 protected JCheckBox identity = new JCheckBox();
\r
199 protected JCheckBox annotations = new JCheckBox();
\r
200 JLabel jLabel1 = new JLabel();
\r
201 protected JComboBox colour = new JComboBox();
\r
202 JLabel jLabel2 = new JLabel();
\r
203 JLabel jLabel3 = new JLabel();
\r
204 protected JComboBox fontSizeCB = new JComboBox();
\r
205 protected JComboBox fontStyleCB = new JComboBox();
\r
206 protected JComboBox fontNameCB = new JComboBox();
\r
207 protected JComboBox gapSymbolCB = new JComboBox();
\r
208 protected JCheckBox startupCheckbox = new JCheckBox();
\r
209 protected JTextField startupFileTextfield = new JTextField();
\r
210 public void ok_actionPerformed(ActionEvent e)
\r
215 public void cancel_actionPerformed(ActionEvent e)
\r
220 public void annotations_actionPerformed(ActionEvent e)
\r
225 public void jCheckBox1_actionPerformed(ActionEvent e)
\r
231 public void startupFileTextfield_mouseClicked()
\r