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