JAL-1667 updated parseJsonExceptionString method in PDBRestClient.java and its equiva...
[jalview.git] / src / jalview / jbgui / GPreferences.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.jbgui;
22
23 import jalview.gui.JvSwingUtils;
24 import jalview.gui.StructureViewer.ViewerType;
25 import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
26 import jalview.util.MessageManager;
27
28 import java.awt.BorderLayout;
29 import java.awt.Color;
30 import java.awt.Component;
31 import java.awt.Dimension;
32 import java.awt.FlowLayout;
33 import java.awt.Font;
34 import java.awt.GridBagConstraints;
35 import java.awt.GridBagLayout;
36 import java.awt.GridLayout;
37 import java.awt.Insets;
38 import java.awt.Rectangle;
39 import java.awt.event.ActionEvent;
40 import java.awt.event.ActionListener;
41 import java.awt.event.FocusEvent;
42 import java.awt.event.KeyEvent;
43 import java.awt.event.MouseAdapter;
44 import java.awt.event.MouseEvent;
45
46 import javax.swing.BorderFactory;
47 import javax.swing.DefaultListCellRenderer;
48 import javax.swing.JButton;
49 import javax.swing.JCheckBox;
50 import javax.swing.JComboBox;
51 import javax.swing.JFileChooser;
52 import javax.swing.JLabel;
53 import javax.swing.JList;
54 import javax.swing.JPanel;
55 import javax.swing.JScrollPane;
56 import javax.swing.JTabbedPane;
57 import javax.swing.JTextField;
58 import javax.swing.ListSelectionModel;
59 import javax.swing.SwingConstants;
60 import javax.swing.border.Border;
61 import javax.swing.border.EmptyBorder;
62 import javax.swing.border.TitledBorder;
63 import javax.swing.event.ChangeEvent;
64 import javax.swing.event.ChangeListener;
65 import javax.swing.event.ListSelectionEvent;
66 import javax.swing.event.ListSelectionListener;
67
68 /**
69  * Base class for the Preferences panel.
70  * 
71  * @author $author$
72  * @version $Revision$
73  */
74 public class GPreferences extends JPanel
75 {
76   private static final Font verdana11 = JvSwingUtils.getLabelFont();
77
78   /*
79    * Visual tab components
80    */
81   protected JCheckBox fullScreen = new JCheckBox();
82
83   protected JCheckBox openoverv = new JCheckBox();
84
85   protected JCheckBox seqLimit = new JCheckBox();
86
87   protected JCheckBox rightAlign = new JCheckBox();
88
89   protected JComboBox<String> fontSizeCB = new JComboBox<String>();
90
91   protected JComboBox<String> fontStyleCB = new JComboBox<String>();
92
93   protected JComboBox<String> fontNameCB = new JComboBox<String>();
94
95   protected JCheckBox showUnconserved = new JCheckBox();
96
97   protected JCheckBox idItalics = new JCheckBox();
98
99   protected JCheckBox smoothFont = new JCheckBox();
100
101   protected JComboBox<String> gapSymbolCB = new JComboBox<String>();
102
103   protected JCheckBox wrap = new JCheckBox();
104
105   protected JComboBox<String> sortby = new JComboBox<String>();
106
107   protected JComboBox<String> sortAnnBy = new JComboBox<String>();
108
109   protected JComboBox<String> sortAutocalc = new JComboBox<String>();
110
111   protected JCheckBox startupCheckbox = new JCheckBox();
112
113   protected JTextField startupFileTextfield = new JTextField();
114
115   // below are in the 'second column'
116   protected JCheckBox annotations = new JCheckBox();
117
118   protected JCheckBox quality = new JCheckBox();
119
120   protected JCheckBox conservation = new JCheckBox();
121
122   protected JCheckBox identity = new JCheckBox();
123
124   protected JCheckBox showGroupConsensus = new JCheckBox();
125
126   protected JCheckBox showGroupConservation = new JCheckBox();
127
128   protected JCheckBox showConsensHistogram = new JCheckBox();
129
130   protected JCheckBox showConsensLogo = new JCheckBox();
131
132   protected JCheckBox showDbRefTooltip = new JCheckBox();
133
134   protected JCheckBox showNpTooltip = new JCheckBox();
135
136   /*
137    * Structure tab and components
138    */
139   protected JPanel structureTab;
140
141   protected JCheckBox structFromPdb = new JCheckBox();
142
143   protected JCheckBox useRnaView = new JCheckBox();
144
145   protected JCheckBox addSecondaryStructure = new JCheckBox();
146
147   protected JCheckBox addTempFactor = new JCheckBox();
148
149   protected JComboBox<String> structViewer = new JComboBox<String>();
150
151   protected JTextField chimeraPath = new JTextField();
152
153
154   /*
155    * Colours tab components
156    */
157   protected JPanel minColour = new JPanel();
158
159   protected JPanel maxColour = new JPanel();
160
161   protected JComboBox<String> colour = new JComboBox<String>();
162
163   /*
164    * Connections tab components
165    */
166   protected JList linkURLList = new JList();
167
168   protected JTextField proxyServerTB = new JTextField();
169
170   protected JTextField proxyPortTB = new JTextField();
171
172   protected JTextField defaultBrowser = new JTextField();
173
174   protected JList linkNameList = new JList();
175
176   protected JCheckBox useProxy = new JCheckBox();
177
178   protected JCheckBox usagestats = new JCheckBox();
179
180   protected JCheckBox questionnaire = new JCheckBox();
181
182   protected JCheckBox versioncheck = new JCheckBox();
183
184   /*
185    * Output tab components
186    */
187   protected JComboBox<String> epsRendering = new JComboBox<String>();
188
189   protected JLabel userIdWidthlabel = new JLabel();
190
191   protected JCheckBox autoIdWidth = new JCheckBox();
192
193   protected JTextField userIdWidth = new JTextField();
194
195   protected JCheckBox blcjv = new JCheckBox();
196
197   protected JCheckBox pileupjv = new JCheckBox();
198
199   protected JCheckBox clustaljv = new JCheckBox();
200
201   protected JCheckBox msfjv = new JCheckBox();
202
203   protected JCheckBox fastajv = new JCheckBox();
204
205   protected JCheckBox pfamjv = new JCheckBox();
206
207   protected JCheckBox pirjv = new JCheckBox();
208
209   protected JCheckBox modellerOutput = new JCheckBox();
210
211   /*
212    * Editing tab components
213    */
214   protected JCheckBox autoCalculateConsCheck = new JCheckBox();
215
216   protected JCheckBox padGaps = new JCheckBox();
217
218   protected JCheckBox sortByTree = new JCheckBox();
219
220   /*
221    * DAS Settings tab
222    */
223   protected JPanel dasTab = new JPanel();
224
225   /*
226    * Web Services tab
227    */
228   protected JPanel wsTab = new JPanel();
229
230   /**
231    * Creates a new GPreferences object.
232    */
233   public GPreferences()
234   {
235     try
236     {
237       jbInit();
238     } catch (Exception ex)
239     {
240       ex.printStackTrace();
241     }
242   }
243
244   /**
245    * Construct the panel and its tabbed sub-panels.
246    * 
247    * @throws Exception
248    */
249   private void jbInit() throws Exception
250   {
251     final JTabbedPane tabbedPane = new JTabbedPane();
252     this.setLayout(new BorderLayout());
253     JPanel okCancelPanel = initOkCancelPanel();
254     this.add(tabbedPane, BorderLayout.CENTER);
255     this.add(okCancelPanel, BorderLayout.SOUTH);
256
257     tabbedPane.add(initVisualTab(),
258             MessageManager.getString("label.visual"));
259
260     tabbedPane.add(initColoursTab(),
261             MessageManager.getString("label.colours"));
262
263     tabbedPane.add(initStructureTab(),
264             MessageManager.getString("label.structure"));
265
266     tabbedPane.add(initConnectionsTab(),
267             MessageManager.getString("label.connections"));
268
269     tabbedPane.add(initOutputTab(), MessageManager.getString("label.output"));
270
271     tabbedPane.add(initEditingTab(), MessageManager.getString("label.editing"));
272
273     /*
274      * See DasSourceBrowser for the real work of configuring this tab.
275      */
276     dasTab.setLayout(new BorderLayout());
277     tabbedPane
278             .add(dasTab, MessageManager.getString("label.das_settings"));
279
280     /*
281      * See WsPreferences for the real work of configuring this tab.
282      */
283     wsTab.setLayout(new BorderLayout());
284     tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
285
286     /*
287      * Handler to validate a tab before leaving it - currently only for
288      * Structure.
289      */
290     tabbedPane.addChangeListener(new ChangeListener()
291     {
292       private Component lastTab;
293
294       @Override
295       public void stateChanged(ChangeEvent e)
296       {
297         if (lastTab == structureTab
298                 && tabbedPane.getSelectedComponent() != structureTab)
299         {
300           if (!validateStructure())
301           {
302             tabbedPane.setSelectedComponent(structureTab);
303             return;
304           }
305         }
306         lastTab = tabbedPane.getSelectedComponent();
307       }
308
309     });
310   }
311
312   /**
313    * Initialises the Editing tabbed panel.
314    * 
315    * @return
316    */
317   private JPanel initEditingTab()
318   {
319     JPanel editingTab = new JPanel();
320     editingTab.setLayout(null);
321     autoCalculateConsCheck.setFont(verdana11);
322     autoCalculateConsCheck.setText(MessageManager
323             .getString("label.autocalculate_consensus"));
324     autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
325     padGaps.setFont(verdana11);
326     padGaps.setText(MessageManager.getString("label.pad_gaps_when_editing"));
327     padGaps.setBounds(new Rectangle(22, 94, 168, 23));
328     sortByTree.setFont(verdana11);
329     sortByTree
330             .setText(MessageManager.getString("label.sort_with_new_tree"));
331     sortByTree
332             .setToolTipText(MessageManager
333                     .getString("label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
334     sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
335     editingTab.add(autoCalculateConsCheck);
336     editingTab.add(padGaps);
337     editingTab.add(sortByTree);
338     return editingTab;
339   }
340
341   /**
342    * Initialises the Output tabbed panel.
343    * 
344    * @return
345    */
346   private JPanel initOutputTab()
347   {
348     JPanel outputTab = new JPanel();
349     outputTab.setLayout(null);
350     JLabel epsLabel = new JLabel();
351     epsLabel.setFont(verdana11);
352     epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
353     epsLabel.setText(MessageManager.getString("label.eps_rendering_style"));
354     epsLabel.setBounds(new Rectangle(9, 31, 140, 24));
355     epsRendering.setFont(verdana11);
356     epsRendering.setBounds(new Rectangle(154, 34, 187, 21));
357     JLabel jLabel1 = new JLabel();
358     jLabel1.setFont(verdana11);
359     jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
360     jLabel1.setText(MessageManager.getString("label.append_start_end"));
361     jLabel1.setFont(verdana11);
362     fastajv.setFont(verdana11);
363     fastajv.setHorizontalAlignment(SwingConstants.LEFT);
364     clustaljv.setText(MessageManager.getString("label.clustal") + "     ");
365     blcjv.setText(MessageManager.getString("label.blc") + "     ");
366     fastajv.setText(MessageManager.getString("label.fasta") + "     ");
367     msfjv.setText(MessageManager.getString("label.msf") + "     ");
368     pfamjv.setText(MessageManager.getString("label.pfam") + "     ");
369     pileupjv.setText(MessageManager.getString("label.pileup") + "     ");
370     msfjv.setFont(verdana11);
371     msfjv.setHorizontalAlignment(SwingConstants.LEFT);
372     pirjv.setText(MessageManager.getString("label.pir") + "     ");
373     JPanel jPanel11 = new JPanel();
374     jPanel11.setFont(verdana11);
375     TitledBorder titledBorder2 = new TitledBorder(
376             MessageManager.getString("label.file_output"));
377     jPanel11.setBorder(titledBorder2);
378     jPanel11.setBounds(new Rectangle(30, 72, 196, 182));
379     GridLayout gridLayout3 = new GridLayout();
380     jPanel11.setLayout(gridLayout3);
381     gridLayout3.setRows(8);
382     blcjv.setFont(verdana11);
383     blcjv.setHorizontalAlignment(SwingConstants.LEFT);
384     clustaljv.setFont(verdana11);
385     clustaljv.setHorizontalAlignment(SwingConstants.LEFT);
386     pfamjv.setFont(verdana11);
387     pfamjv.setHorizontalAlignment(SwingConstants.LEFT);
388     pileupjv.setFont(verdana11);
389     pileupjv.setHorizontalAlignment(SwingConstants.LEFT);
390     pirjv.setFont(verdana11);
391     pirjv.setHorizontalAlignment(SwingConstants.LEFT);
392     autoIdWidth.setFont(verdana11);
393     autoIdWidth.setText(MessageManager
394             .getString("label.automatically_set_id_width"));
395     autoIdWidth
396             .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.adjusts_width_generated_eps_png")));
397     autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23));
398     autoIdWidth.addActionListener(new ActionListener()
399     {
400
401       @Override
402       public void actionPerformed(ActionEvent e)
403       {
404         autoIdWidth_actionPerformed();
405       }
406     });
407     userIdWidthlabel.setFont(verdana11);
408     userIdWidthlabel.setText(MessageManager
409             .getString("label.figure_id_column_width"));
410     userIdWidth
411             .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column")));
412     userIdWidthlabel
413             .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column")));
414     userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23));
415     userIdWidth.setFont(JvSwingUtils.getTextAreaFont());
416     userIdWidth.setText("");
417     userIdWidth.setBounds(new Rectangle(232, 144, 84, 23));
418     userIdWidth.addActionListener(new ActionListener()
419     {
420
421       @Override
422       public void actionPerformed(ActionEvent e)
423       {
424         userIdWidth_actionPerformed();
425       }
426     });
427     jPanel11.add(jLabel1);
428     jPanel11.add(blcjv);
429     jPanel11.add(clustaljv);
430     jPanel11.add(fastajv);
431     jPanel11.add(msfjv);
432     jPanel11.add(pfamjv);
433     jPanel11.add(pileupjv);
434     jPanel11.add(pirjv);
435     outputTab.add(autoIdWidth);
436     outputTab.add(userIdWidth);
437     outputTab.add(userIdWidthlabel);
438     outputTab.add(modellerOutput);
439     outputTab.add(epsLabel);
440     outputTab.add(epsRendering);
441     outputTab.add(jPanel11);
442     modellerOutput.setFont(verdana11);
443     modellerOutput.setText(MessageManager
444             .getString("label.use_modeller_output"));
445     modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
446     return outputTab;
447   }
448
449   /**
450    * Initialises the Connections tabbed panel.
451    * 
452    * @return
453    */
454   private JPanel initConnectionsTab()
455   {
456     JPanel connectTab = new JPanel();
457     connectTab.setLayout(new GridBagLayout());
458     JLabel serverLabel = new JLabel();
459     serverLabel.setText(MessageManager.getString("label.address"));
460     serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
461     serverLabel.setFont(verdana11);
462     proxyServerTB.setFont(verdana11);
463     proxyPortTB.setFont(verdana11);
464     JLabel portLabel = new JLabel();
465     portLabel.setFont(verdana11);
466     portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
467     portLabel.setText(MessageManager.getString("label.port"));
468     JLabel browserLabel = new JLabel();
469     browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
470     browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
471     browserLabel.setText(MessageManager
472             .getString("label.default_browser_unix"));
473     defaultBrowser.setFont(verdana11);
474     defaultBrowser.setText("");
475     usagestats.setText(MessageManager
476             .getString("label.send_usage_statistics"));
477     usagestats.setFont(verdana11);
478     usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
479     usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
480     questionnaire.setText(MessageManager
481             .getString("label.check_for_questionnaires"));
482     questionnaire.setFont(verdana11);
483     questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
484     questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
485     versioncheck.setText(MessageManager
486             .getString("label.check_for_latest_version"));
487     versioncheck.setFont(verdana11);
488     versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
489     versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
490     JButton newLink = new JButton();
491     newLink.setText(MessageManager.getString("action.new"));
492     newLink.addActionListener(new java.awt.event.ActionListener()
493     {
494       public void actionPerformed(ActionEvent e)
495       {
496         newLink_actionPerformed(e);
497       }
498     });
499     JButton editLink = new JButton();
500     editLink.setText(MessageManager.getString("action.edit"));
501     editLink.addActionListener(new java.awt.event.ActionListener()
502     {
503       public void actionPerformed(ActionEvent e)
504       {
505         editLink_actionPerformed(e);
506       }
507     });
508     JButton deleteLink = new JButton();
509     deleteLink.setText(MessageManager.getString("action.delete"));
510     deleteLink.addActionListener(new java.awt.event.ActionListener()
511     {
512       public void actionPerformed(ActionEvent e)
513       {
514         deleteLink_actionPerformed(e);
515       }
516     });
517
518     linkURLList.addListSelectionListener(new ListSelectionListener()
519     {
520       public void valueChanged(ListSelectionEvent e)
521       {
522         int index = linkURLList.getSelectedIndex();
523         linkNameList.setSelectedIndex(index);
524       }
525     });
526
527     linkNameList.addListSelectionListener(new ListSelectionListener()
528     {
529       public void valueChanged(ListSelectionEvent e)
530       {
531         int index = linkNameList.getSelectedIndex();
532         linkURLList.setSelectedIndex(index);
533       }
534     });
535
536     JScrollPane linkScrollPane = new JScrollPane();
537     linkScrollPane.setBorder(null);
538     JPanel linkPanel = new JPanel();
539     linkPanel.setBorder(new TitledBorder(MessageManager
540             .getString("label.url_linkfrom_sequence_id")));
541     linkPanel.setLayout(new BorderLayout());
542     GridLayout gridLayout1 = new GridLayout();
543     JPanel editLinkButtons = new JPanel();
544     editLinkButtons.setLayout(gridLayout1);
545     gridLayout1.setRows(3);
546     linkNameList.setFont(verdana11);
547     linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
548     BorderLayout borderLayout3 = new BorderLayout();
549     JPanel linkPanel2 = new JPanel();
550     linkPanel2.setLayout(borderLayout3);
551     linkURLList.setFont(verdana11);
552     linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
553
554     defaultBrowser.addMouseListener(new MouseAdapter()
555     {
556       public void mouseClicked(MouseEvent e)
557       {
558         if (e.getClickCount() > 1)
559         {
560           defaultBrowser_mouseClicked(e);
561         }
562       }
563     });
564     useProxy.setFont(verdana11);
565     useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
566     useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
567     useProxy.setText(MessageManager.getString("label.use_proxy_server"));
568     useProxy.addActionListener(new ActionListener()
569     {
570       public void actionPerformed(ActionEvent e)
571       {
572         useProxy_actionPerformed();
573       }
574     });
575     linkPanel.add(editLinkButtons, BorderLayout.EAST);
576     editLinkButtons.add(newLink, null);
577     editLinkButtons.add(editLink, null);
578     editLinkButtons.add(deleteLink, null);
579     linkPanel.add(linkScrollPane, BorderLayout.CENTER);
580     linkScrollPane.getViewport().add(linkPanel2, null);
581     linkPanel2.add(linkURLList, BorderLayout.CENTER);
582     linkPanel2.add(linkNameList, BorderLayout.WEST);
583     JPanel jPanel1 = new JPanel();
584     TitledBorder titledBorder1 = new TitledBorder(
585             MessageManager.getString("label.proxy_server"));
586     jPanel1.setBorder(titledBorder1);
587     jPanel1.setLayout(new GridBagLayout());
588     jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
589             GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
590                     2, 4, 0), 5, 0));
591     jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
592             GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
593                     0, 4, 0), 11, 6));
594     connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
595             GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
596                     16, 0, 0, 12), 359, -17));
597     connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
598             GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
599                     21, 0, 35, 12), 4, 6));
600     connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
601             0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
602             new Insets(16, 0, 0, 0), 5, 1));
603     jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
604             GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
605                     2, 5, 185), 2, -4));
606     jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
607             GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
608             new Insets(0, 2, 4, 2), 54, 1));
609     jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
610             GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
611             new Insets(0, 2, 4, 0), 263, 1));
612     connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
613             0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
614             new Insets(15, 0, 0, 15), 307, 1));
615     connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
616             GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
617             new Insets(0, 2, 4, 2), 70, 1));
618     connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
619             0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
620             new Insets(0, 2, 4, 2), 70, 1));
621     connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
622             0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
623             new Insets(0, 2, 4, 2), 70, 1));
624     return connectTab;
625   }
626
627   /**
628    * Initialises the parent panel which contains the tabbed sections.
629    * 
630    * @return
631    */
632   private JPanel initOkCancelPanel()
633   {
634     JButton ok = new JButton();
635     ok.setText(MessageManager.getString("action.ok"));
636     ok.addActionListener(new ActionListener()
637     {
638       public void actionPerformed(ActionEvent e)
639       {
640         ok_actionPerformed(e);
641       }
642     });
643     JButton cancel = new JButton();
644     cancel.setText(MessageManager.getString("action.cancel"));
645     cancel.addActionListener(new ActionListener()
646     {
647       public void actionPerformed(ActionEvent e)
648       {
649         cancel_actionPerformed(e);
650       }
651     });
652     JPanel okCancelPanel = new JPanel();
653     okCancelPanel.add(ok);
654     okCancelPanel.add(cancel);
655     return okCancelPanel;
656   }
657
658   /**
659    * Initialises the Colours tabbed panel.
660    * 
661    * @return
662    */
663   private JPanel initColoursTab()
664   {
665     JPanel coloursTab = new JPanel();
666     coloursTab.setBorder(new TitledBorder(MessageManager
667             .getString("action.open_new_alignment")));
668     coloursTab.setLayout(new FlowLayout());
669     JLabel mincolourLabel = new JLabel();
670     mincolourLabel.setFont(verdana11);
671     mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
672     mincolourLabel.setText(MessageManager.getString("label.min_colour"));
673     minColour.setFont(verdana11);
674     minColour.setBorder(BorderFactory.createEtchedBorder());
675     minColour.setPreferredSize(new Dimension(40, 20));
676     minColour.addMouseListener(new MouseAdapter()
677     {
678       public void mousePressed(MouseEvent e)
679       {
680         minColour_actionPerformed(minColour);
681       }
682     });
683     JLabel maxcolourLabel = new JLabel();
684     maxcolourLabel.setFont(verdana11);
685     maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
686     maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
687     maxColour.setFont(verdana11);
688     maxColour.setBorder(BorderFactory.createEtchedBorder());
689     maxColour.setPreferredSize(new Dimension(40, 20));
690     maxColour.addMouseListener(new MouseAdapter()
691     {
692       public void mousePressed(MouseEvent e)
693       {
694         maxColour_actionPerformed(maxColour);
695       }
696     });
697     colour.setFont(verdana11);
698     colour.setBounds(new Rectangle(172, 225, 155, 21));
699     JLabel colourLabel = new JLabel();
700     colourLabel.setFont(verdana11);
701     colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
702     colourLabel.setText(MessageManager.getString("label.alignment_colour")
703             + " ");
704     JvSwingUtils.addtoLayout(coloursTab, MessageManager
705             .getString("label.default_colour_scheme_for_alignment"),
706             colourLabel, colour);
707     JPanel annotationShding = new JPanel();
708     annotationShding.setBorder(new TitledBorder(MessageManager
709             .getString("label.annotation_shading_default")));
710     annotationShding.setLayout(new GridLayout(1, 2));
711     JvSwingUtils.addtoLayout(annotationShding, MessageManager
712             .getString("label.default_minimum_colour_annotation_shading"),
713             mincolourLabel, minColour);
714     JvSwingUtils.addtoLayout(annotationShding, MessageManager
715             .getString("label.default_maximum_colour_annotation_shading"),
716             maxcolourLabel, maxColour);
717     coloursTab.add(annotationShding); // , FlowLayout.LEFT);
718     return coloursTab;
719   }
720
721   /**
722    * Initialises the Structure tabbed panel.
723    * 
724    * @return
725    */
726   private JPanel initStructureTab()
727   {
728     structureTab = new JPanel();
729
730     structureTab.setBorder(new TitledBorder(MessageManager
731             .getString("label.structure_options")));
732     structureTab.setLayout(null);
733     final int width = 400;
734     final int height = 22;
735     final int lineSpacing = 25;
736     int ypos = 30;
737
738     structFromPdb.setFont(verdana11);
739     structFromPdb.setText(MessageManager.getString("label.struct_from_pdb"));
740     structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
741     structFromPdb.addActionListener(new ActionListener()
742     {
743       @Override
744       public void actionPerformed(ActionEvent e)
745       {
746         boolean selected = structFromPdb.isSelected();
747         // enable other options only when the first is checked
748         useRnaView.setEnabled(selected);
749         addSecondaryStructure.setEnabled(selected);
750         addTempFactor.setEnabled(selected);
751       }
752     });
753     structureTab.add(structFromPdb);
754
755     // indent checkboxes that are conditional on the first one
756     ypos += lineSpacing;
757     useRnaView.setFont(verdana11);
758     useRnaView.setText(MessageManager.getString("label.use_rnaview"));
759     useRnaView.setBounds(new Rectangle(25, ypos, width, height));
760     structureTab.add(useRnaView);
761
762     ypos += lineSpacing;
763     addSecondaryStructure.setFont(verdana11);
764     addSecondaryStructure.setText(MessageManager
765             .getString("label.autoadd_secstr"));
766     addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
767     structureTab.add(addSecondaryStructure);
768
769     ypos += lineSpacing;
770     addTempFactor.setFont(verdana11);
771     addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
772     addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
773     structureTab.add(addTempFactor);
774
775     ypos += lineSpacing;
776     JLabel viewerLabel = new JLabel();
777     viewerLabel.setFont(verdana11);
778     viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
779     viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
780     viewerLabel.setBounds(new Rectangle(10, ypos, 200, height));
781     structureTab.add(viewerLabel);
782
783     structViewer.setFont(verdana11);
784     structViewer.setBounds(new Rectangle(160, ypos, 120, height));
785     structViewer.addItem(ViewerType.JMOL.name());
786     structViewer.addItem(ViewerType.CHIMERA.name());
787     structViewer.addActionListener(new ActionListener()
788     {
789       @Override
790       public void actionPerformed(ActionEvent e)
791       {
792         structureViewer_actionPerformed((String) structViewer
793                 .getSelectedItem());
794       }
795     });
796     structureTab.add(structViewer);
797
798     ypos += lineSpacing;
799     JLabel pathLabel = new JLabel();
800     pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
801     pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
802     pathLabel.setText(MessageManager.getString("label.chimera_path"));
803     final String tooltip = JvSwingUtils.wrapTooltip(true,
804             MessageManager.getString("label.chimera_path_tip"));
805     pathLabel.setToolTipText(tooltip);
806     pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
807     structureTab.add(pathLabel);
808
809     chimeraPath.setFont(verdana11);
810     chimeraPath.setText("");
811     chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
812     chimeraPath.addMouseListener(new MouseAdapter()
813     {
814       @Override
815       public void mouseClicked(MouseEvent e)
816       {
817         if (e.getClickCount() == 2)
818         {
819           String chosen = openFileChooser();
820           if (chosen != null)
821           {
822             chimeraPath.setText(chosen);
823           }
824         }
825       }
826     });
827     structureTab.add(chimeraPath);
828
829     ypos += lineSpacing;
830     // scrl_pdbDocFieldConfig.setPreferredSize(new Dimension(450, 100));
831     // scrl_pdbDocFieldConfig
832     // .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
833     // scrl_pdbDocFieldConfig.setBounds();
834     PDBDocFieldPreferences docFieldPref = new PDBDocFieldPreferences(
835             PreferenceSource.PREFERENCES);
836     docFieldPref.setBounds(new Rectangle(10, ypos + 5, 450, 120));
837     structureTab.add(docFieldPref);
838
839
840
841
842     return structureTab;
843   }
844
845
846   /**
847    * Action on choosing a structure viewer from combobox options.
848    * 
849    * @param selectedItem
850    */
851   protected void structureViewer_actionPerformed(String selectedItem)
852   {
853   }
854
855   /**
856    * Show a dialog for the user to choose a file. Returns the chosen path, or
857    * null on Cancel.
858    * 
859    * @return
860    */
861   protected String openFileChooser()
862   {
863     String choice = null;
864     JFileChooser chooser = new JFileChooser();
865
866     // chooser.setFileView(new JalviewFileView());
867     chooser.setDialogTitle(MessageManager
868             .getString("label.open_local_file"));
869     chooser.setToolTipText(MessageManager.getString("action.open"));
870
871     int value = chooser.showOpenDialog(this);
872
873     if (value == JFileChooser.APPROVE_OPTION)
874     {
875       choice = chooser.getSelectedFile().getPath();
876     }
877     return choice;
878   }
879
880   /**
881    * Validate the structure tab preferences; if invalid, set focus on this tab.
882    * 
883    * @param e
884    */
885   protected boolean validateStructure(FocusEvent e)
886   {
887     if (!validateStructure())
888     {
889       e.getComponent().requestFocusInWindow();
890       return false;
891     }
892     return true;
893   }
894
895   protected boolean validateStructure()
896   {
897     return false;
898   }
899
900   /**
901    * Initialises the Visual tabbed panel.
902    * 
903    * @return
904    */
905   private JPanel initVisualTab()
906   {
907     JPanel visualTab = new JPanel();
908     visualTab.setBorder(new TitledBorder(MessageManager
909             .getString("action.open_new_alignment")));
910     visualTab.setLayout(null);
911     fullScreen.setFont(verdana11);
912     fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
913     fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
914     fullScreen.setText(MessageManager.getString("label.maximize_window"));
915     quality.setEnabled(false);
916     quality.setFont(verdana11);
917     quality.setHorizontalAlignment(SwingConstants.RIGHT);
918     quality.setHorizontalTextPosition(SwingConstants.LEFT);
919     quality.setSelected(true);
920     quality.setText(MessageManager.getString("label.quality"));
921     conservation.setEnabled(false);
922     conservation.setFont(verdana11);
923     conservation.setHorizontalAlignment(SwingConstants.RIGHT);
924     conservation.setHorizontalTextPosition(SwingConstants.LEFT);
925     conservation.setSelected(true);
926     conservation.setText(MessageManager.getString("label.conservation"));
927     identity.setEnabled(false);
928     identity.setFont(verdana11);
929     identity.setHorizontalAlignment(SwingConstants.RIGHT);
930     identity.setHorizontalTextPosition(SwingConstants.LEFT);
931     identity.setSelected(true);
932     identity.setText(MessageManager.getString("label.consensus"));
933     JLabel showGroupbits = new JLabel();
934     showGroupbits.setFont(verdana11);
935     showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
936     showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
937     showGroupbits.setText(MessageManager.getString("action.show_group")
938             + ":");
939     JLabel showConsensbits = new JLabel();
940     showConsensbits.setFont(verdana11);
941     showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
942     showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
943     showConsensbits.setText(MessageManager.getString("label.consensus")
944             + ":");
945     showConsensHistogram.setEnabled(false);
946     showConsensHistogram.setFont(verdana11);
947     showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
948     showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
949     showConsensHistogram.setSelected(true);
950     showConsensHistogram.setText(MessageManager
951             .getString("label.histogram"));
952     showConsensLogo.setEnabled(false);
953     showConsensLogo.setFont(verdana11);
954     showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
955     showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
956     showConsensLogo.setSelected(true);
957     showConsensLogo.setText(MessageManager.getString("label.logo"));
958     showGroupConsensus.setEnabled(false);
959     showGroupConsensus.setFont(verdana11);
960     showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
961     showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
962     showGroupConsensus.setSelected(true);
963     showGroupConsensus.setText(MessageManager.getString("label.consensus"));
964     showGroupConservation.setEnabled(false);
965     showGroupConservation.setFont(verdana11);
966     showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
967     showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
968     showGroupConservation.setSelected(true);
969     showGroupConservation.setText(MessageManager
970             .getString("label.conservation"));
971     showNpTooltip.setEnabled(true);
972     showNpTooltip.setFont(verdana11);
973     showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
974     showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
975     showNpTooltip.setSelected(true);
976     showNpTooltip.setText(MessageManager
977             .getString("label.non_positional_features"));
978     showDbRefTooltip.setEnabled(true);
979     showDbRefTooltip.setFont(verdana11);
980     showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
981     showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
982     showDbRefTooltip.setSelected(true);
983     showDbRefTooltip.setText(MessageManager
984             .getString("label.database_references"));
985     annotations.setFont(verdana11);
986     annotations.setHorizontalAlignment(SwingConstants.RIGHT);
987     annotations.setHorizontalTextPosition(SwingConstants.LEADING);
988     annotations.setSelected(true);
989     annotations.setText(MessageManager.getString("label.show_annotations"));
990     annotations.setBounds(new Rectangle(169, 12, 200, 23));
991     annotations.addActionListener(new ActionListener()
992     {
993       public void actionPerformed(ActionEvent e)
994       {
995         annotations_actionPerformed(e);
996       }
997     });
998     identity.addActionListener(new ActionListener()
999     {
1000       public void actionPerformed(ActionEvent e)
1001       {
1002         annotations_actionPerformed(e);
1003       }
1004     });
1005     showGroupConsensus.addActionListener(new ActionListener()
1006     {
1007       public void actionPerformed(ActionEvent e)
1008       {
1009         annotations_actionPerformed(e);
1010       }
1011     });
1012     showUnconserved.setFont(verdana11);
1013     showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
1014     showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
1015     showUnconserved.setSelected(true);
1016     showUnconserved.setText(MessageManager
1017             .getString("action.show_unconserved"));
1018     showUnconserved.addActionListener(new ActionListener()
1019     {
1020       public void actionPerformed(ActionEvent e)
1021       {
1022         showunconserved_actionPerformed(e);
1023       }
1024     });
1025
1026     // TODO these are not yet added to / action from Preferences
1027     // JCheckBox shareSelections = new JCheckBox();
1028     // shareSelections.setFont(verdana11);
1029     // shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
1030     // shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
1031     // shareSelections.setSelected(true);
1032     // shareSelections.setText(MessageManager
1033     // .getString("label.share_selection_across_views"));
1034     // JCheckBox followHighlight = new JCheckBox();
1035     // followHighlight.setFont(verdana11);
1036     // followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
1037     // followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
1038     // // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
1039     // followHighlight.setSelected(true);
1040     // followHighlight.setText(MessageManager
1041     // .getString("label.scroll_highlighted_regions"));
1042
1043     seqLimit.setFont(verdana11);
1044     seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
1045     seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
1046     seqLimit.setText(MessageManager.getString("label.full_sequence_id"));
1047     smoothFont.setFont(verdana11);
1048     smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
1049     smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
1050     smoothFont.setText(MessageManager.getString("label.smooth_font"));
1051     JLabel gapLabel = new JLabel();
1052     gapLabel.setFont(verdana11);
1053     gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1054     gapLabel.setText(MessageManager.getString("label.gap_symbol") + " ");
1055     JLabel fontLabel = new JLabel();
1056     fontLabel.setFont(verdana11);
1057     fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1058     fontLabel.setText(MessageManager.getString("label.font"));
1059     fontSizeCB.setFont(verdana11);
1060     fontSizeCB.setBounds(new Rectangle(320, 104, 65, 23));
1061     fontStyleCB.setFont(verdana11);
1062     fontStyleCB.setBounds(new Rectangle(382, 104, 80, 23));
1063     fontNameCB.setFont(verdana11);
1064     fontNameCB.setBounds(new Rectangle(172, 104, 147, 23));
1065     gapSymbolCB.setFont(verdana11);
1066     gapSymbolCB.setBounds(new Rectangle(172, 196, 69, 23));
1067     DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
1068     dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
1069     gapSymbolCB.setRenderer(dlcr);
1070
1071     startupCheckbox.setText(MessageManager.getString("action.open_file"));
1072     startupCheckbox.setFont(verdana11);
1073     startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
1074     startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
1075     startupCheckbox.setSelected(true);
1076     startupFileTextfield.setFont(verdana11);
1077     startupFileTextfield.setBounds(new Rectangle(172, 290, 270, 20));
1078     startupFileTextfield.addMouseListener(new MouseAdapter()
1079     {
1080       public void mouseClicked(MouseEvent e)
1081       {
1082         if (e.getClickCount() > 1)
1083         {
1084           startupFileTextfield_mouseClicked();
1085         }
1086       }
1087     });
1088  
1089     sortby.setFont(verdana11);
1090     sortby.setBounds(new Rectangle(172, 240, 155, 21));
1091     JLabel sortLabel = new JLabel();
1092     sortLabel.setFont(verdana11);
1093     sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1094     sortLabel.setText(MessageManager.getString("label.sort_by"));
1095     sortAnnBy.setFont(verdana11);
1096     sortAnnBy.setBounds(new Rectangle(172, 265, 110, 21));
1097     JLabel sortAnnLabel = new JLabel();
1098     sortAnnLabel.setFont(verdana11);
1099     sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1100     sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
1101     sortAutocalc.setFont(verdana11);
1102     sortAutocalc.setBounds(new Rectangle(290, 265, 165, 21));
1103     JPanel annsettingsPanel = new JPanel();
1104     annsettingsPanel.setBounds(new Rectangle(173, 34, 300, 61));
1105     annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
1106     JPanel autoAnnotSettings1 = new JPanel();
1107     autoAnnotSettings1.setLayout(new GridLayout(3, 1, 0, 0));
1108     annsettingsPanel.add(autoAnnotSettings1);
1109     JPanel autoAnnotSettings2 = new JPanel();
1110     autoAnnotSettings2.setLayout(new GridLayout(3, 1, 0, 0));
1111     annsettingsPanel.add(autoAnnotSettings2);
1112     JPanel autoAnnotSettings3 = new JPanel();
1113     autoAnnotSettings3.setLayout(new GridLayout(3, 1, 0, 0));
1114     annsettingsPanel.add(autoAnnotSettings3);
1115     visualTab.add(annsettingsPanel);
1116     Border jb = new EmptyBorder(1, 1, 4, 5);
1117     quality.setBorder(jb);
1118     conservation.setBorder(jb);
1119     identity.setBorder(jb);
1120     showConsensbits.setBorder(jb);
1121     showGroupbits.setBorder(jb);
1122     showGroupConsensus.setBorder(jb);
1123     showGroupConservation.setBorder(jb);
1124     showConsensHistogram.setBorder(jb);
1125     showConsensLogo.setBorder(jb);
1126
1127     autoAnnotSettings2.add(conservation);
1128     autoAnnotSettings1.add(quality);
1129     autoAnnotSettings3.add(identity);
1130     autoAnnotSettings1.add(showGroupbits);
1131     autoAnnotSettings3.add(showGroupConsensus);
1132     autoAnnotSettings2.add(showGroupConservation);
1133     autoAnnotSettings1.add(showConsensbits);
1134     autoAnnotSettings2.add(showConsensHistogram);
1135     autoAnnotSettings3.add(showConsensLogo);
1136
1137     JPanel tooltipSettings = new JPanel();
1138     tooltipSettings.setBorder(new TitledBorder(MessageManager
1139             .getString("label.sequence_id_tooltip")));
1140     tooltipSettings.setBounds(173, 130, 200, 62);
1141     tooltipSettings.setLayout(new GridLayout(2, 1));
1142     tooltipSettings.add(showDbRefTooltip);
1143     tooltipSettings.add(showNpTooltip);
1144     visualTab.add(tooltipSettings);
1145
1146     wrap.setFont(verdana11);
1147     wrap.setHorizontalAlignment(SwingConstants.TRAILING);
1148     wrap.setHorizontalTextPosition(SwingConstants.LEADING);
1149     wrap.setText(MessageManager.getString("label.wrap_alignment"));
1150     rightAlign.setFont(verdana11);
1151     rightAlign.setForeground(Color.black);
1152     rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
1153     rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
1154     rightAlign.setText(MessageManager.getString("label.right_align_ids"));
1155     idItalics.setFont(verdana11);
1156     idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
1157     idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
1158     idItalics.setText(MessageManager
1159             .getString("label.sequence_name_italics"));
1160     openoverv.setFont(verdana11);
1161     openoverv.setActionCommand(MessageManager
1162             .getString("label.open_overview"));
1163     openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
1164     openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
1165     openoverv.setText(MessageManager.getString(("label.open_overview")));
1166     JPanel jPanel2 = new JPanel();
1167     jPanel2.setBounds(new Rectangle(7, 17, 158, 297));
1168     GridLayout gridLayout2 = new GridLayout();
1169     jPanel2.setLayout(gridLayout2);
1170     gridLayout2.setRows(13);
1171     jPanel2.add(fullScreen);
1172     jPanel2.add(openoverv);
1173     jPanel2.add(seqLimit);
1174     jPanel2.add(rightAlign);
1175     jPanel2.add(fontLabel);
1176     jPanel2.add(showUnconserved);
1177     jPanel2.add(idItalics);
1178     jPanel2.add(smoothFont);
1179     jPanel2.add(gapLabel);
1180     jPanel2.add(wrap);
1181     jPanel2.add(sortLabel);
1182     jPanel2.add(sortAnnLabel);
1183     jPanel2.add(startupCheckbox);
1184     visualTab.add(jPanel2);
1185     visualTab.add(annotations);
1186     visualTab.add(startupFileTextfield);
1187     visualTab.add(sortby);
1188     visualTab.add(sortAnnBy);
1189     visualTab.add(sortAutocalc);
1190     visualTab.add(gapSymbolCB);
1191     visualTab.add(fontNameCB);
1192     visualTab.add(fontSizeCB);
1193     visualTab.add(fontStyleCB);
1194     return visualTab;
1195   }
1196
1197   protected void autoIdWidth_actionPerformed()
1198   {
1199     // TODO Auto-generated method stub
1200
1201   }
1202
1203   protected void userIdWidth_actionPerformed()
1204   {
1205     // TODO Auto-generated method stub
1206
1207   }
1208
1209   protected void maxColour_actionPerformed(JPanel panel)
1210   {
1211   }
1212
1213   protected void minColour_actionPerformed(JPanel panel)
1214   {
1215   }
1216
1217   protected void showunconserved_actionPerformed(ActionEvent e)
1218   {
1219     // TODO Auto-generated method stub
1220
1221   }
1222
1223   /**
1224    * DOCUMENT ME!
1225    * 
1226    * @param e
1227    *          DOCUMENT ME!
1228    */
1229   public void ok_actionPerformed(ActionEvent e)
1230   {
1231   }
1232
1233   /**
1234    * DOCUMENT ME!
1235    * 
1236    * @param e
1237    *          DOCUMENT ME!
1238    */
1239   public void cancel_actionPerformed(ActionEvent e)
1240   {
1241   }
1242
1243   /**
1244    * DOCUMENT ME!
1245    * 
1246    * @param e
1247    *          DOCUMENT ME!
1248    */
1249   public void annotations_actionPerformed(ActionEvent e)
1250   {
1251   }
1252
1253   /**
1254    * DOCUMENT ME!
1255    */
1256   public void startupFileTextfield_mouseClicked()
1257   {
1258   }
1259
1260   public void newLink_actionPerformed(ActionEvent e)
1261   {
1262
1263   }
1264
1265   public void editLink_actionPerformed(ActionEvent e)
1266   {
1267
1268   }
1269
1270   public void deleteLink_actionPerformed(ActionEvent e)
1271   {
1272
1273   }
1274
1275   public void defaultBrowser_mouseClicked(MouseEvent e)
1276   {
1277
1278   }
1279
1280   public void linkURLList_keyTyped(KeyEvent e)
1281   {
1282
1283   }
1284
1285   public void useProxy_actionPerformed()
1286   {
1287     proxyServerTB.setEnabled(useProxy.isSelected());
1288     proxyPortTB.setEnabled(useProxy.isSelected());
1289   }
1290
1291 }