JAL-2937 Cygwin path preference, method refactoring
[jalview.git] / src / jalview / jbgui / GPreferences.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ 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.fts.core.FTSDataColumnPreferences;
24 import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
25 import jalview.fts.service.pdb.PDBFTSRestClient;
26 import jalview.gui.JvSwingUtils;
27 import jalview.gui.StructureViewer.ViewerType;
28 import jalview.util.MessageManager;
29 import jalview.util.Platform;
30
31 import java.awt.BorderLayout;
32 import java.awt.Color;
33 import java.awt.Component;
34 import java.awt.Dimension;
35 import java.awt.FlowLayout;
36 import java.awt.Font;
37 import java.awt.GridBagConstraints;
38 import java.awt.GridBagLayout;
39 import java.awt.GridLayout;
40 import java.awt.Insets;
41 import java.awt.Rectangle;
42 import java.awt.event.ActionEvent;
43 import java.awt.event.ActionListener;
44 import java.awt.event.KeyEvent;
45 import java.awt.event.MouseAdapter;
46 import java.awt.event.MouseEvent;
47
48 import javax.swing.AbstractButton;
49 import javax.swing.AbstractCellEditor;
50 import javax.swing.BorderFactory;
51 import javax.swing.ButtonGroup;
52 import javax.swing.DefaultListCellRenderer;
53 import javax.swing.JButton;
54 import javax.swing.JCheckBox;
55 import javax.swing.JComboBox;
56 import javax.swing.JFileChooser;
57 import javax.swing.JLabel;
58 import javax.swing.JPanel;
59 import javax.swing.JRadioButton;
60 import javax.swing.JScrollPane;
61 import javax.swing.JTabbedPane;
62 import javax.swing.JTable;
63 import javax.swing.JTextField;
64 import javax.swing.ListSelectionModel;
65 import javax.swing.SwingConstants;
66 import javax.swing.border.Border;
67 import javax.swing.border.EmptyBorder;
68 import javax.swing.border.EtchedBorder;
69 import javax.swing.border.TitledBorder;
70 import javax.swing.event.ChangeEvent;
71 import javax.swing.event.ChangeListener;
72 import javax.swing.table.TableCellEditor;
73 import javax.swing.table.TableCellRenderer;
74
75 /**
76  * Base class for the Preferences panel.
77  * 
78  * @author $author$
79  * @version $Revision$
80  */
81 public class GPreferences extends JPanel
82 {
83   private static final Font LABEL_FONT = JvSwingUtils.getLabelFont();
84
85   private static final Font LABEL_FONT_ITALIC = JvSwingUtils
86           .getLabelFont(false, true);
87
88   /*
89    * Visual tab components
90    */
91   protected JCheckBox fullScreen = new JCheckBox();
92
93   protected JCheckBox openoverv = new JCheckBox();
94
95   protected JCheckBox seqLimit = new JCheckBox();
96
97   protected JCheckBox rightAlign = new JCheckBox();
98
99   protected JComboBox<String> fontSizeCB = new JComboBox<>();
100
101   protected JComboBox<String> fontStyleCB = new JComboBox<>();
102
103   protected JComboBox<String> fontNameCB = new JComboBox<>();
104
105   protected JCheckBox showOccupancy = new JCheckBox();
106
107   protected JCheckBox showUnconserved = new JCheckBox();
108
109   protected JCheckBox idItalics = new JCheckBox();
110
111   protected JCheckBox smoothFont = new JCheckBox();
112
113   protected JCheckBox scaleProteinToCdna = new JCheckBox();
114
115   protected JComboBox<String> gapSymbolCB = new JComboBox<>();
116
117   protected JCheckBox wrap = new JCheckBox();
118
119   protected JComboBox<String> sortby = new JComboBox<>();
120
121   protected JComboBox<String> sortAnnBy = new JComboBox<>();
122
123   protected JComboBox<String> sortAutocalc = new JComboBox<>();
124
125   protected JCheckBox startupCheckbox = new JCheckBox();
126
127   protected JTextField startupFileTextfield = new JTextField();
128
129   // below are in the 'second column'
130   protected JCheckBox annotations = new JCheckBox();
131
132   protected JCheckBox quality = new JCheckBox();
133
134   protected JCheckBox conservation = new JCheckBox();
135
136   protected JCheckBox identity = new JCheckBox();
137
138   protected JCheckBox showGroupConsensus = new JCheckBox();
139
140   protected JCheckBox showGroupConservation = new JCheckBox();
141
142   protected JCheckBox showConsensHistogram = new JCheckBox();
143
144   protected JCheckBox showConsensLogo = new JCheckBox();
145
146   protected JCheckBox showInformationHistogram = new JCheckBox();
147
148   protected JCheckBox showHMMLogo = new JCheckBox();
149
150   protected JCheckBox showDbRefTooltip = new JCheckBox();
151
152   protected JCheckBox showNpTooltip = new JCheckBox();
153
154
155   /*
156    * Structure tab and components
157    */
158   protected JPanel structureTab;
159
160   protected JCheckBox structFromPdb = new JCheckBox();
161
162   protected JCheckBox useRnaView = new JCheckBox();
163
164   protected JCheckBox addSecondaryStructure = new JCheckBox();
165
166   protected JCheckBox addTempFactor = new JCheckBox();
167
168   protected JComboBox<String> structViewer = new JComboBox<>();
169
170   protected JTextField chimeraPath = new JTextField();
171
172   protected ButtonGroup mappingMethod = new ButtonGroup();
173
174   protected JRadioButton siftsMapping = new JRadioButton();
175
176   protected JRadioButton nwMapping = new JRadioButton();
177
178   /*
179    * Colours tab components
180    */
181   protected JPanel minColour = new JPanel();
182
183   protected JPanel maxColour = new JPanel();
184
185   protected JComboBox<String> protColour = new JComboBox<>();
186
187   protected JComboBox<String> nucColour = new JComboBox<>();
188
189   /*
190    * Overview tab components
191    */
192   protected JPanel gapColour = new JPanel();
193
194   protected JPanel hiddenColour = new JPanel();
195
196   protected JCheckBox useLegacyGap;
197
198   protected JCheckBox showHiddenAtStart;
199
200   protected JLabel gapLabel;
201
202   /*
203    * Connections tab components
204    */
205   protected JTable linkUrlTable = new JTable();
206
207   protected JButton editLink = new JButton();
208
209   protected JButton deleteLink = new JButton();
210
211   protected JTextField filterTB = new JTextField();
212
213   protected JButton doReset = new JButton();
214
215   protected JButton userOnly = new JButton();
216
217   protected JLabel portLabel = new JLabel();
218
219   protected JLabel serverLabel = new JLabel();
220
221   protected JTextField proxyServerTB = new JTextField();
222
223   protected JTextField proxyPortTB = new JTextField();
224
225   protected JTextField defaultBrowser = new JTextField();
226
227   protected JCheckBox useProxy = new JCheckBox();
228
229   protected JCheckBox usagestats = new JCheckBox();
230
231   protected JCheckBox questionnaire = new JCheckBox();
232
233   protected JCheckBox versioncheck = new JCheckBox();
234
235   /*
236    * Output tab components
237    */
238   protected JComboBox<Object> epsRendering = new JComboBox<>();
239
240   protected JLabel userIdWidthlabel = new JLabel();
241
242   protected JCheckBox autoIdWidth = new JCheckBox();
243
244   protected JTextField userIdWidth = new JTextField();
245
246   protected JCheckBox blcjv = new JCheckBox();
247
248   protected JCheckBox pileupjv = new JCheckBox();
249
250   protected JCheckBox clustaljv = new JCheckBox();
251
252   protected JCheckBox msfjv = new JCheckBox();
253
254   protected JCheckBox fastajv = new JCheckBox();
255
256   protected JCheckBox pfamjv = new JCheckBox();
257
258   protected JCheckBox pirjv = new JCheckBox();
259
260   protected JCheckBox modellerOutput = new JCheckBox();
261
262   protected JCheckBox embbedBioJSON = new JCheckBox();
263
264   /*
265    * Editing tab components
266    */
267   protected JCheckBox autoCalculateConsCheck = new JCheckBox();
268
269   protected JCheckBox padGaps = new JCheckBox();
270
271   protected JCheckBox sortByTree = new JCheckBox();
272
273   /*
274    * hmmer tab and components
275    */
276   protected JPanel hmmerTab = new JPanel();
277
278   protected JCheckBox hmmrTrimTermini = new JCheckBox();
279
280   protected AbstractButton hmmerBackgroundUniprot = new JCheckBox();
281
282   protected AbstractButton hmmerBackgroundAlignment = new JCheckBox();
283
284   protected JTextField hmmerSequenceCount = new JTextField();
285
286   protected JTextField hmmerPath = new JTextField();
287
288   protected JTextField cygwinPath = new JTextField();
289
290   /*
291    * DAS Settings tab
292    */
293   protected JPanel dasTab = new JPanel();
294
295   /*
296    * Web Services tab
297    */
298   protected JPanel wsTab = new JPanel();
299
300
301
302   /**
303    * Creates a new GPreferences object.
304    */
305   public GPreferences()
306   {
307     try
308     {
309       jbInit();
310     } catch (Exception ex)
311     {
312       ex.printStackTrace();
313     }
314   }
315
316   /**
317    * Construct the panel and its tabbed sub-panels.
318    * 
319    * @throws Exception
320    */
321   private void jbInit() throws Exception
322   {
323     final JTabbedPane tabbedPane = new JTabbedPane();
324     this.setLayout(new BorderLayout());
325     JPanel okCancelPanel = initOkCancelPanel();
326     this.add(tabbedPane, BorderLayout.CENTER);
327     this.add(okCancelPanel, BorderLayout.SOUTH);
328
329     tabbedPane.add(initVisualTab(),
330             MessageManager.getString("label.visual"));
331
332     tabbedPane.add(initColoursTab(),
333             MessageManager.getString("label.colours"));
334
335     tabbedPane.add(initOverviewTab(),
336             MessageManager.getString("label.overview"));
337
338     tabbedPane.add(initStructureTab(),
339             MessageManager.getString("label.structure"));
340
341     tabbedPane.add(initConnectionsTab(),
342             MessageManager.getString("label.connections"));
343
344     tabbedPane.add(initLinksTab(),
345             MessageManager.getString("label.urllinks"));
346
347     tabbedPane.add(initOutputTab(),
348             MessageManager.getString("label.output"));
349
350     tabbedPane.add(initEditingTab(),
351             MessageManager.getString("label.editing"));
352
353     tabbedPane.add(initHMMERTab(), MessageManager.getString("label.hmmer"));
354
355     /*
356      * See DasSourceBrowser for the real work of configuring this tab.
357      */
358     dasTab.setLayout(new BorderLayout());
359     tabbedPane.add(dasTab, MessageManager.getString("label.das_settings"));
360
361     /*
362      * See WsPreferences for the real work of configuring this tab.
363      */
364     wsTab.setLayout(new BorderLayout());
365     tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
366
367     /*
368      * Handler to validate a tab before leaving it - currently only for
369      * Structure
370      */
371     tabbedPane.addChangeListener(new ChangeListener()
372     {
373       private Component lastTab;
374
375       @Override
376       public void stateChanged(ChangeEvent e)
377       {
378         if (lastTab == structureTab
379                 && tabbedPane.getSelectedComponent() != structureTab)
380         {
381           if (!validateStructure())
382           {
383             tabbedPane.setSelectedComponent(structureTab);
384             return;
385           }
386         }
387         lastTab = tabbedPane.getSelectedComponent();
388       }
389
390     });
391   }
392
393   /**
394    * Initialises the Editing tabbed panel.
395    * 
396    * @return
397    */
398   private JPanel initEditingTab()
399   {
400     JPanel editingTab = new JPanel();
401     editingTab.setLayout(null);
402     autoCalculateConsCheck.setFont(LABEL_FONT);
403     autoCalculateConsCheck.setText(
404             MessageManager.getString("label.autocalculate_consensus"));
405     autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
406     padGaps.setFont(LABEL_FONT);
407     padGaps.setText(
408             MessageManager.getString("label.pad_gaps_when_editing"));
409     padGaps.setBounds(new Rectangle(22, 94, 168, 23));
410     sortByTree.setFont(LABEL_FONT);
411     sortByTree
412             .setText(MessageManager.getString("label.sort_with_new_tree"));
413     sortByTree.setToolTipText(MessageManager.getString(
414             "label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
415     sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
416     editingTab.add(autoCalculateConsCheck);
417     editingTab.add(padGaps);
418     editingTab.add(sortByTree);
419     return editingTab;
420   }
421
422   /**
423    * Initialises the hmmer tabbed panel
424    * 
425    * @return
426    */
427   private JPanel initHMMERTab()
428   {
429     hmmerTab.setLayout(null);
430     final int lineSpacing = 20;
431
432     /*
433      * path to hmmer binaries folder
434      */
435     JLabel hmmerLocation = new JLabel(
436             MessageManager.getString("label.hmmer_location"));
437     hmmerLocation.setFont(LABEL_FONT);
438     int xPos = 22;
439     int yPos = 10;
440     hmmerLocation.setBounds(new Rectangle(xPos, yPos, 250, 23));
441     yPos += lineSpacing;
442     hmmerPath.setBounds(new Rectangle(xPos, yPos, 300, 23));
443     hmmerPath.addMouseListener(new MouseAdapter()
444     {
445       @Override
446       public void mouseClicked(MouseEvent e)
447       {
448         if (e.getClickCount() == 2)
449         {
450           String chosen = openFileChooser(true);
451           if (chosen != null)
452           {
453             hmmerPath.setText(chosen);
454             validateHmmerPath();
455           }
456         }
457       }
458     });
459     hmmerTab.add(hmmerLocation);
460     hmmerTab.add(hmmerPath);
461
462     /*
463      * path to Cygwin binaries folder (for Windows)
464      */
465     if (Platform.isWindows())
466     {
467       JLabel cygwinLocation = new JLabel(
468               MessageManager.getString("label.cygwin_location"));
469       cygwinLocation.setFont(LABEL_FONT);
470       yPos += lineSpacing * 2;
471       cygwinLocation.setBounds(new Rectangle(xPos, yPos, 250, 23));
472       yPos += lineSpacing;
473       cygwinPath.setBounds(new Rectangle(xPos, yPos, 300, 23));
474       cygwinPath.addMouseListener(new MouseAdapter()
475       {
476         @Override
477         public void mouseClicked(MouseEvent e)
478         {
479           if (e.getClickCount() == 2)
480           {
481             String chosen = openFileChooser(true);
482             if (chosen != null)
483             {
484               cygwinPath.setText(chosen);
485               validateCygwinPath();
486             }
487           }
488         }
489       });
490       hmmerTab.add(cygwinLocation);
491       hmmerTab.add(cygwinPath);
492     }
493
494     /*
495      * preferences for hmmalign
496      */
497     yPos += lineSpacing * 2;
498     JPanel alignOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
499     JvSwingUtils.createTitledBorder(alignOptions,
500             MessageManager.getString("label.hmmalign_label"), true);
501     yPos += lineSpacing;
502     hmmrTrimTermini.setFont(LABEL_FONT);
503     hmmrTrimTermini.setText(MessageManager.getString("label.trim_termini"));
504     alignOptions.add(hmmrTrimTermini);
505     hmmerTab.add(alignOptions);
506     alignOptions.setBounds(new Rectangle(xPos, yPos, 300, 43));
507
508     /*
509      * preferences for hmmsearch
510      */
511     yPos += lineSpacing * 3;
512     JPanel searchOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
513     JvSwingUtils.createTitledBorder(searchOptions,
514             MessageManager.getString("label.hmmsearch_label"), true);
515     searchOptions.setBounds(new Rectangle(xPos, yPos, 300, 43));
516     JLabel sequencesToKeep = new JLabel(
517             MessageManager.getString("label.no_of_sequences"));
518     sequencesToKeep.setFont(LABEL_FONT);
519     // hmmerSequenceCount.setBounds(new Rectangle(xPos + 250, yPos, 60, 23));
520     searchOptions.add(sequencesToKeep);
521     searchOptions.add(hmmerSequenceCount);
522     hmmerTab.add(searchOptions);
523
524     ButtonGroup backgroundFreqSource = new ButtonGroup();
525     backgroundFreqSource.add(hmmerBackgroundUniprot);
526     backgroundFreqSource.add(hmmerBackgroundAlignment);
527     backgroundFreqSource.setSelected(hmmerBackgroundUniprot.getModel(), true);
528
529     /*
530      * preferences for Information Content annotation
531      */
532     yPos += lineSpacing * 3;
533     hmmerBackgroundUniprot.setText(MessageManager.getString("label.freq_uniprot"));
534     hmmerBackgroundUniprot.setFont(LABEL_FONT);
535     hmmerBackgroundUniprot.setBounds(new Rectangle(xPos, yPos, 255, 23));
536
537     yPos += lineSpacing;
538     hmmerBackgroundAlignment.setText(MessageManager.getString("label.freq_alignment"));
539     hmmerBackgroundAlignment.setFont(LABEL_FONT);
540     hmmerBackgroundAlignment.setBounds(new Rectangle(xPos, yPos, 300, 23));
541
542     hmmerTab.add(hmmerBackgroundUniprot);
543     hmmerTab.add(hmmerBackgroundAlignment);
544
545     return hmmerTab;
546   }
547
548   /**
549    * Initialises the Output tabbed panel.
550    * 
551    * @return
552    */
553   private JPanel initOutputTab()
554   {
555     JPanel outputTab = new JPanel();
556     outputTab.setLayout(null);
557     JLabel epsLabel = new JLabel();
558     epsLabel.setFont(LABEL_FONT);
559     epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
560     epsLabel.setText(MessageManager.getString("label.eps_rendering_style"));
561     epsLabel.setBounds(new Rectangle(9, 31, 140, 24));
562     epsRendering.setFont(LABEL_FONT);
563     epsRendering.setBounds(new Rectangle(154, 34, 187, 21));
564     JLabel jLabel1 = new JLabel();
565     jLabel1.setFont(LABEL_FONT);
566     jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
567     jLabel1.setText(MessageManager.getString("label.append_start_end"));
568     jLabel1.setFont(LABEL_FONT);
569     fastajv.setFont(LABEL_FONT);
570     fastajv.setHorizontalAlignment(SwingConstants.LEFT);
571     clustaljv.setText(MessageManager.getString("label.clustal") + "     ");
572     blcjv.setText(MessageManager.getString("label.blc") + "     ");
573     fastajv.setText(MessageManager.getString("label.fasta") + "     ");
574     msfjv.setText(MessageManager.getString("label.msf") + "     ");
575     pfamjv.setText(MessageManager.getString("label.pfam") + "     ");
576     pileupjv.setText(MessageManager.getString("label.pileup") + "     ");
577     msfjv.setFont(LABEL_FONT);
578     msfjv.setHorizontalAlignment(SwingConstants.LEFT);
579     pirjv.setText(MessageManager.getString("label.pir") + "     ");
580     JPanel jPanel11 = new JPanel();
581     jPanel11.setFont(LABEL_FONT);
582     TitledBorder titledBorder2 = new TitledBorder(
583             MessageManager.getString("label.file_output"));
584     jPanel11.setBorder(titledBorder2);
585     jPanel11.setBounds(new Rectangle(30, 72, 196, 182));
586     GridLayout gridLayout3 = new GridLayout();
587     jPanel11.setLayout(gridLayout3);
588     gridLayout3.setRows(8);
589     blcjv.setFont(LABEL_FONT);
590     blcjv.setHorizontalAlignment(SwingConstants.LEFT);
591     clustaljv.setFont(LABEL_FONT);
592     clustaljv.setHorizontalAlignment(SwingConstants.LEFT);
593     pfamjv.setFont(LABEL_FONT);
594     pfamjv.setHorizontalAlignment(SwingConstants.LEFT);
595     pileupjv.setFont(LABEL_FONT);
596     pileupjv.setHorizontalAlignment(SwingConstants.LEFT);
597     pirjv.setFont(LABEL_FONT);
598     pirjv.setHorizontalAlignment(SwingConstants.LEFT);
599     autoIdWidth.setFont(LABEL_FONT);
600     autoIdWidth.setText(
601             MessageManager.getString("label.automatically_set_id_width"));
602     autoIdWidth.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager
603             .getString("label.adjusts_width_generated_eps_png")));
604     autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23));
605     autoIdWidth.addActionListener(new ActionListener()
606     {
607
608       @Override
609       public void actionPerformed(ActionEvent e)
610       {
611         autoIdWidth_actionPerformed();
612       }
613     });
614     userIdWidthlabel.setFont(LABEL_FONT);
615     userIdWidthlabel.setText(
616             MessageManager.getString("label.figure_id_column_width"));
617     userIdWidth.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager
618             .getString("label.manually_specify_width_left_column")));
619     userIdWidthlabel.setToolTipText(
620             JvSwingUtils.wrapTooltip(true, MessageManager.getString(
621                     "label.manually_specify_width_left_column")));
622     userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23));
623     userIdWidth.setFont(JvSwingUtils.getTextAreaFont());
624     userIdWidth.setText("");
625     userIdWidth.setBounds(new Rectangle(232, 144, 84, 23));
626     userIdWidth.addActionListener(new ActionListener()
627     {
628
629       @Override
630       public void actionPerformed(ActionEvent e)
631       {
632         userIdWidth_actionPerformed();
633       }
634     });
635     modellerOutput.setFont(LABEL_FONT);
636     modellerOutput
637             .setText(MessageManager.getString("label.use_modeller_output"));
638     modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
639     embbedBioJSON.setFont(LABEL_FONT);
640     embbedBioJSON.setText(MessageManager.getString("label.embbed_biojson"));
641     embbedBioJSON.setBounds(new Rectangle(228, 200, 250, 23));
642
643     jPanel11.add(jLabel1);
644     jPanel11.add(blcjv);
645     jPanel11.add(clustaljv);
646     jPanel11.add(fastajv);
647     jPanel11.add(msfjv);
648     jPanel11.add(pfamjv);
649     jPanel11.add(pileupjv);
650     jPanel11.add(pirjv);
651     outputTab.add(autoIdWidth);
652     outputTab.add(userIdWidth);
653     outputTab.add(userIdWidthlabel);
654     outputTab.add(modellerOutput);
655     outputTab.add(embbedBioJSON);
656     outputTab.add(epsLabel);
657     outputTab.add(epsRendering);
658     outputTab.add(jPanel11);
659     return outputTab;
660   }
661
662   /**
663    * Initialises the Connections tabbed panel.
664    * 
665    * @return
666    */
667   private JPanel initConnectionsTab()
668   {
669     JPanel connectTab = new JPanel();
670     connectTab.setLayout(new GridBagLayout());
671
672     // Label for browser text box
673     JLabel browserLabel = new JLabel();
674     browserLabel.setFont(LABEL_FONT);
675     browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
676     browserLabel.setText(
677             MessageManager.getString("label.default_browser_unix"));
678     defaultBrowser.setFont(LABEL_FONT);
679     defaultBrowser.setText("");
680
681     defaultBrowser.addMouseListener(new MouseAdapter()
682     {
683       @Override
684       public void mouseClicked(MouseEvent e)
685       {
686         if (e.getClickCount() > 1)
687         {
688           defaultBrowser_mouseClicked(e);
689         }
690       }
691     });
692
693     JPanel proxyPanel = initConnTabProxyPanel();
694     initConnTabCheckboxes();
695
696     // Add default Browser text box
697     connectTab.add(browserLabel,
698             new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
699                     GridBagConstraints.WEST, GridBagConstraints.NONE,
700                     new Insets(10, 0, 5, 5), 5, 1));
701     defaultBrowser.setFont(LABEL_FONT);
702     defaultBrowser.setText("");
703
704     connectTab.add(defaultBrowser, new GridBagConstraints(1, 0, 1, 1, 1.0,
705             0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
706             new Insets(10, 0, 5, 10), 30, 1));
707
708     // Add proxy server panel
709     connectTab.add(proxyPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0,
710             GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
711             new Insets(10, 0, 5, 12), 4, 10));
712
713     // Add usage stats, version check and questionnaire checkboxes
714     connectTab.add(usagestats,
715             new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0,
716                     GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
717                     new Insets(0, 2, 5, 5), 70, 1));
718     connectTab.add(questionnaire,
719             new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0,
720                     GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
721                     new Insets(0, 2, 5, 10), 70, 1));
722     connectTab.add(versioncheck,
723             new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0,
724                     GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
725                     new Insets(0, 2, 5, 5), 70, 1));
726
727     // Add padding so the panel doesn't look ridiculous
728     JPanel spacePanel = new JPanel();
729     connectTab.add(spacePanel,
730             new GridBagConstraints(0, 4, 1, 1, 1.0, 1.0,
731                     GridBagConstraints.WEST, GridBagConstraints.BOTH,
732                     new Insets(0, 0, 0, 5), 70, 1));
733
734     return connectTab;
735   }
736
737   /**
738    * Initialises the Links tabbed panel.
739    * 
740    * @return
741    */
742   private JPanel initLinksTab()
743   {
744     JPanel linkTab = new JPanel();
745     linkTab.setLayout(new GridBagLayout());
746
747     // Set up table for Url links
748     linkUrlTable.setFillsViewportHeight(true);
749     linkUrlTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
750     linkUrlTable.setAutoCreateRowSorter(true);
751     linkUrlTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
752
753     // adjust row height so radio buttons actually fit
754     // don't do this in the renderer, it causes the awt thread to activate
755     // constantly
756     JRadioButton temp = new JRadioButton();
757     linkUrlTable.setRowHeight(temp.getMinimumSize().height);
758
759     // Table in scrollpane so that the table is given a scrollbar
760     JScrollPane linkScrollPane = new JScrollPane(linkUrlTable);
761     linkScrollPane.setBorder(null);
762
763     // Panel for links functionality
764     JPanel linkPanel = new JPanel(new GridBagLayout());
765     linkPanel.setBorder(new TitledBorder(
766             MessageManager.getString("label.url_linkfrom_sequence_id")));
767
768     // Put the Url links panel together
769
770     // Buttons go at top right, resizing only resizes the blank space vertically
771     JPanel buttonPanel = initLinkTabUrlButtons();
772     GridBagConstraints linkConstraints1 = new GridBagConstraints();
773     linkConstraints1.insets = new Insets(0, 0, 5, 0);
774     linkConstraints1.gridx = 0;
775     linkConstraints1.gridy = 0;
776     linkConstraints1.weightx = 1.0;
777     linkConstraints1.fill = GridBagConstraints.HORIZONTAL;
778     linkTab.add(buttonPanel, linkConstraints1);
779
780     // Links table goes at top left, resizing resizes the table
781     GridBagConstraints linkConstraints2 = new GridBagConstraints();
782     linkConstraints2.insets = new Insets(0, 0, 5, 5);
783     linkConstraints2.gridx = 0;
784     linkConstraints2.gridy = 1;
785     linkConstraints2.weightx = 1.0;
786     linkConstraints2.weighty = 1.0;
787     linkConstraints2.fill = GridBagConstraints.BOTH;
788     linkTab.add(linkScrollPane, linkConstraints2);
789
790     // Filter box and buttons goes at bottom left, resizing resizes the text box
791     JPanel filterPanel = initLinkTabFilterPanel();
792     GridBagConstraints linkConstraints3 = new GridBagConstraints();
793     linkConstraints3.insets = new Insets(0, 0, 0, 5);
794     linkConstraints3.gridx = 0;
795     linkConstraints3.gridy = 2;
796     linkConstraints3.weightx = 1.0;
797     linkConstraints3.fill = GridBagConstraints.HORIZONTAL;
798     linkTab.add(filterPanel, linkConstraints3);
799
800     return linkTab;
801   }
802
803   private JPanel initLinkTabFilterPanel()
804   {
805     // Filter textbox and reset button
806     JLabel filterLabel = new JLabel(
807             MessageManager.getString("label.filter"));
808     filterLabel.setFont(LABEL_FONT);
809     filterLabel.setHorizontalAlignment(SwingConstants.RIGHT);
810     filterLabel.setHorizontalTextPosition(SwingConstants.LEADING);
811
812     filterTB.setFont(LABEL_FONT);
813     filterTB.setText("");
814
815     doReset.setText(MessageManager.getString("action.showall"));
816     userOnly.setText(MessageManager.getString("action.customfilter"));
817
818     // Panel for filter functionality
819     JPanel filterPanel = new JPanel(new GridBagLayout());
820     filterPanel.setBorder(new TitledBorder("Filter"));
821     GridBagConstraints gbc = new GridBagConstraints();
822     gbc.gridx = 0;
823     gbc.gridy = 0;
824     gbc.fill = GridBagConstraints.NONE;
825     gbc.anchor = GridBagConstraints.WEST;
826
827     filterPanel.add(filterLabel, gbc);
828
829     GridBagConstraints gbc1 = new GridBagConstraints();
830     gbc1.gridx = 1;
831     gbc1.gridwidth = 2;
832     gbc1.fill = GridBagConstraints.HORIZONTAL;
833     gbc1.anchor = GridBagConstraints.WEST;
834     gbc1.weightx = 1.0;
835     filterPanel.add(filterTB, gbc1);
836
837     GridBagConstraints gbc2 = new GridBagConstraints();
838     gbc2.gridx = 3;
839     gbc2.fill = GridBagConstraints.NONE;
840     gbc2.anchor = GridBagConstraints.WEST;
841     filterPanel.add(doReset, gbc2);
842
843     GridBagConstraints gbc3 = new GridBagConstraints();
844     gbc3.gridx = 4;
845     gbc3.fill = GridBagConstraints.NONE;
846     gbc3.anchor = GridBagConstraints.WEST;
847     filterPanel.add(userOnly, gbc3);
848
849     return filterPanel;
850   }
851
852   private JPanel initLinkTabUrlButtons()
853   {
854     // Buttons for new / edit / delete Url links
855     JButton newLink = new JButton();
856     newLink.setText(MessageManager.getString("action.new"));
857
858     editLink.setText(MessageManager.getString("action.edit"));
859
860     deleteLink.setText(MessageManager.getString("action.delete"));
861
862     // no current selection, so initially disable delete/edit buttons
863     editLink.setEnabled(false);
864     deleteLink.setEnabled(false);
865
866     newLink.addActionListener(new java.awt.event.ActionListener()
867     {
868       @Override
869       public void actionPerformed(ActionEvent e)
870       {
871         newLink_actionPerformed(e);
872       }
873     });
874
875     editLink.setText(MessageManager.getString("action.edit"));
876     editLink.addActionListener(new java.awt.event.ActionListener()
877     {
878       @Override
879       public void actionPerformed(ActionEvent e)
880       {
881         editLink_actionPerformed(e);
882       }
883     });
884
885     deleteLink.setText(MessageManager.getString("action.delete"));
886     deleteLink.addActionListener(new java.awt.event.ActionListener()
887     {
888       @Override
889       public void actionPerformed(ActionEvent e)
890       {
891         deleteLink_actionPerformed(e);
892       }
893     });
894
895     JPanel buttonPanel = new JPanel(new GridBagLayout());
896     buttonPanel.setBorder(new TitledBorder("Edit links"));
897     GridBagConstraints gbc = new GridBagConstraints();
898     gbc.gridx = 0;
899     gbc.gridy = 0;
900     gbc.fill = GridBagConstraints.NONE;
901     buttonPanel.add(newLink, gbc);
902
903     GridBagConstraints gbc1 = new GridBagConstraints();
904     gbc1.gridx = 1;
905     gbc1.gridy = 0;
906     gbc1.fill = GridBagConstraints.NONE;
907     buttonPanel.add(editLink, gbc1);
908
909     GridBagConstraints gbc2 = new GridBagConstraints();
910     gbc2.gridx = 2;
911     gbc2.gridy = 0;
912     gbc2.fill = GridBagConstraints.NONE;
913     buttonPanel.add(deleteLink, gbc2);
914
915     GridBagConstraints gbc3 = new GridBagConstraints();
916     gbc3.gridx = 3;
917     gbc3.gridy = 0;
918     gbc3.fill = GridBagConstraints.HORIZONTAL;
919     gbc3.weightx = 1.0;
920     JPanel spacePanel = new JPanel();
921     spacePanel.setBorder(null);
922     buttonPanel.add(spacePanel, gbc3);
923
924     return buttonPanel;
925   }
926
927   /**
928    * Initialises the proxy server panel in the Connections tab
929    * 
930    * @return the proxy server panel
931    */
932   private JPanel initConnTabProxyPanel()
933   {
934     // Label for server text box
935     serverLabel.setText(MessageManager.getString("label.address"));
936     serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
937     serverLabel.setFont(LABEL_FONT);
938
939     // Proxy server and port text boxes
940     proxyServerTB.setFont(LABEL_FONT);
941     proxyPortTB.setFont(LABEL_FONT);
942
943     // Label for Port text box
944     portLabel.setFont(LABEL_FONT);
945     portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
946     portLabel.setText(MessageManager.getString("label.port"));
947
948     // Use proxy server checkbox
949     useProxy.setFont(LABEL_FONT);
950     useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
951     useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
952     useProxy.setText(MessageManager.getString("label.use_proxy_server"));
953     useProxy.addActionListener(new ActionListener()
954     {
955       @Override
956       public void actionPerformed(ActionEvent e)
957       {
958         useProxy_actionPerformed();
959       }
960     });
961
962     // Make proxy server panel
963     JPanel proxyPanel = new JPanel();
964     TitledBorder titledBorder1 = new TitledBorder(
965             MessageManager.getString("label.proxy_server"));
966     proxyPanel.setBorder(titledBorder1);
967     proxyPanel.setLayout(new GridBagLayout());
968     proxyPanel.add(serverLabel,
969             new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
970                     GridBagConstraints.WEST, GridBagConstraints.NONE,
971                     new Insets(0, 2, 2, 0), 5, 0));
972     proxyPanel.add(portLabel,
973             new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
974                     GridBagConstraints.WEST, GridBagConstraints.NONE,
975                     new Insets(0, 0, 2, 0), 11, 0));
976     proxyPanel.add(useProxy,
977             new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
978                     GridBagConstraints.WEST, GridBagConstraints.NONE,
979                     new Insets(0, 2, 5, 185), 2, -4));
980     proxyPanel.add(proxyPortTB,
981             new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
982                     GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
983                     new Insets(0, 2, 2, 2), 54, 1));
984     proxyPanel.add(proxyServerTB,
985             new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
986                     GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
987                     new Insets(0, 2, 2, 0), 263, 1));
988
989     return proxyPanel;
990   }
991
992   /**
993    * Initialises the checkboxes in the Connections tab
994    */
995   private void initConnTabCheckboxes()
996   {
997     // Usage stats checkbox label
998     usagestats.setText(
999             MessageManager.getString("label.send_usage_statistics"));
1000     usagestats.setFont(LABEL_FONT);
1001     usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
1002     usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
1003
1004     // Questionnaire checkbox label
1005     questionnaire.setText(
1006             MessageManager.getString("label.check_for_questionnaires"));
1007     questionnaire.setFont(LABEL_FONT);
1008     questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
1009     questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
1010
1011     // Check for latest version checkbox label
1012     versioncheck.setText(
1013             MessageManager.getString("label.check_for_latest_version"));
1014     versioncheck.setFont(LABEL_FONT);
1015     versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
1016     versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
1017   }
1018
1019   /**
1020    * Initialises the parent panel which contains the tabbed sections.
1021    * 
1022    * @return
1023    */
1024   private JPanel initOkCancelPanel()
1025   {
1026     JButton ok = new JButton();
1027     ok.setText(MessageManager.getString("action.ok"));
1028     ok.addActionListener(new ActionListener()
1029     {
1030       @Override
1031       public void actionPerformed(ActionEvent e)
1032       {
1033         ok_actionPerformed(e);
1034       }
1035     });
1036     JButton cancel = new JButton();
1037     cancel.setText(MessageManager.getString("action.cancel"));
1038     cancel.addActionListener(new ActionListener()
1039     {
1040       @Override
1041       public void actionPerformed(ActionEvent e)
1042       {
1043         cancel_actionPerformed(e);
1044       }
1045     });
1046     JPanel okCancelPanel = new JPanel();
1047     okCancelPanel.add(ok);
1048     okCancelPanel.add(cancel);
1049     return okCancelPanel;
1050   }
1051
1052   /**
1053    * Initialises the Colours tabbed panel.
1054    * 
1055    * @return
1056    */
1057   private JPanel initColoursTab()
1058   {
1059     JPanel coloursTab = new JPanel();
1060     coloursTab.setBorder(new TitledBorder(
1061             MessageManager.getString("action.open_new_alignment")));
1062     coloursTab.setLayout(new FlowLayout());
1063     JLabel mincolourLabel = new JLabel();
1064     mincolourLabel.setFont(LABEL_FONT);
1065     mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1066     mincolourLabel.setText(MessageManager.getString("label.min_colour"));
1067     minColour.setFont(LABEL_FONT);
1068     minColour.setBorder(BorderFactory.createEtchedBorder());
1069     minColour.setPreferredSize(new Dimension(40, 20));
1070     minColour.addMouseListener(new MouseAdapter()
1071     {
1072       @Override
1073       public void mousePressed(MouseEvent e)
1074       {
1075         minColour_actionPerformed(minColour);
1076       }
1077     });
1078     JLabel maxcolourLabel = new JLabel();
1079     maxcolourLabel.setFont(LABEL_FONT);
1080     maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1081     maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
1082     maxColour.setFont(LABEL_FONT);
1083     maxColour.setBorder(BorderFactory.createEtchedBorder());
1084     maxColour.setPreferredSize(new Dimension(40, 20));
1085     maxColour.addMouseListener(new MouseAdapter()
1086     {
1087       @Override
1088       public void mousePressed(MouseEvent e)
1089       {
1090         maxColour_actionPerformed(maxColour);
1091       }
1092     });
1093
1094     protColour.setFont(LABEL_FONT);
1095     protColour.setBounds(new Rectangle(172, 225, 155, 21));
1096     JLabel protColourLabel = new JLabel();
1097     protColourLabel.setFont(LABEL_FONT);
1098     protColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
1099     protColourLabel.setText(
1100             MessageManager.getString("label.prot_alignment_colour") + " ");
1101     JvSwingUtils.addtoLayout(coloursTab,
1102             MessageManager
1103                     .getString("label.default_colour_scheme_for_alignment"),
1104             protColourLabel, protColour);
1105
1106     nucColour.setFont(LABEL_FONT);
1107     nucColour.setBounds(new Rectangle(172, 240, 155, 21));
1108     JLabel nucColourLabel = new JLabel();
1109     nucColourLabel.setFont(LABEL_FONT);
1110     nucColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
1111     nucColourLabel.setText(
1112             MessageManager.getString("label.nuc_alignment_colour") + " ");
1113     JvSwingUtils.addtoLayout(coloursTab,
1114             MessageManager
1115                     .getString("label.default_colour_scheme_for_alignment"),
1116             nucColourLabel, nucColour);
1117
1118     JPanel annotationShding = new JPanel();
1119     annotationShding.setBorder(new TitledBorder(
1120             MessageManager.getString("label.annotation_shading_default")));
1121     annotationShding.setLayout(new GridLayout(1, 2));
1122     JvSwingUtils.addtoLayout(annotationShding,
1123             MessageManager.getString(
1124                     "label.default_minimum_colour_annotation_shading"),
1125             mincolourLabel, minColour);
1126     JvSwingUtils.addtoLayout(annotationShding,
1127             MessageManager.getString(
1128                     "label.default_maximum_colour_annotation_shading"),
1129             maxcolourLabel, maxColour);
1130     coloursTab.add(annotationShding); // , FlowLayout.LEFT);
1131     return coloursTab;
1132   }
1133
1134   /**
1135    * Initialises the Overview tabbed panel.
1136    * 
1137    * @return
1138    */
1139   private JPanel initOverviewTab()
1140   {
1141     JPanel overviewPanel = new JPanel();
1142     overviewPanel.setBorder(new TitledBorder(
1143             MessageManager.getString("label.overview_settings")));
1144
1145     gapColour.setFont(LABEL_FONT);
1146     // fixing the border colours stops apparent colour bleed from the panel
1147     gapColour.setBorder(
1148             BorderFactory.createEtchedBorder(Color.white, Color.lightGray));
1149     gapColour.setPreferredSize(new Dimension(40, 20));
1150     gapColour.addMouseListener(new MouseAdapter()
1151     {
1152       @Override
1153       public void mousePressed(MouseEvent e)
1154       {
1155         gapColour_actionPerformed(gapColour);
1156       }
1157     });
1158
1159     hiddenColour.setFont(LABEL_FONT);
1160     // fixing the border colours stops apparent colour bleed from the panel
1161     hiddenColour.setBorder(
1162             BorderFactory.createEtchedBorder(Color.white, Color.lightGray));
1163     hiddenColour.setPreferredSize(new Dimension(40, 20));
1164     hiddenColour.addMouseListener(new MouseAdapter()
1165     {
1166       @Override
1167       public void mousePressed(MouseEvent e)
1168       {
1169         hiddenColour_actionPerformed(hiddenColour);
1170       }
1171     });
1172     
1173     useLegacyGap = new JCheckBox(
1174             MessageManager.getString("label.ov_legacy_gap"));
1175     useLegacyGap.setFont(LABEL_FONT);
1176     useLegacyGap.setHorizontalAlignment(SwingConstants.LEFT);
1177     useLegacyGap.setVerticalTextPosition(SwingConstants.TOP);
1178     gapLabel = new JLabel(
1179             MessageManager.getString("label.gap_colour"));
1180     gapLabel.setFont(LABEL_FONT);
1181     gapLabel.setHorizontalAlignment(SwingConstants.LEFT);
1182     gapLabel.setVerticalTextPosition(SwingConstants.TOP);
1183     showHiddenAtStart = new JCheckBox(
1184             MessageManager.getString("label.ov_show_hide_default"));
1185     showHiddenAtStart.setFont(LABEL_FONT);
1186     showHiddenAtStart.setHorizontalAlignment(SwingConstants.LEFT);
1187     showHiddenAtStart.setVerticalTextPosition(SwingConstants.TOP);
1188     JLabel hiddenLabel = new JLabel(
1189             MessageManager.getString("label.hidden_colour"));
1190     hiddenLabel.setFont(LABEL_FONT);
1191     hiddenLabel.setHorizontalAlignment(SwingConstants.LEFT);
1192     hiddenLabel.setVerticalTextPosition(SwingConstants.TOP);
1193
1194     useLegacyGap.addActionListener(new ActionListener()
1195     {
1196       @Override
1197       public void actionPerformed(ActionEvent e)
1198       {
1199         useLegacyGaps_actionPerformed(e);
1200       }
1201     });
1202
1203     overviewPanel.setLayout(new GridBagLayout());
1204     GridBagConstraints c1 = new GridBagConstraints();
1205
1206     c1.fill = GridBagConstraints.HORIZONTAL;
1207     c1.gridx = 0;
1208     c1.gridy = 0;
1209     c1.weightx = 1;
1210     c1.ipady = 20;
1211     c1.anchor = GridBagConstraints.FIRST_LINE_START;
1212     overviewPanel.add(useLegacyGap, c1);
1213
1214     GridBagConstraints c2 = new GridBagConstraints();
1215     c2.fill = GridBagConstraints.HORIZONTAL;
1216     c2.gridx = 1;
1217     c2.gridy = 0;
1218     c2.insets = new Insets(0, 15, 0, 10);
1219     overviewPanel.add(gapLabel, c2);
1220
1221     GridBagConstraints c3 = new GridBagConstraints();
1222     c3.fill = GridBagConstraints.HORIZONTAL;
1223     c3.gridx = 2;
1224     c3.gridy = 0;
1225     c3.insets = new Insets(0, 0, 0, 15);
1226     overviewPanel.add(gapColour, c3);
1227
1228     GridBagConstraints c4 = new GridBagConstraints();
1229     c4.fill = GridBagConstraints.HORIZONTAL;
1230     c4.gridx = 0;
1231     c4.gridy = 1;
1232     c4.weightx = 1;
1233     overviewPanel.add(showHiddenAtStart, c4);
1234
1235     GridBagConstraints c5 = new GridBagConstraints();
1236     c5.fill = GridBagConstraints.HORIZONTAL;
1237     c5.gridx = 1;
1238     c5.gridy = 1;
1239     c5.insets = new Insets(0, 15, 0, 10);
1240     overviewPanel.add(hiddenLabel, c5);
1241
1242     GridBagConstraints c6 = new GridBagConstraints();
1243     c6.fill = GridBagConstraints.HORIZONTAL;
1244     c6.gridx = 2;
1245     c6.gridy = 1;
1246     c6.insets = new Insets(0, 0, 0, 15);
1247     overviewPanel.add(hiddenColour, c6);
1248
1249     JButton resetButton = new JButton(
1250             MessageManager.getString("label.reset_to_defaults"));
1251
1252     resetButton.addActionListener(new ActionListener()
1253     {
1254       @Override
1255       public void actionPerformed(ActionEvent e)
1256       {
1257         resetOvDefaults_actionPerformed(e);
1258       }
1259     });
1260
1261     GridBagConstraints c7 = new GridBagConstraints();
1262     c7.fill = GridBagConstraints.NONE;
1263     c7.gridx = 0;
1264     c7.gridy = 2;
1265     c7.insets = new Insets(10, 0, 0, 0);
1266     c7.anchor = GridBagConstraints.WEST;
1267     overviewPanel.add(resetButton, c7);
1268
1269     // Add padding so the panel doesn't look ridiculous
1270     JPanel spacePanel = new JPanel();
1271     overviewPanel.add(spacePanel,
1272             new GridBagConstraints(0, 3, 1, 1, 1.0, 1.0,
1273                     GridBagConstraints.WEST, GridBagConstraints.BOTH,
1274                     new Insets(0, 0, 0, 5), 0, 0));
1275
1276     return overviewPanel;
1277   }
1278
1279   /**
1280    * Initialises the Structure tabbed panel.
1281    * 
1282    * @return
1283    */
1284   private JPanel initStructureTab()
1285   {
1286     structureTab = new JPanel();
1287
1288     structureTab.setBorder(new TitledBorder(
1289             MessageManager.getString("label.structure_options")));
1290     structureTab.setLayout(null);
1291     final int width = 400;
1292     final int height = 22;
1293     final int lineSpacing = 25;
1294     int ypos = 15;
1295
1296     structFromPdb.setFont(LABEL_FONT);
1297     structFromPdb
1298             .setText(MessageManager.getString("label.struct_from_pdb"));
1299     structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
1300     structFromPdb.addActionListener(new ActionListener()
1301     {
1302       @Override
1303       public void actionPerformed(ActionEvent e)
1304       {
1305         boolean selected = structFromPdb.isSelected();
1306         // enable other options only when the first is checked
1307         useRnaView.setEnabled(selected);
1308         addSecondaryStructure.setEnabled(selected);
1309         addTempFactor.setEnabled(selected);
1310       }
1311     });
1312     structureTab.add(structFromPdb);
1313
1314     // indent checkboxes that are conditional on the first one
1315     ypos += lineSpacing;
1316     useRnaView.setFont(LABEL_FONT);
1317     useRnaView.setText(MessageManager.getString("label.use_rnaview"));
1318     useRnaView.setBounds(new Rectangle(25, ypos, width, height));
1319     structureTab.add(useRnaView);
1320
1321     ypos += lineSpacing;
1322     addSecondaryStructure.setFont(LABEL_FONT);
1323     addSecondaryStructure
1324             .setText(MessageManager.getString("label.autoadd_secstr"));
1325     addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
1326     structureTab.add(addSecondaryStructure);
1327
1328     ypos += lineSpacing;
1329     addTempFactor.setFont(LABEL_FONT);
1330     addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
1331     addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
1332     structureTab.add(addTempFactor);
1333
1334     ypos += lineSpacing;
1335     JLabel viewerLabel = new JLabel();
1336     viewerLabel.setFont(LABEL_FONT);
1337     viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
1338     viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
1339     viewerLabel.setBounds(new Rectangle(10, ypos, 200, height));
1340     structureTab.add(viewerLabel);
1341
1342     structViewer.setFont(LABEL_FONT);
1343     structViewer.setBounds(new Rectangle(160, ypos, 120, height));
1344     structViewer.addItem(ViewerType.JMOL.name());
1345     structViewer.addItem(ViewerType.CHIMERA.name());
1346     structViewer.addActionListener(new ActionListener()
1347     {
1348       @Override
1349       public void actionPerformed(ActionEvent e)
1350       {
1351         structureViewer_actionPerformed(
1352                 (String) structViewer.getSelectedItem());
1353       }
1354     });
1355     structureTab.add(structViewer);
1356
1357     ypos += lineSpacing;
1358     JLabel pathLabel = new JLabel();
1359     pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
1360     pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
1361     pathLabel.setText(MessageManager.getString("label.chimera_path"));
1362     final String tooltip = JvSwingUtils.wrapTooltip(true,
1363             MessageManager.getString("label.chimera_path_tip"));
1364     pathLabel.setToolTipText(tooltip);
1365     pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
1366     structureTab.add(pathLabel);
1367
1368     chimeraPath.setFont(LABEL_FONT);
1369     chimeraPath.setText("");
1370     chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
1371     chimeraPath.addMouseListener(new MouseAdapter()
1372     {
1373       @Override
1374       public void mouseClicked(MouseEvent e)
1375       {
1376         if (e.getClickCount() == 2)
1377         {
1378           String chosen = openFileChooser(false);
1379           if (chosen != null)
1380           {
1381             chimeraPath.setText(chosen);
1382           }
1383         }
1384       }
1385     });
1386     structureTab.add(chimeraPath);
1387
1388     ypos += lineSpacing;
1389     nwMapping.setFont(LABEL_FONT);
1390     nwMapping.setText(MessageManager.getString("label.nw_mapping"));
1391     siftsMapping.setFont(LABEL_FONT);
1392     siftsMapping.setText(MessageManager.getString("label.sifts_mapping"));
1393     mappingMethod.add(nwMapping);
1394     mappingMethod.add(siftsMapping);
1395     JPanel mappingPanel = new JPanel();
1396     mappingPanel.setFont(LABEL_FONT);
1397     TitledBorder mmTitledBorder = new TitledBorder(
1398             MessageManager.getString("label.mapping_method"));
1399     mmTitledBorder.setTitleFont(LABEL_FONT);
1400     mappingPanel.setBorder(mmTitledBorder);
1401     mappingPanel.setBounds(new Rectangle(10, ypos, 452, 45));
1402     // GridLayout mappingLayout = new GridLayout();
1403     mappingPanel.setLayout(new GridLayout());
1404     mappingPanel.add(nwMapping);
1405     mappingPanel.add(siftsMapping);
1406     structureTab.add(mappingPanel);
1407
1408     ypos += lineSpacing;
1409     ypos += lineSpacing;
1410     FTSDataColumnPreferences docFieldPref = new FTSDataColumnPreferences(
1411             PreferenceSource.PREFERENCES, PDBFTSRestClient.getInstance());
1412     docFieldPref.setBounds(new Rectangle(10, ypos, 450, 120));
1413     structureTab.add(docFieldPref);
1414
1415     return structureTab;
1416   }
1417
1418   /**
1419    * Action on choosing a structure viewer from combobox options.
1420    * 
1421    * @param selectedItem
1422    */
1423   protected void structureViewer_actionPerformed(String selectedItem)
1424   {
1425   }
1426
1427   /**
1428    * Show a dialog for the user to choose a file. Returns the chosen path, or
1429    * null on Cancel.
1430    * 
1431    * @return
1432    */
1433   protected String openFileChooser(boolean forFolder)
1434   {
1435     String choice = null;
1436     JFileChooser chooser = new JFileChooser();
1437     if (forFolder)
1438     {
1439       chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
1440     }
1441
1442     // chooser.setFileView(new JalviewFileView());
1443     chooser.setDialogTitle(
1444             MessageManager.getString("label.open_local_file"));
1445     chooser.setToolTipText(MessageManager.getString("action.open"));
1446
1447     int value = chooser.showOpenDialog(this);
1448
1449     if (value == JFileChooser.APPROVE_OPTION)
1450     {
1451       choice = chooser.getSelectedFile().getPath();
1452     }
1453     return choice;
1454   }
1455
1456   protected boolean validateStructure()
1457   {
1458     return false;
1459   }
1460
1461   /**
1462    * Initialises the Visual tabbed panel.
1463    * 
1464    * @return
1465    */
1466   private JPanel initVisualTab()
1467   {
1468     JPanel visualTab = new JPanel();
1469     visualTab.setBorder(new TitledBorder(
1470             MessageManager.getString("action.open_new_alignment")));
1471     visualTab.setLayout(null);
1472     fullScreen.setFont(LABEL_FONT);
1473     fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
1474     fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
1475     fullScreen.setText(MessageManager.getString("label.maximize_window"));
1476     quality.setEnabled(false);
1477     quality.setFont(LABEL_FONT);
1478     quality.setHorizontalAlignment(SwingConstants.RIGHT);
1479     quality.setHorizontalTextPosition(SwingConstants.LEFT);
1480     quality.setSelected(true);
1481     quality.setText(MessageManager.getString("label.quality"));
1482     conservation.setEnabled(false);
1483     conservation.setFont(LABEL_FONT);
1484     conservation.setHorizontalAlignment(SwingConstants.RIGHT);
1485     conservation.setHorizontalTextPosition(SwingConstants.LEFT);
1486     conservation.setSelected(true);
1487     conservation.setText(MessageManager.getString("label.conservation"));
1488     identity.setEnabled(false);
1489     identity.setFont(LABEL_FONT);
1490     identity.setHorizontalAlignment(SwingConstants.RIGHT);
1491     identity.setHorizontalTextPosition(SwingConstants.LEFT);
1492     identity.setSelected(true);
1493     identity.setText(MessageManager.getString("label.consensus"));
1494     showOccupancy.setFont(LABEL_FONT);
1495     showOccupancy.setEnabled(false);
1496     showOccupancy.setHorizontalAlignment(SwingConstants.RIGHT);
1497     showOccupancy.setHorizontalTextPosition(SwingConstants.LEFT);
1498     showOccupancy.setSelected(true);
1499     showOccupancy.setText(MessageManager.getString("label.occupancy"));
1500
1501     JLabel showGroupbits = new JLabel();
1502     showGroupbits.setFont(LABEL_FONT);
1503     showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
1504     showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
1505     showGroupbits
1506             .setText(MessageManager.getString("action.show_group") + ":");
1507     JLabel showConsensbits = new JLabel();
1508     showConsensbits.setFont(LABEL_FONT);
1509     showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
1510     showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
1511     showConsensbits
1512             .setText(MessageManager.getString("label.consensus") + ":");
1513     showConsensHistogram.setEnabled(false);
1514     showConsensHistogram.setFont(LABEL_FONT);
1515     showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
1516     showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
1517     showConsensHistogram.setSelected(true);
1518     showConsensHistogram
1519             .setText(MessageManager.getString("label.histogram"));
1520     showConsensLogo.setEnabled(false);
1521     showConsensLogo.setFont(LABEL_FONT);
1522     showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
1523     showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
1524     showConsensLogo.setSelected(true);
1525     showConsensLogo.setText(MessageManager.getString("label.logo"));
1526     showGroupConsensus.setEnabled(false);
1527     showGroupConsensus.setFont(LABEL_FONT);
1528     showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
1529     showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
1530     showGroupConsensus.setSelected(true);
1531     showGroupConsensus.setText(MessageManager.getString("label.consensus"));
1532     showGroupConservation.setEnabled(false);
1533     showGroupConservation.setFont(LABEL_FONT);
1534     showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
1535     showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
1536     showGroupConservation.setSelected(true);
1537     showGroupConservation
1538             .setText(MessageManager.getString("label.conservation"));
1539     showNpTooltip.setEnabled(true);
1540     showNpTooltip.setFont(LABEL_FONT);
1541     showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
1542     showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
1543     showNpTooltip.setSelected(true);
1544     showNpTooltip.setText(
1545             MessageManager.getString("label.non_positional_features"));
1546     showDbRefTooltip.setEnabled(true);
1547     showDbRefTooltip.setFont(LABEL_FONT);
1548     showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
1549     showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
1550     showDbRefTooltip.setSelected(true);
1551     showDbRefTooltip
1552             .setText(MessageManager.getString("label.database_references"));
1553     annotations.setFont(LABEL_FONT);
1554     annotations.setHorizontalAlignment(SwingConstants.RIGHT);
1555     annotations.setHorizontalTextPosition(SwingConstants.LEFT);
1556     annotations.setSelected(true);
1557     annotations.setText(MessageManager.getString("label.show_annotations"));
1558     // annotations.setBounds(new Rectangle(169, 12, 200, 23));
1559     annotations.addActionListener(new ActionListener()
1560     {
1561       @Override
1562       public void actionPerformed(ActionEvent e)
1563       {
1564         annotations_actionPerformed(e);
1565       }
1566     });
1567     identity.addActionListener(new ActionListener()
1568     {
1569       @Override
1570       public void actionPerformed(ActionEvent e)
1571       {
1572         annotations_actionPerformed(e);
1573       }
1574     });
1575     showGroupConsensus.addActionListener(new ActionListener()
1576     {
1577       @Override
1578       public void actionPerformed(ActionEvent e)
1579       {
1580         annotations_actionPerformed(e);
1581       }
1582     });
1583     showUnconserved.setFont(LABEL_FONT);
1584     showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
1585     showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
1586     showUnconserved.setSelected(true);
1587     showUnconserved
1588             .setText(MessageManager.getString("action.show_unconserved"));
1589     showUnconserved.addActionListener(new ActionListener()
1590     {
1591       @Override
1592       public void actionPerformed(ActionEvent e)
1593       {
1594         showunconserved_actionPerformed(e);
1595       }
1596     });
1597
1598     // TODO these are not yet added to / action from Preferences
1599     // JCheckBox shareSelections = new JCheckBox();
1600     // shareSelections.setFont(verdana11);
1601     // shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
1602     // shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
1603     // shareSelections.setSelected(true);
1604     // shareSelections.setText(MessageManager
1605     // .getString("label.share_selection_across_views"));
1606     // JCheckBox followHighlight = new JCheckBox();
1607     // followHighlight.setFont(verdana11);
1608     // followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
1609     // followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
1610     // // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
1611     // followHighlight.setSelected(true);
1612     // followHighlight.setText(MessageManager
1613     // .getString("label.scroll_highlighted_regions"));
1614
1615     seqLimit.setFont(LABEL_FONT);
1616     seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
1617     seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
1618     seqLimit.setText(MessageManager.getString("label.full_sequence_id"));
1619     smoothFont.setFont(LABEL_FONT);
1620     smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
1621     smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
1622     smoothFont.setText(MessageManager.getString("label.smooth_font"));
1623     scaleProteinToCdna.setFont(LABEL_FONT);
1624     scaleProteinToCdna.setHorizontalAlignment(SwingConstants.RIGHT);
1625     scaleProteinToCdna.setHorizontalTextPosition(SwingConstants.LEADING);
1626     scaleProteinToCdna.setText(
1627             MessageManager.getString("label.scale_protein_to_cdna"));
1628     scaleProteinToCdna.setToolTipText(
1629             MessageManager.getString("label.scale_protein_to_cdna_tip"));
1630     JLabel gapLabel = new JLabel();
1631     gapLabel.setFont(LABEL_FONT);
1632     gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1633     gapLabel.setText(MessageManager.getString("label.gap_symbol") + " ");
1634     JLabel fontLabel = new JLabel();
1635     fontLabel.setFont(LABEL_FONT);
1636     fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1637     fontLabel.setText(MessageManager.getString("label.font"));
1638     fontSizeCB.setFont(LABEL_FONT);
1639     fontSizeCB.setBounds(new Rectangle(320, 112, 65, 23));
1640     fontStyleCB.setFont(LABEL_FONT);
1641     fontStyleCB.setBounds(new Rectangle(382, 112, 80, 23));
1642     fontNameCB.setFont(LABEL_FONT);
1643     fontNameCB.setBounds(new Rectangle(172, 112, 147, 23));
1644     gapSymbolCB.setFont(LABEL_FONT);
1645     gapSymbolCB.setBounds(new Rectangle(172, 215, 69, 23));
1646     DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
1647     dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
1648     gapSymbolCB.setRenderer(dlcr);
1649
1650     startupCheckbox.setText(MessageManager.getString("action.open_file"));
1651     startupCheckbox.setFont(LABEL_FONT);
1652     startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
1653     startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
1654     startupCheckbox.setSelected(true);
1655     startupFileTextfield.setFont(LABEL_FONT);
1656     startupFileTextfield.setBounds(new Rectangle(172, 310, 330, 20));
1657     startupFileTextfield.addMouseListener(new MouseAdapter()
1658     {
1659       @Override
1660       public void mouseClicked(MouseEvent e)
1661       {
1662         if (e.getClickCount() > 1)
1663         {
1664           startupFileTextfield_mouseClicked();
1665         }
1666       }
1667     });
1668
1669     sortby.setFont(LABEL_FONT);
1670     sortby.setBounds(new Rectangle(172, 260, 155, 21));
1671     JLabel sortLabel = new JLabel();
1672     sortLabel.setFont(LABEL_FONT);
1673     sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1674     sortLabel.setText(MessageManager.getString("label.sort_by"));
1675     sortAnnBy.setFont(LABEL_FONT);
1676     sortAnnBy.setBounds(new Rectangle(172, 285, 110, 21));
1677     JLabel sortAnnLabel = new JLabel();
1678     sortAnnLabel.setFont(LABEL_FONT);
1679     sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1680     sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
1681     sortAutocalc.setFont(LABEL_FONT);
1682     sortAutocalc.setBounds(new Rectangle(290, 285, 165, 21));
1683
1684     JPanel annsettingsPanel = new JPanel();
1685     annsettingsPanel.setBounds(new Rectangle(173, 13, 320, 96));
1686     annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
1687     annsettingsPanel.setBorder(new EtchedBorder());
1688     visualTab.add(annsettingsPanel);
1689     Border jb = new EmptyBorder(1, 1, 4, 5);
1690     annotations.setBorder(jb);
1691     showOccupancy.setBorder(jb);
1692     quality.setBorder(jb);
1693     conservation.setBorder(jb);
1694     identity.setBorder(jb);
1695     showConsensbits.setBorder(jb);
1696     showGroupbits.setBorder(jb);
1697     showGroupConsensus.setBorder(jb);
1698     showGroupConservation.setBorder(jb);
1699     showConsensHistogram.setBorder(jb);
1700     showConsensLogo.setBorder(jb);
1701
1702     JPanel autoAnnotSettings = new JPanel();
1703     annsettingsPanel.add(autoAnnotSettings);
1704     autoAnnotSettings.setLayout(new GridLayout(0, 2));
1705     autoAnnotSettings.add(annotations);
1706     autoAnnotSettings.add(quality);
1707     // second row of autoannotation box
1708     autoAnnotSettings = new JPanel();
1709     annsettingsPanel.add(autoAnnotSettings);
1710
1711     autoAnnotSettings.setLayout(new GridLayout(0, 3));
1712     autoAnnotSettings.add(conservation);
1713     autoAnnotSettings.add(identity);
1714     autoAnnotSettings.add(showOccupancy);
1715     autoAnnotSettings.add(showGroupbits);
1716     autoAnnotSettings.add(showGroupConservation);
1717     autoAnnotSettings.add(showGroupConsensus);
1718     autoAnnotSettings.add(showConsensbits);
1719     autoAnnotSettings.add(showConsensHistogram);
1720     autoAnnotSettings.add(showConsensLogo);
1721
1722     JPanel tooltipSettings = new JPanel();
1723     tooltipSettings.setBorder(new TitledBorder(
1724             MessageManager.getString("label.sequence_id_tooltip")));
1725     tooltipSettings.setBounds(173, 140, 220, 62);
1726     tooltipSettings.setLayout(new GridLayout(2, 1));
1727     tooltipSettings.add(showDbRefTooltip);
1728     tooltipSettings.add(showNpTooltip);
1729     visualTab.add(tooltipSettings);
1730
1731     wrap.setFont(LABEL_FONT);
1732     wrap.setHorizontalAlignment(SwingConstants.TRAILING);
1733     wrap.setHorizontalTextPosition(SwingConstants.LEADING);
1734     wrap.setText(MessageManager.getString("label.wrap_alignment"));
1735     rightAlign.setFont(LABEL_FONT);
1736     rightAlign.setForeground(Color.black);
1737     rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
1738     rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
1739     rightAlign.setText(MessageManager.getString("label.right_align_ids"));
1740     idItalics.setFont(LABEL_FONT_ITALIC);
1741     idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
1742     idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
1743     idItalics.setText(
1744             MessageManager.getString("label.sequence_name_italics"));
1745     openoverv.setFont(LABEL_FONT);
1746     openoverv.setActionCommand(
1747             MessageManager.getString("label.open_overview"));
1748     openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
1749     openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
1750     openoverv.setText(MessageManager.getString("label.open_overview"));
1751     JPanel jPanel2 = new JPanel();
1752     jPanel2.setBounds(new Rectangle(7, 17, 158, 310));
1753     jPanel2.setLayout(new GridLayout(14, 1));
1754     jPanel2.add(fullScreen);
1755     jPanel2.add(openoverv);
1756     jPanel2.add(seqLimit);
1757     jPanel2.add(rightAlign);
1758     jPanel2.add(fontLabel);
1759     jPanel2.add(showUnconserved);
1760     jPanel2.add(idItalics);
1761     jPanel2.add(smoothFont);
1762     jPanel2.add(scaleProteinToCdna);
1763     jPanel2.add(gapLabel);
1764     jPanel2.add(wrap);
1765     jPanel2.add(sortLabel);
1766     jPanel2.add(sortAnnLabel);
1767     jPanel2.add(startupCheckbox);
1768     visualTab.add(jPanel2);
1769     visualTab.add(startupFileTextfield);
1770     visualTab.add(sortby);
1771     visualTab.add(sortAnnBy);
1772     visualTab.add(sortAutocalc);
1773     visualTab.add(gapSymbolCB);
1774     visualTab.add(fontNameCB);
1775     visualTab.add(fontSizeCB);
1776     visualTab.add(fontStyleCB);
1777     return visualTab;
1778   }
1779
1780   protected void autoIdWidth_actionPerformed()
1781   {
1782     // TODO Auto-generated method stub
1783
1784   }
1785
1786   protected void userIdWidth_actionPerformed()
1787   {
1788     // TODO Auto-generated method stub
1789
1790   }
1791
1792   protected void maxColour_actionPerformed(JPanel panel)
1793   {
1794   }
1795
1796   protected void minColour_actionPerformed(JPanel panel)
1797   {
1798   }
1799
1800   protected void gapColour_actionPerformed(JPanel panel)
1801   {
1802   }
1803
1804   protected void hiddenColour_actionPerformed(JPanel panel)
1805   {
1806   }
1807
1808   protected void showunconserved_actionPerformed(ActionEvent e)
1809   {
1810     // TODO Auto-generated method stub
1811
1812   }
1813
1814   protected void useLegacyGaps_actionPerformed(ActionEvent e)
1815   {
1816   }
1817
1818   protected void resetOvDefaults_actionPerformed(ActionEvent e)
1819   {
1820   }
1821
1822   /**
1823    * DOCUMENT ME!
1824    * 
1825    * @param e
1826    *          DOCUMENT ME!
1827    */
1828   public void ok_actionPerformed(ActionEvent e)
1829   {
1830   }
1831
1832   /**
1833    * DOCUMENT ME!
1834    * 
1835    * @param e
1836    *          DOCUMENT ME!
1837    */
1838   public void cancel_actionPerformed(ActionEvent e)
1839   {
1840   }
1841
1842   /**
1843    * DOCUMENT ME!
1844    * 
1845    * @param e
1846    *          DOCUMENT ME!
1847    */
1848   public void annotations_actionPerformed(ActionEvent e)
1849   {
1850   }
1851
1852   /**
1853    * DOCUMENT ME!
1854    */
1855   public void startupFileTextfield_mouseClicked()
1856   {
1857   }
1858
1859   public void newLink_actionPerformed(ActionEvent e)
1860   {
1861
1862   }
1863
1864   public void editLink_actionPerformed(ActionEvent e)
1865   {
1866
1867   }
1868
1869   public void deleteLink_actionPerformed(ActionEvent e)
1870   {
1871
1872   }
1873
1874   public void defaultBrowser_mouseClicked(MouseEvent e)
1875   {
1876
1877   }
1878
1879   public void linkURLList_keyTyped(KeyEvent e)
1880   {
1881
1882   }
1883
1884   public void useProxy_actionPerformed()
1885   {
1886     boolean enabled = useProxy.isSelected();
1887     portLabel.setEnabled(enabled);
1888     serverLabel.setEnabled(enabled);
1889     proxyServerTB.setEnabled(enabled);
1890     proxyPortTB.setEnabled(enabled);
1891   }
1892
1893   /**
1894    * Customer renderer for JTable: supports column of radio buttons
1895    */
1896   public class RadioButtonRenderer extends JRadioButton
1897           implements TableCellRenderer
1898   {
1899     public RadioButtonRenderer()
1900     {
1901       setHorizontalAlignment(CENTER);
1902       setToolTipText(MessageManager.getString("label.urltooltip"));
1903     }
1904
1905     @Override
1906     public Component getTableCellRendererComponent(JTable table,
1907             Object value, boolean isSelected, boolean hasFocus, int row,
1908             int column)
1909     {
1910       setSelected((boolean) value);
1911
1912       // set colours to match rest of table
1913       if (isSelected)
1914       {
1915         setBackground(table.getSelectionBackground());
1916         setForeground(table.getSelectionForeground());
1917       }
1918       else
1919       {
1920         setBackground(table.getBackground());
1921         setForeground(table.getForeground());
1922       }
1923       return this;
1924     }
1925   }
1926
1927   /**
1928    * Customer cell editor for JTable: supports column of radio buttons in
1929    * conjunction with renderer
1930    */
1931   public class RadioButtonEditor extends AbstractCellEditor
1932           implements TableCellEditor
1933   {
1934     private JRadioButton button = new JRadioButton();
1935
1936     public RadioButtonEditor()
1937     {
1938       button.setHorizontalAlignment(SwingConstants.CENTER);
1939       this.button.addActionListener(new ActionListener()
1940       {
1941         @Override
1942         public void actionPerformed(ActionEvent e)
1943         {
1944           fireEditingStopped();
1945         }
1946       });
1947     }
1948
1949     @Override
1950     public Component getTableCellEditorComponent(JTable table, Object value,
1951             boolean isSelected, int row, int column)
1952     {
1953       button.setSelected((boolean) value);
1954       return button;
1955     }
1956
1957     @Override
1958     public Object getCellEditorValue()
1959     {
1960       return button.isSelected();
1961     }
1962
1963   }
1964
1965   protected void validateHmmerPath()
1966   {
1967   }
1968
1969   protected void validateCygwinPath()
1970   {
1971   }
1972 }