use proper encoding for storing colour as user preference (JAL-234)
[jalview.git] / src / jalview / jbgui / GPreferences.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
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 of the License, or (at your option) any later version.
10  * 
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package jalview.jbgui;
19
20 import java.awt.*;
21 import java.awt.event.*;
22
23 import javax.swing.*;
24 import javax.swing.border.*;
25 import javax.swing.event.*;
26 import java.awt.Rectangle;
27
28 /**
29  * DOCUMENT ME!
30  * 
31  * @author $author$
32  * @version $Revision$
33  */
34 public class GPreferences extends JPanel
35 {
36   JTabbedPane tabbedPane = new JTabbedPane();
37
38   JButton ok = new JButton();
39
40   JButton cancel = new JButton();
41
42   JPanel okCancelPanel = new JPanel();
43
44   BorderLayout borderLayout1 = new BorderLayout();
45
46   protected JCheckBox quality = new JCheckBox();
47
48   JPanel visualTab = new JPanel();
49   JPanel visual2Tab = new JPanel();
50
51   protected JCheckBox fullScreen = new JCheckBox();
52
53   protected JCheckBox conservation = new JCheckBox();
54
55   protected JCheckBox identity = new JCheckBox();
56
57   protected JCheckBox annotations = new JCheckBox();
58
59   protected JPanel minColour = new JPanel();
60   JLabel mincolourLabel = new JLabel();
61
62   protected JPanel maxColour = new JPanel();
63   JLabel maxcolourLabel = new JLabel();
64
65   JLabel gapLabel = new JLabel();
66
67   protected JComboBox colour = new JComboBox();
68
69   JLabel colourLabel = new JLabel();
70
71   JLabel fontLabel = new JLabel();
72
73   protected JComboBox fontSizeCB = new JComboBox();
74
75   protected JComboBox fontStyleCB = new JComboBox();
76
77   protected JComboBox fontNameCB = new JComboBox();
78
79   protected JComboBox gapSymbolCB = new JComboBox();
80
81   protected JCheckBox startupCheckbox = new JCheckBox();
82
83   protected JTextField startupFileTextfield = new JTextField();
84
85   JPanel connectTab = new JPanel();
86
87   JLabel serverLabel = new JLabel();
88
89   protected JList linkURLList = new JList();
90
91   protected JTextField proxyServerTB = new JTextField();
92
93   protected JTextField proxyPortTB = new JTextField();
94
95   JLabel portLabel = new JLabel();
96
97   JLabel browserLabel = new JLabel();
98
99   protected JTextField defaultBrowser = new JTextField();
100
101   JButton newLink = new JButton();
102
103   JButton editLink = new JButton();
104
105   JButton deleteLink = new JButton();
106
107   JScrollPane linkScrollPane = new JScrollPane();
108
109   JPanel linkPanel = new JPanel();
110
111   BorderLayout borderLayout2 = new BorderLayout();
112
113   JPanel editLinkButtons = new JPanel();
114
115   GridLayout gridLayout1 = new GridLayout();
116
117   protected JList linkNameList = new JList();
118
119   JPanel linkPanel2 = new JPanel();
120
121   BorderLayout borderLayout3 = new BorderLayout();
122
123   protected JCheckBox useProxy = new JCheckBox();
124
125   JPanel jPanel1 = new JPanel();
126
127   TitledBorder titledBorder1 = new TitledBorder("Proxy Server");
128
129   TitledBorder titledBorder2 = new TitledBorder("File Output");
130
131   GridBagLayout gridBagLayout2 = new GridBagLayout();
132
133   GridBagLayout gridBagLayout1 = new GridBagLayout();
134
135   GridBagLayout gridBagLayout3 = new GridBagLayout();
136
137   protected JComboBox sortby = new JComboBox();
138
139   JLabel sortLabel = new JLabel();
140
141   JPanel jPanel2 = new JPanel();
142   JPanel visual2panel = new JPanel();
143
144   GridLayout gridLayout2 = new GridLayout();
145
146   GridLayout gridLayout4 = new GridLayout();
147
148   JPanel annsettingsPanel = new JPanel();
149
150   JPanel autoAnnotSettings1 = new JPanel();
151
152   JPanel autoAnnotSettings2 = new JPanel();
153
154   JPanel autoAnnotSettings3 = new JPanel();
155
156   JPanel exportTab = new JPanel();
157
158   JLabel epsLabel = new JLabel();
159
160   protected JComboBox epsRendering = new JComboBox();
161
162   JLabel jLabel1 = new JLabel();
163
164   protected JCheckBox blcjv = new JCheckBox();
165
166   protected JCheckBox pileupjv = new JCheckBox();
167
168   protected JCheckBox clustaljv = new JCheckBox();
169
170   protected JCheckBox msfjv = new JCheckBox();
171
172   protected JCheckBox fastajv = new JCheckBox();
173
174   protected JCheckBox pfamjv = new JCheckBox();
175
176   FlowLayout flowLayout1 = new FlowLayout();
177
178   protected JCheckBox pirjv = new JCheckBox();
179
180   JPanel jPanel11 = new JPanel();
181
182   Font verdana11 = new java.awt.Font("Verdana", Font.PLAIN, 11);
183
184   protected JCheckBox seqLimit = new JCheckBox();
185
186   GridLayout gridLayout3 = new GridLayout();
187
188   protected JCheckBox smoothFont = new JCheckBox();
189
190   JPanel calcTab = new JPanel();
191
192   protected JCheckBox autoCalculateConsCheck = new JCheckBox();
193
194   protected JCheckBox padGaps = new JCheckBox();
195
196   protected JCheckBox modellerOutput = new JCheckBox();
197
198   protected JPanel dasPanel = new JPanel();
199
200   BorderLayout borderLayout4 = new BorderLayout();
201
202   protected JPanel wsPanel = new JPanel();
203
204   BorderLayout borderLayout5 = new BorderLayout();
205
206   protected JCheckBox wrap = new JCheckBox();
207
208   protected JCheckBox rightAlign = new JCheckBox();
209
210   protected JCheckBox showUnconserved = new JCheckBox();
211
212   protected JCheckBox showDbRefTooltip = new JCheckBox();
213
214   protected JCheckBox showNpTooltip = new JCheckBox();
215
216   protected JCheckBox idItalics = new JCheckBox();
217
218   protected JCheckBox openoverv = new JCheckBox();
219
220   protected JCheckBox usagestats = new JCheckBox();
221
222   protected JCheckBox questionnaire = new JCheckBox();
223
224   protected JCheckBox versioncheck = new JCheckBox();
225
226   protected JLabel showGroupbits = new JLabel();
227
228   protected JLabel showConsensbits = new JLabel();
229
230   protected JCheckBox showConsensLogo = new JCheckBox();
231
232   protected JCheckBox showConsensHistogram = new JCheckBox();
233
234   protected JCheckBox showGroupConsensus = new JCheckBox();
235
236   protected JCheckBox showGroupConservation = new JCheckBox();
237
238   protected JCheckBox shareSelections = new JCheckBox();
239
240   protected JCheckBox followHighlight = new JCheckBox();
241
242   public void addtoLayout(JPanel panel, String tooltip, JComponent label, JComponent valBox)
243   {
244     JPanel laypanel = new JPanel(),labPanel=new JPanel(), valPanel=new JPanel();
245     // laypanel.setSize(panel.getPreferredSize());
246     // laypanel.setLayout(null);
247     labPanel.setBounds(new Rectangle(7, 7, 158, 23));
248     valPanel.setBounds(new Rectangle(172, 7, 270,23));
249     //labPanel.setLayout(new GridLayout(1,1));
250     //valPanel.setLayout(new GridLayout(1,1));
251     labPanel.add(label);
252     valPanel.add(valBox);
253     laypanel.add(labPanel);
254     laypanel.add(valPanel);
255     valPanel.setToolTipText(tooltip);
256     labPanel.setToolTipText(tooltip);
257     valBox.setToolTipText(tooltip);
258     panel.add(laypanel);
259     panel.validate();
260     
261   }
262   /**
263    * Creates a new GPreferences object.
264    */
265   public GPreferences()
266   {
267     try
268     {
269       jbInit();
270     } catch (Exception ex)
271     {
272       ex.printStackTrace();
273     }
274   }
275
276   /**
277    * DOCUMENT ME!
278    * 
279    * @throws Exception
280    *           DOCUMENT ME!
281    */
282   private void jbInit() throws Exception
283   {
284     this.setLayout(borderLayout1);
285     ok.setText("OK");
286     ok.addActionListener(new ActionListener()
287     {
288       public void actionPerformed(ActionEvent e)
289       {
290         ok_actionPerformed(e);
291       }
292     });
293     cancel.setText("Cancel");
294     cancel.addActionListener(new ActionListener()
295     {
296       public void actionPerformed(ActionEvent e)
297       {
298         cancel_actionPerformed(e);
299       }
300     });
301     quality.setEnabled(false);
302     quality.setFont(verdana11);
303     quality.setHorizontalAlignment(SwingConstants.RIGHT);
304     quality.setHorizontalTextPosition(SwingConstants.LEFT);
305     quality.setSelected(true);
306     quality.setText("Quality");
307     visualTab.setBorder(new TitledBorder("Open new alignment"));
308     visualTab.setLayout(null);
309     visual2Tab.setBorder(new TitledBorder("Open new alignment"));
310     visual2Tab.setLayout(new FlowLayout());
311     fullScreen.setFont(verdana11);
312     fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
313     fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
314     fullScreen.setText("Maximise Window");
315     conservation.setEnabled(false);
316     conservation.setFont(verdana11);
317     conservation.setHorizontalAlignment(SwingConstants.RIGHT);
318     conservation.setHorizontalTextPosition(SwingConstants.LEFT);
319     conservation.setSelected(true);
320     conservation.setText("Conservation");
321     identity.setEnabled(false);
322     identity.setFont(verdana11);
323     identity.setHorizontalAlignment(SwingConstants.RIGHT);
324     identity.setHorizontalTextPosition(SwingConstants.LEFT);
325     identity.setSelected(true);
326     identity.setText("Consensus");
327     showGroupbits.setFont(verdana11);
328     showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
329     showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
330     showGroupbits.setText("Show group:");
331     showConsensbits.setFont(verdana11);
332     showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
333     showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
334     showConsensbits.setText("Consensus:");
335     showConsensHistogram.setEnabled(false);
336     showConsensHistogram.setFont(verdana11);
337     showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
338     showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
339     showConsensHistogram.setSelected(true);
340     showConsensHistogram.setText("Histogram");
341     showConsensLogo.setEnabled(false);
342     showConsensLogo.setFont(verdana11);
343     showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
344     showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
345     showConsensLogo.setSelected(true);
346     showConsensLogo.setText("Logo");
347     showGroupConsensus.setEnabled(false);
348     showGroupConsensus.setFont(verdana11);
349     showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
350     showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
351     showGroupConsensus.setSelected(true);
352     showGroupConsensus.setText("Consensus");
353     showGroupConservation.setEnabled(false);
354     showGroupConservation.setFont(verdana11);
355     showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
356     showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
357     showGroupConservation.setSelected(true);
358     showGroupConservation.setText("Conservation");
359     showNpTooltip.setEnabled(true);
360     showNpTooltip.setFont(verdana11);
361     showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
362     showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
363     showNpTooltip.setSelected(true);
364     showNpTooltip.setText("Non-positional Features");
365     showDbRefTooltip.setEnabled(true);
366     showDbRefTooltip.setFont(verdana11);
367     showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
368     showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
369     showDbRefTooltip.setSelected(true);
370     showDbRefTooltip.setText("Database References");
371     annotations.setFont(verdana11);
372     annotations.setHorizontalAlignment(SwingConstants.RIGHT);
373     annotations.setHorizontalTextPosition(SwingConstants.LEADING);
374     annotations.setSelected(true);
375     annotations.setText("Show Annotations");
376     annotations.setBounds(new Rectangle(169, 12, 200, 23));
377     annotations.addActionListener(new ActionListener()
378     {
379       public void actionPerformed(ActionEvent e)
380       {
381         annotations_actionPerformed(e);
382       }
383     });
384     identity.addActionListener(new ActionListener()
385     {
386       public void actionPerformed(ActionEvent e)
387       {
388         annotations_actionPerformed(e);
389       }
390     });
391     showGroupConsensus.addActionListener(new ActionListener()
392     {
393       public void actionPerformed(ActionEvent e)
394       {
395         annotations_actionPerformed(e);
396       }
397     });
398     showUnconserved.setFont(verdana11);
399     showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
400     showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
401     showUnconserved.setSelected(true);
402     showUnconserved.setText("Show Unconserved");
403     showUnconserved.addActionListener(new ActionListener()
404     {
405       public void actionPerformed(ActionEvent e)
406       {
407         showunconserved_actionPerformed(e);
408       }
409     });
410     // / TODO: fit these in to preferences panel!!!!!
411     shareSelections.setFont(verdana11);
412     shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
413     shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
414     shareSelections.setSelected(true);
415     shareSelections.setText("Share selection across views");
416     followHighlight.setFont(verdana11);
417     followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
418     followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
419     // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
420     followHighlight.setSelected(true);
421     followHighlight.setText("Scroll to highlighted regions");
422
423     gapLabel.setFont(verdana11);
424     gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
425     gapLabel.setText("Gap Symbol ");
426     colour.setFont(verdana11);
427     colour.setBounds(new Rectangle(172, 225, 155, 21));
428     colourLabel.setFont(verdana11);
429     colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
430     colourLabel.setText("Alignment Colour ");
431     fontLabel.setFont(verdana11);
432     fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
433     fontLabel.setText("Font ");
434     fontSizeCB.setFont(verdana11);
435     fontSizeCB.setBounds(new Rectangle(319, 104, 49, 23));
436     fontStyleCB.setFont(verdana11);
437     fontStyleCB.setBounds(new Rectangle(367, 104, 70, 23));
438     fontNameCB.setFont(verdana11);
439     fontNameCB.setBounds(new Rectangle(172, 104, 147, 23));
440     gapSymbolCB.setFont(verdana11);
441     gapSymbolCB.setBounds(new Rectangle(172, 204, 69, 23));
442     mincolourLabel.setFont(verdana11);
443     mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
444     mincolourLabel.setText("Minimum Colour");
445     minColour.setFont(verdana11);
446     minColour.setBorder(BorderFactory.createEtchedBorder());
447     minColour.setPreferredSize(new Dimension(40, 20));
448     minColour.addMouseListener(new MouseAdapter()
449     {
450       public void mousePressed(MouseEvent e)
451       {
452           minColour_actionPerformed();
453       }
454     });
455     maxcolourLabel.setFont(verdana11);
456     maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
457     maxcolourLabel.setText("Maximumum Colour ");
458     maxColour.setFont(verdana11);
459     maxColour.setBorder(BorderFactory.createEtchedBorder());
460     maxColour.setPreferredSize(new Dimension(40, 20));
461     maxColour.addMouseListener(new MouseAdapter()
462     {
463       public void mousePressed(MouseEvent e)
464       {
465           maxColour_actionPerformed();
466       }
467     });
468     startupCheckbox.setText("Open file");
469     startupCheckbox.setFont(verdana11);
470     startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
471     startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
472     startupCheckbox.setSelected(true);
473     startupFileTextfield.setFont(verdana11);
474     startupFileTextfield.setBounds(new Rectangle(172, 273, 270, 20));
475     startupFileTextfield.addMouseListener(new MouseAdapter()
476     {
477       public void mouseClicked(MouseEvent e)
478       {
479         if (e.getClickCount() > 1)
480         {
481           startupFileTextfield_mouseClicked();
482         }
483       }
484     });
485
486     connectTab.setLayout(gridBagLayout3);
487     serverLabel.setText("Address");
488     serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
489     serverLabel.setFont(verdana11);
490     proxyServerTB.setFont(verdana11);
491     proxyPortTB.setFont(verdana11);
492     portLabel.setFont(verdana11);
493     portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
494     portLabel.setText("Port");
495     browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
496     browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
497     browserLabel.setText("Default Browser (Unix)");
498     defaultBrowser.setFont(verdana11);
499     defaultBrowser.setText("");
500     usagestats.setText("Send usage statistics");
501     usagestats.setFont(verdana11);
502     usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
503     usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
504     questionnaire.setText("Check for questionnaires");
505     questionnaire.setFont(verdana11);
506     questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
507     questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
508     versioncheck.setText("Check for latest version");
509     versioncheck.setFont(verdana11);
510     versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
511     versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
512     newLink.setText("New");
513     newLink.addActionListener(new java.awt.event.ActionListener()
514     {
515       public void actionPerformed(ActionEvent e)
516       {
517         newLink_actionPerformed(e);
518       }
519     });
520     editLink.setText("Edit");
521     editLink.addActionListener(new java.awt.event.ActionListener()
522     {
523       public void actionPerformed(ActionEvent e)
524       {
525         editLink_actionPerformed(e);
526       }
527     });
528     deleteLink.setText("Delete");
529     deleteLink.addActionListener(new java.awt.event.ActionListener()
530     {
531       public void actionPerformed(ActionEvent e)
532       {
533         deleteLink_actionPerformed(e);
534       }
535     });
536
537     linkURLList.addListSelectionListener(new ListSelectionListener()
538     {
539       public void valueChanged(ListSelectionEvent e)
540       {
541         int index = linkURLList.getSelectedIndex();
542         linkNameList.setSelectedIndex(index);
543       }
544     });
545
546     linkNameList.addListSelectionListener(new ListSelectionListener()
547     {
548       public void valueChanged(ListSelectionEvent e)
549       {
550         int index = linkNameList.getSelectedIndex();
551         linkURLList.setSelectedIndex(index);
552       }
553     });
554
555     linkScrollPane.setBorder(null);
556     linkPanel.setBorder(new TitledBorder("URL link from Sequence ID"));
557     linkPanel.setLayout(borderLayout2);
558     editLinkButtons.setLayout(gridLayout1);
559     gridLayout1.setRows(3);
560     linkNameList.setFont(verdana11);
561     linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
562     linkPanel2.setLayout(borderLayout3);
563     linkURLList.setFont(verdana11);
564     linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
565
566     defaultBrowser.addMouseListener(new MouseAdapter()
567     {
568       public void mouseClicked(MouseEvent e)
569       {
570         if (e.getClickCount() > 1)
571         {
572           defaultBrowser_mouseClicked(e);
573         }
574       }
575     });
576     useProxy.setFont(verdana11);
577     useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
578     useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
579     useProxy.setText("Use a proxy server");
580     useProxy.addActionListener(new ActionListener()
581     {
582       public void actionPerformed(ActionEvent e)
583       {
584         useProxy_actionPerformed();
585       }
586     });
587     jPanel1.setBorder(titledBorder1);
588     jPanel1.setLayout(gridBagLayout1);
589     sortby.setFont(verdana11);
590     sortby.setBounds(new Rectangle(172, 249, 155, 21));
591     sortLabel.setFont(verdana11);
592     sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
593     sortLabel.setText("Sort by ");
594     jPanel2.setBounds(new Rectangle(7, 17, 158, 278));
595     jPanel2.setLayout(gridLayout2);
596     gridLayout2.setRows(12);
597     exportTab.setLayout(null);
598     epsLabel.setFont(verdana11);
599     epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
600     epsLabel.setText("EPS Rendering Style");
601     epsLabel.setBounds(new Rectangle(9, 31, 140, 24));
602     epsRendering.setFont(verdana11);
603     epsRendering.setBounds(new Rectangle(154, 34, 187, 21));
604     jLabel1.setFont(verdana11);
605     jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
606     jLabel1.setText("Append /start-end (/15-380)");
607     jLabel1.setFont(verdana11);
608     fastajv.setFont(verdana11);
609     fastajv.setHorizontalAlignment(SwingConstants.LEFT);
610     clustaljv.setText("Clustal     ");
611     blcjv.setText("BLC     ");
612     fastajv.setText("Fasta     ");
613     msfjv.setText("MSF     ");
614     pfamjv.setText("PFAM     ");
615     pileupjv.setText("Pileup     ");
616     msfjv.setFont(verdana11);
617     msfjv.setHorizontalAlignment(SwingConstants.LEFT);
618     pirjv.setText("PIR     ");
619     jPanel11.setFont(verdana11);
620     jPanel11.setBorder(titledBorder2);
621     jPanel11.setBounds(new Rectangle(30, 72, 196, 182));
622     jPanel11.setLayout(gridLayout3);
623     blcjv.setFont(verdana11);
624     blcjv.setHorizontalAlignment(SwingConstants.LEFT);
625     clustaljv.setFont(verdana11);
626     clustaljv.setHorizontalAlignment(SwingConstants.LEFT);
627     pfamjv.setFont(verdana11);
628     pfamjv.setHorizontalAlignment(SwingConstants.LEFT);
629     pileupjv.setFont(verdana11);
630     pileupjv.setHorizontalAlignment(SwingConstants.LEFT);
631     pirjv.setFont(verdana11);
632     pirjv.setHorizontalAlignment(SwingConstants.LEFT);
633     seqLimit.setFont(verdana11);
634     seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
635     seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
636     seqLimit.setText("Full Sequence Id");
637     gridLayout3.setRows(8);
638     smoothFont.setFont(verdana11);
639     smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
640     smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
641     smoothFont.setText("Smooth Font");
642     calcTab.setLayout(null);
643     autoCalculateConsCheck.setFont(new java.awt.Font("Verdana", Font.PLAIN,
644             11));
645     autoCalculateConsCheck.setText("AutoCalculate Consensus");
646     autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
647     padGaps.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
648     padGaps.setText("Pad gaps when editing");
649     padGaps.setBounds(new Rectangle(22, 94, 168, 23));
650     modellerOutput.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
651     modellerOutput.setText("Use Modeller Output");
652     modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
653     dasPanel.setLayout(borderLayout4);
654     wsPanel.setLayout(borderLayout5);
655     wrap.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
656     wrap.setHorizontalAlignment(SwingConstants.TRAILING);
657     wrap.setHorizontalTextPosition(SwingConstants.LEADING);
658     wrap.setText("Wrap Alignment");
659     rightAlign.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
660     rightAlign.setForeground(Color.black);
661     rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
662     rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
663     rightAlign.setText("Right Align Ids");
664     idItalics.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
665     idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
666     idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
667     idItalics.setText("Sequence Name Italics");
668     openoverv.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
669     openoverv.setActionCommand("Open Overview");
670     openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
671     openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
672     openoverv.setText("Open Overview");
673     jPanel2.add(fullScreen);
674     jPanel2.add(openoverv);
675     jPanel2.add(seqLimit);
676     jPanel2.add(rightAlign);
677     jPanel2.add(fontLabel);
678     jPanel2.add(showUnconserved);
679     jPanel2.add(idItalics);
680     jPanel2.add(smoothFont);
681     jPanel2.add(gapLabel);
682     jPanel2.add(wrap);
683     jPanel2.add(sortLabel);
684     jPanel2.add(startupCheckbox);
685     visualTab.add(annotations);
686     visualTab.add(startupFileTextfield);
687     visualTab.add(sortby);
688     visualTab.add(gapSymbolCB);
689     visualTab.add(fontNameCB);
690     visualTab.add(fontSizeCB);
691     visualTab.add(fontStyleCB);
692     annsettingsPanel.setBounds(new Rectangle(173, 34, 300, 61));
693     annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
694     annsettingsPanel.add(autoAnnotSettings1);
695     annsettingsPanel.add(autoAnnotSettings2);
696     annsettingsPanel.add(autoAnnotSettings3);
697     autoAnnotSettings1.setLayout(new GridLayout(3, 1, 0, 0));
698     autoAnnotSettings2.setLayout(new GridLayout(3, 1, 0, 0));
699     autoAnnotSettings3.setLayout(new GridLayout(3, 1, 0, 0));
700     visualTab.add(annsettingsPanel);
701     Border jb = new EmptyBorder(1, 1, 4, 5);
702     quality.setBorder(jb);
703     conservation.setBorder(jb);
704     identity.setBorder(jb);
705     showConsensbits.setBorder(jb);
706     showGroupbits.setBorder(jb);
707     showGroupConsensus.setBorder(jb);
708     showGroupConservation.setBorder(jb);
709     showConsensHistogram.setBorder(jb);
710     showConsensLogo.setBorder(jb);
711
712     autoAnnotSettings2.add(conservation);
713     autoAnnotSettings1.add(quality);
714     autoAnnotSettings3.add(identity);
715     autoAnnotSettings1.add(showGroupbits);
716     autoAnnotSettings3.add(showGroupConsensus);
717     autoAnnotSettings2.add(showGroupConservation);
718     autoAnnotSettings1.add(showConsensbits);
719     autoAnnotSettings2.add(showConsensHistogram);
720     autoAnnotSettings3.add(showConsensLogo);
721
722     JPanel tooltipSettings = new JPanel();
723     tooltipSettings.setBorder(new TitledBorder("Sequence ID Tooltip"));
724     tooltipSettings.setBounds(173, 130, 200, 62);
725     tooltipSettings.setLayout(new GridLayout(2, 1));
726     tooltipSettings.add(showDbRefTooltip);
727     tooltipSettings.add(showNpTooltip);
728     visualTab.add(tooltipSettings);
729     visualTab.add(jPanel2);
730     addtoLayout(visual2Tab, "Default Colourscheme for alignment", colourLabel, colour);
731     JPanel annotationShding=new JPanel();
732     annotationShding.setBorder(new TitledBorder("Annotation Shading Default"));
733     annotationShding.setLayout(new GridLayout(1,2));
734     addtoLayout(annotationShding, "Default Minimum Colour for annotation shading", mincolourLabel,minColour);
735     addtoLayout(annotationShding,"Default Maximum Colour for annotation shading", maxcolourLabel, maxColour);
736     visual2Tab.add(annotationShding); // , FlowLayout.LEFT);
737
738 //    visual2panel.add(minColour);
739 //    visual2panel.add(maxColour);
740 //    visual2Tab.add(visual2panel);
741
742     linkPanel.add(editLinkButtons, BorderLayout.EAST);
743     editLinkButtons.add(newLink, null);
744     editLinkButtons.add(editLink, null);
745     editLinkButtons.add(deleteLink, null);
746     linkPanel.add(linkScrollPane, BorderLayout.CENTER);
747     linkScrollPane.getViewport().add(linkPanel2, null);
748     linkPanel2.add(linkURLList, BorderLayout.CENTER);
749     linkPanel2.add(linkNameList, BorderLayout.WEST);
750     okCancelPanel.add(ok);
751     okCancelPanel.add(cancel);
752     this.add(tabbedPane, java.awt.BorderLayout.CENTER);
753
754     this.add(okCancelPanel, java.awt.BorderLayout.SOUTH);
755     jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
756             GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
757                     2, 4, 0), 5, 0));
758     jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
759             GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
760                     0, 4, 0), 11, 6));
761     connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
762             GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
763                     16, 0, 0, 12), 359, -17));
764     connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
765             GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
766                     21, 0, 35, 12), 4, 6));
767     connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
768             0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
769             new Insets(16, 0, 0, 0), 5, 1));
770     jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
771             GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
772             new Insets(0, 2, 4, 2), 54, 1));
773     jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
774             GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
775             new Insets(0, 2, 4, 0), 263, 1));
776     connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
777             0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
778             new Insets(15, 0, 0, 15), 307, 1));
779     connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
780             GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
781             new Insets(0, 2, 4, 2), 70, 1));
782     connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
783             0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
784             new Insets(0, 2, 4, 2), 70, 1));
785     connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
786             0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
787             new Insets(0, 2, 4, 2), 70, 1));
788
789     jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
790             GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
791                     2, 5, 185), 2, -4));
792     DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
793     dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
794     gapSymbolCB.setRenderer(dlcr);
795
796     tabbedPane.add(visualTab, "Visual");
797     tabbedPane.add(visual2Tab,"Colours");
798     tabbedPane.add(connectTab, "Connections");
799     tabbedPane.add(exportTab, "Output");
800     jPanel11.add(jLabel1);
801     jPanel11.add(blcjv);
802     jPanel11.add(clustaljv);
803     jPanel11.add(fastajv);
804     jPanel11.add(msfjv);
805     jPanel11.add(pfamjv);
806     jPanel11.add(pileupjv);
807     jPanel11.add(pirjv);
808     exportTab.add(modellerOutput);
809     tabbedPane.add(calcTab, "Editing");
810     calcTab.add(autoCalculateConsCheck);
811     calcTab.add(padGaps);
812     tabbedPane.add(dasPanel, "DAS Settings");
813     tabbedPane.add(wsPanel, "Web Services");
814
815     exportTab.add(epsLabel);
816     exportTab.add(epsRendering);
817     exportTab.add(jPanel11);
818   }
819
820   protected void maxColour_actionPerformed()
821   {
822     // TODO Auto-generated method stub
823     
824   }
825
826   protected void minColour_actionPerformed()
827   {
828     // TODO Auto-generated method stub
829     
830   }
831
832   protected void showunconserved_actionPerformed(ActionEvent e)
833   {
834     // TODO Auto-generated method stub
835
836   }
837
838   /**
839    * DOCUMENT ME!
840    * 
841    * @param e
842    *          DOCUMENT ME!
843    */
844   public void ok_actionPerformed(ActionEvent e)
845   {
846   }
847
848   /**
849    * DOCUMENT ME!
850    * 
851    * @param e
852    *          DOCUMENT ME!
853    */
854   public void cancel_actionPerformed(ActionEvent e)
855   {
856   }
857
858   /**
859    * DOCUMENT ME!
860    * 
861    * @param e
862    *          DOCUMENT ME!
863    */
864   public void annotations_actionPerformed(ActionEvent e)
865   {
866   }
867
868   /**
869    * DOCUMENT ME!
870    */
871   public void startupFileTextfield_mouseClicked()
872   {
873   }
874
875   public void newLink_actionPerformed(ActionEvent e)
876   {
877
878   }
879
880   public void editLink_actionPerformed(ActionEvent e)
881   {
882
883   }
884
885   public void deleteLink_actionPerformed(ActionEvent e)
886   {
887
888   }
889
890   public void defaultBrowser_mouseClicked(MouseEvent e)
891   {
892
893   }
894
895   public void linkURLList_keyTyped(KeyEvent e)
896   {
897
898   }
899
900   public void useProxy_actionPerformed()
901   {
902     proxyServerTB.setEnabled(useProxy.isSelected());
903     proxyPortTB.setEnabled(useProxy.isSelected());
904   }
905
906 }