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