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