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