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.ActionEvent;
\r
23 import java.awt.event.ActionListener;
\r
24 import java.awt.event.MouseAdapter;
\r
25 import java.awt.event.MouseEvent;
\r
27 import javax.swing.*;
\r
28 import javax.swing.border.TitledBorder;
\r
35 * @version $Revision$
\r
37 public class GPreferences extends JPanel
\r
39 JTabbedPane visaulTab = new JTabbedPane();
\r
40 JPanel visual = new JPanel();
\r
41 JButton ok = new JButton();
\r
42 JButton cancel = new JButton();
\r
43 JPanel jPanel1 = new JPanel();
\r
44 BorderLayout borderLayout1 = new BorderLayout();
\r
45 protected JCheckBox quality = new JCheckBox();
\r
46 JPanel jPanel2 = new JPanel();
\r
47 TitledBorder titledBorder1 = new TitledBorder("Open new alignment");
\r
48 protected JCheckBox fullID = new JCheckBox();
\r
49 protected JCheckBox fullScreen = new JCheckBox();
\r
50 protected JCheckBox conservation = new JCheckBox();
\r
51 protected JCheckBox identity = new JCheckBox();
\r
52 protected JCheckBox annotations = new JCheckBox();
\r
53 JLabel jLabel1 = new JLabel();
\r
54 protected JComboBox colour = new JComboBox();
\r
55 JLabel jLabel2 = new JLabel();
\r
56 JLabel jLabel3 = new JLabel();
\r
57 protected JComboBox fontSizeCB = new JComboBox();
\r
58 protected JComboBox fontStyleCB = new JComboBox();
\r
59 protected JComboBox fontNameCB = new JComboBox();
\r
60 protected JComboBox gapSymbolCB = new JComboBox();
\r
61 protected JCheckBox startupCheckbox = new JCheckBox();
\r
62 protected JTextField startupFileTextfield = new JTextField();
\r
65 * Creates a new GPreferences object.
\r
67 public GPreferences()
\r
73 catch (Exception ex)
\r
75 ex.printStackTrace();
\r
82 * @throws Exception DOCUMENT ME!
\r
84 private void jbInit() throws Exception
\r
86 this.setLayout(borderLayout1);
\r
88 ok.addActionListener(new ActionListener()
\r
90 public void actionPerformed(ActionEvent e)
\r
92 ok_actionPerformed(e);
\r
95 cancel.setText("Cancel");
\r
96 cancel.addActionListener(new ActionListener()
\r
98 public void actionPerformed(ActionEvent e)
\r
100 cancel_actionPerformed(e);
\r
103 visual.setLayout(null);
\r
104 quality.setEnabled(false);
\r
105 quality.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
106 quality.setHorizontalAlignment(SwingConstants.RIGHT);
\r
107 quality.setHorizontalTextPosition(SwingConstants.LEFT);
\r
108 quality.setSelected(true);
\r
109 quality.setText("Quality");
\r
110 quality.setBounds(new Rectangle(248, 53, 81, 23));
\r
111 jPanel2.setBorder(titledBorder1);
\r
112 jPanel2.setBounds(new Rectangle(9, 20, 442, 241));
\r
113 jPanel2.setLayout(null);
\r
114 fullID.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
115 fullID.setHorizontalAlignment(SwingConstants.RIGHT);
\r
116 fullID.setHorizontalTextPosition(SwingConstants.LEFT);
\r
117 fullID.setText("Full Sequence ID");
\r
118 fullID.setBounds(new Rectangle(9, 78, 129, 23));
\r
119 fullScreen.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
120 fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
\r
121 fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
\r
122 fullScreen.setText("Maximise Window");
\r
123 fullScreen.setBounds(new Rectangle(5, 29, 132, 23));
\r
124 conservation.setEnabled(false);
\r
125 conservation.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
126 conservation.setHorizontalAlignment(SwingConstants.RIGHT);
\r
127 conservation.setHorizontalTextPosition(SwingConstants.LEFT);
\r
128 conservation.setSelected(true);
\r
129 conservation.setText("Conservation");
\r
130 conservation.setBounds(new Rectangle(137, 53, 113, 23));
\r
131 identity.setEnabled(false);
\r
132 identity.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
133 identity.setHorizontalAlignment(SwingConstants.RIGHT);
\r
134 identity.setHorizontalTextPosition(SwingConstants.LEFT);
\r
135 identity.setSelected(true);
\r
136 identity.setText("Consensus");
\r
137 identity.setBounds(new Rectangle(326, 53, 99, 23));
\r
138 annotations.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
139 annotations.setHorizontalAlignment(SwingConstants.RIGHT);
\r
140 annotations.setHorizontalTextPosition(SwingConstants.LEFT);
\r
141 annotations.setSelected(true);
\r
142 annotations.setText("Show Annotations");
\r
143 annotations.setBounds(new Rectangle(10, 53, 128, 23));
\r
144 annotations.addActionListener(new ActionListener()
\r
146 public void actionPerformed(ActionEvent e)
\r
148 annotations_actionPerformed(e);
\r
151 jLabel1.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
152 jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
\r
153 jLabel1.setText("Gap Symbol");
\r
154 jLabel1.setBounds(new Rectangle(41, 142, 76, 15));
\r
155 colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
156 colour.setBounds(new Rectangle(121, 168, 154, 21));
\r
157 jLabel2.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
158 jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
\r
159 jLabel2.setText("Colour");
\r
160 jLabel2.setBounds(new Rectangle(60, 172, 58, 15));
\r
161 jLabel3.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
162 jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
\r
163 jLabel3.setText("Font");
\r
164 jLabel3.setBounds(new Rectangle(83, 114, 34, 15));
\r
165 fontSizeCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
166 fontSizeCB.setBounds(new Rectangle(304, 109, 49, 21));
\r
167 fontStyleCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
168 fontStyleCB.setBounds(new Rectangle(353, 109, 80, 21));
\r
169 fontNameCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
170 fontNameCB.setBounds(new Rectangle(121, 109, 183, 21));
\r
171 gapSymbolCB.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
172 gapSymbolCB.setBounds(new Rectangle(121, 140, 67, 21));
\r
173 startupCheckbox.setText("Open file");
\r
174 startupCheckbox.setBounds(new Rectangle(4, 200, 115, 23));
\r
175 startupCheckbox.addActionListener(new ActionListener()
\r
177 public void actionPerformed(ActionEvent e)
\r
179 jCheckBox1_actionPerformed(e);
\r
182 startupCheckbox.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
183 startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
\r
184 startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
\r
185 startupCheckbox.setSelected(true);
\r
186 startupFileTextfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
\r
187 startupFileTextfield.setBounds(new Rectangle(122, 202, 309, 20));
\r
188 startupFileTextfield.addMouseListener(new MouseAdapter()
\r
190 public void mouseClicked(MouseEvent e)
\r
192 if (e.getClickCount() > 1)
\r
194 startupFileTextfield_mouseClicked();
\r
199 jPanel2.add(annotations);
\r
200 jPanel2.add(conservation);
\r
201 jPanel2.add(quality);
\r
202 jPanel2.add(fullID);
\r
203 jPanel2.add(gapSymbolCB);
\r
204 jPanel2.add(jLabel1);
\r
205 jPanel2.add(fontNameCB);
\r
206 jPanel2.add(jLabel2);
\r
207 jPanel2.add(jLabel3);
\r
208 jPanel2.add(colour);
\r
209 jPanel2.add(fontSizeCB);
\r
210 jPanel2.add(fontStyleCB);
\r
211 jPanel2.add(identity);
\r
212 jPanel2.add(fullScreen);
\r
213 jPanel2.add(startupCheckbox);
\r
214 jPanel2.add(startupFileTextfield);
\r
216 jPanel1.add(cancel);
\r
217 this.add(visaulTab, java.awt.BorderLayout.CENTER);
\r
218 visaulTab.add(visual, "visual");
\r
219 visual.add(jPanel2);
\r
220 this.add(jPanel1, java.awt.BorderLayout.SOUTH);
\r
222 DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
\r
223 dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
\r
224 gapSymbolCB.setRenderer(dlcr);
\r
230 * @param e DOCUMENT ME!
\r
232 public void ok_actionPerformed(ActionEvent e)
\r
239 * @param e DOCUMENT ME!
\r
241 public void cancel_actionPerformed(ActionEvent e)
\r
248 * @param e DOCUMENT ME!
\r
250 public void annotations_actionPerformed(ActionEvent e)
\r
257 * @param e DOCUMENT ME!
\r
259 public void jCheckBox1_actionPerformed(ActionEvent e)
\r
266 public void startupFileTextfield_mouseClicked()
\r