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