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