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