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