2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
3 * Copyright (C) 2015 The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package jalview.jbgui;
23 import jalview.gui.JvSwingUtils;
24 import jalview.gui.StructureViewer.ViewerType;
25 import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
26 import jalview.util.MessageManager;
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;
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;
46 import javax.swing.BorderFactory;
47 import javax.swing.DefaultListCellRenderer;
48 import javax.swing.JButton;
49 import javax.swing.JCheckBox;
50 import javax.swing.JComboBox;
51 import javax.swing.JFileChooser;
52 import javax.swing.JLabel;
53 import javax.swing.JList;
54 import javax.swing.JPanel;
55 import javax.swing.JScrollPane;
56 import javax.swing.JTabbedPane;
57 import javax.swing.JTextField;
58 import javax.swing.ListSelectionModel;
59 import javax.swing.SwingConstants;
60 import javax.swing.border.Border;
61 import javax.swing.border.EmptyBorder;
62 import javax.swing.border.EtchedBorder;
63 import javax.swing.border.TitledBorder;
64 import javax.swing.event.ChangeEvent;
65 import javax.swing.event.ChangeListener;
66 import javax.swing.event.ListSelectionEvent;
67 import javax.swing.event.ListSelectionListener;
70 * Base class for the Preferences panel.
75 public class GPreferences extends JPanel
77 private static final Font LABEL_FONT = JvSwingUtils.getLabelFont();
79 private static final Font LABEL_FONT_ITALIC = JvSwingUtils.getLabelFont(
83 * Visual tab components
85 protected JCheckBox fullScreen = new JCheckBox();
87 protected JCheckBox openoverv = new JCheckBox();
89 protected JCheckBox seqLimit = new JCheckBox();
91 protected JCheckBox rightAlign = new JCheckBox();
93 protected JComboBox<String> fontSizeCB = new JComboBox<String>();
95 protected JComboBox<String> fontStyleCB = new JComboBox<String>();
97 protected JComboBox<String> fontNameCB = new JComboBox<String>();
99 protected JCheckBox showUnconserved = new JCheckBox();
101 protected JCheckBox idItalics = new JCheckBox();
103 protected JCheckBox smoothFont = new JCheckBox();
105 protected JCheckBox scaleProteinToCdna = new JCheckBox();
107 protected JComboBox<String> gapSymbolCB = new JComboBox<String>();
109 protected JCheckBox wrap = new JCheckBox();
111 protected JComboBox<String> sortby = new JComboBox<String>();
113 protected JComboBox<String> sortAnnBy = new JComboBox<String>();
115 protected JComboBox<String> sortAutocalc = new JComboBox<String>();
117 protected JCheckBox startupCheckbox = new JCheckBox();
119 protected JTextField startupFileTextfield = new JTextField();
121 // below are in the 'second column'
122 protected JCheckBox annotations = new JCheckBox();
124 protected JCheckBox quality = new JCheckBox();
126 protected JCheckBox conservation = new JCheckBox();
128 protected JCheckBox identity = new JCheckBox();
130 protected JCheckBox showGroupConsensus = new JCheckBox();
132 protected JCheckBox showGroupConservation = new JCheckBox();
134 protected JCheckBox showConsensHistogram = new JCheckBox();
136 protected JCheckBox showConsensLogo = new JCheckBox();
138 protected JCheckBox showDbRefTooltip = new JCheckBox();
140 protected JCheckBox showNpTooltip = new JCheckBox();
143 * Structure tab and components
145 protected JPanel structureTab;
147 protected JCheckBox structFromPdb = new JCheckBox();
149 protected JCheckBox useRnaView = new JCheckBox();
151 protected JCheckBox addSecondaryStructure = new JCheckBox();
153 protected JCheckBox addTempFactor = new JCheckBox();
155 protected JComboBox<String> structViewer = new JComboBox<String>();
157 protected JTextField chimeraPath = new JTextField();
160 * Colours tab components
162 protected JPanel minColour = new JPanel();
164 protected JPanel maxColour = new JPanel();
166 protected JComboBox<String> protColour = new JComboBox<String>();
168 protected JComboBox<String> nucColour = new JComboBox<String>();
171 * Connections tab components
173 protected JList linkURLList = new JList();
175 protected JTextField proxyServerTB = new JTextField();
177 protected JTextField proxyPortTB = new JTextField();
179 protected JTextField defaultBrowser = new JTextField();
181 protected JList linkNameList = new JList();
183 protected JCheckBox useProxy = new JCheckBox();
185 protected JCheckBox usagestats = new JCheckBox();
187 protected JCheckBox questionnaire = new JCheckBox();
189 protected JCheckBox versioncheck = new JCheckBox();
192 * Output tab components
194 protected JComboBox<String> epsRendering = new JComboBox<String>();
196 protected JLabel userIdWidthlabel = new JLabel();
198 protected JCheckBox autoIdWidth = new JCheckBox();
200 protected JTextField userIdWidth = new JTextField();
202 protected JCheckBox blcjv = new JCheckBox();
204 protected JCheckBox pileupjv = new JCheckBox();
206 protected JCheckBox clustaljv = new JCheckBox();
208 protected JCheckBox msfjv = new JCheckBox();
210 protected JCheckBox fastajv = new JCheckBox();
212 protected JCheckBox pfamjv = new JCheckBox();
214 protected JCheckBox pirjv = new JCheckBox();
216 protected JCheckBox modellerOutput = new JCheckBox();
218 protected JCheckBox embbedBioJSON = new JCheckBox();
221 * Editing tab components
223 protected JCheckBox autoCalculateConsCheck = new JCheckBox();
225 protected JCheckBox padGaps = new JCheckBox();
227 protected JCheckBox sortByTree = new JCheckBox();
232 protected JPanel dasTab = new JPanel();
237 protected JPanel wsTab = new JPanel();
240 * Creates a new GPreferences object.
242 public GPreferences()
247 } catch (Exception ex)
249 ex.printStackTrace();
254 * Construct the panel and its tabbed sub-panels.
258 private void jbInit() throws Exception
260 final JTabbedPane tabbedPane = new JTabbedPane();
261 this.setLayout(new BorderLayout());
262 JPanel okCancelPanel = initOkCancelPanel();
263 this.add(tabbedPane, BorderLayout.CENTER);
264 this.add(okCancelPanel, BorderLayout.SOUTH);
266 tabbedPane.add(initVisualTab(),
267 MessageManager.getString("label.visual"));
269 tabbedPane.add(initColoursTab(),
270 MessageManager.getString("label.colours"));
272 tabbedPane.add(initStructureTab(),
273 MessageManager.getString("label.structure"));
275 tabbedPane.add(initConnectionsTab(),
276 MessageManager.getString("label.connections"));
278 tabbedPane.add(initOutputTab(),
279 MessageManager.getString("label.output"));
281 tabbedPane.add(initEditingTab(),
282 MessageManager.getString("label.editing"));
285 * See DasSourceBrowser for the real work of configuring this tab.
287 dasTab.setLayout(new BorderLayout());
288 tabbedPane.add(dasTab, MessageManager.getString("label.das_settings"));
291 * See WsPreferences for the real work of configuring this tab.
293 wsTab.setLayout(new BorderLayout());
294 tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
297 * Handler to validate a tab before leaving it - currently only for
300 tabbedPane.addChangeListener(new ChangeListener()
302 private Component lastTab;
305 public void stateChanged(ChangeEvent e)
307 if (lastTab == structureTab
308 && tabbedPane.getSelectedComponent() != structureTab)
310 if (!validateStructure())
312 tabbedPane.setSelectedComponent(structureTab);
316 lastTab = tabbedPane.getSelectedComponent();
323 * Initialises the Editing tabbed panel.
327 private JPanel initEditingTab()
329 JPanel editingTab = new JPanel();
330 editingTab.setLayout(null);
331 autoCalculateConsCheck.setFont(LABEL_FONT);
332 autoCalculateConsCheck.setText(MessageManager
333 .getString("label.autocalculate_consensus"));
334 autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
335 padGaps.setFont(LABEL_FONT);
336 padGaps.setText(MessageManager.getString("label.pad_gaps_when_editing"));
337 padGaps.setBounds(new Rectangle(22, 94, 168, 23));
338 sortByTree.setFont(LABEL_FONT);
340 .setText(MessageManager.getString("label.sort_with_new_tree"));
342 .setToolTipText(MessageManager
343 .getString("label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
344 sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
345 editingTab.add(autoCalculateConsCheck);
346 editingTab.add(padGaps);
347 editingTab.add(sortByTree);
352 * Initialises the Output tabbed panel.
356 private JPanel initOutputTab()
358 JPanel outputTab = new JPanel();
359 outputTab.setLayout(null);
360 JLabel epsLabel = new JLabel();
361 epsLabel.setFont(LABEL_FONT);
362 epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
363 epsLabel.setText(MessageManager.getString("label.eps_rendering_style"));
364 epsLabel.setBounds(new Rectangle(9, 31, 140, 24));
365 epsRendering.setFont(LABEL_FONT);
366 epsRendering.setBounds(new Rectangle(154, 34, 187, 21));
367 JLabel jLabel1 = new JLabel();
368 jLabel1.setFont(LABEL_FONT);
369 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
370 jLabel1.setText(MessageManager.getString("label.append_start_end"));
371 jLabel1.setFont(LABEL_FONT);
372 fastajv.setFont(LABEL_FONT);
373 fastajv.setHorizontalAlignment(SwingConstants.LEFT);
374 clustaljv.setText(MessageManager.getString("label.clustal") + " ");
375 blcjv.setText(MessageManager.getString("label.blc") + " ");
376 fastajv.setText(MessageManager.getString("label.fasta") + " ");
377 msfjv.setText(MessageManager.getString("label.msf") + " ");
378 pfamjv.setText(MessageManager.getString("label.pfam") + " ");
379 pileupjv.setText(MessageManager.getString("label.pileup") + " ");
380 msfjv.setFont(LABEL_FONT);
381 msfjv.setHorizontalAlignment(SwingConstants.LEFT);
382 pirjv.setText(MessageManager.getString("label.pir") + " ");
383 JPanel jPanel11 = new JPanel();
384 jPanel11.setFont(LABEL_FONT);
385 TitledBorder titledBorder2 = new TitledBorder(
386 MessageManager.getString("label.file_output"));
387 jPanel11.setBorder(titledBorder2);
388 jPanel11.setBounds(new Rectangle(30, 72, 196, 182));
389 GridLayout gridLayout3 = new GridLayout();
390 jPanel11.setLayout(gridLayout3);
391 gridLayout3.setRows(8);
392 blcjv.setFont(LABEL_FONT);
393 blcjv.setHorizontalAlignment(SwingConstants.LEFT);
394 clustaljv.setFont(LABEL_FONT);
395 clustaljv.setHorizontalAlignment(SwingConstants.LEFT);
396 pfamjv.setFont(LABEL_FONT);
397 pfamjv.setHorizontalAlignment(SwingConstants.LEFT);
398 pileupjv.setFont(LABEL_FONT);
399 pileupjv.setHorizontalAlignment(SwingConstants.LEFT);
400 pirjv.setFont(LABEL_FONT);
401 pirjv.setHorizontalAlignment(SwingConstants.LEFT);
402 autoIdWidth.setFont(LABEL_FONT);
403 autoIdWidth.setText(MessageManager
404 .getString("label.automatically_set_id_width"));
405 autoIdWidth.setToolTipText(JvSwingUtils.wrapTooltip(true,
407 .getString("label.adjusts_width_generated_eps_png")));
408 autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23));
409 autoIdWidth.addActionListener(new ActionListener()
413 public void actionPerformed(ActionEvent e)
415 autoIdWidth_actionPerformed();
418 userIdWidthlabel.setFont(LABEL_FONT);
419 userIdWidthlabel.setText(MessageManager
420 .getString("label.figure_id_column_width"));
422 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager
423 .getString("label.manually_specify_width_left_column")));
425 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager
426 .getString("label.manually_specify_width_left_column")));
427 userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23));
428 userIdWidth.setFont(JvSwingUtils.getTextAreaFont());
429 userIdWidth.setText("");
430 userIdWidth.setBounds(new Rectangle(232, 144, 84, 23));
431 userIdWidth.addActionListener(new ActionListener()
435 public void actionPerformed(ActionEvent e)
437 userIdWidth_actionPerformed();
440 modellerOutput.setFont(LABEL_FONT);
441 modellerOutput.setText(MessageManager
442 .getString("label.use_modeller_output"));
443 modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
444 embbedBioJSON.setFont(LABEL_FONT);
445 embbedBioJSON.setText(MessageManager.getString("label.embbed_biojson"));
446 embbedBioJSON.setBounds(new Rectangle(228, 200, 250, 23));
448 jPanel11.add(jLabel1);
450 jPanel11.add(clustaljv);
451 jPanel11.add(fastajv);
453 jPanel11.add(pfamjv);
454 jPanel11.add(pileupjv);
456 outputTab.add(autoIdWidth);
457 outputTab.add(userIdWidth);
458 outputTab.add(userIdWidthlabel);
459 outputTab.add(modellerOutput);
460 outputTab.add(embbedBioJSON);
461 outputTab.add(epsLabel);
462 outputTab.add(epsRendering);
463 outputTab.add(jPanel11);
468 * Initialises the Connections tabbed panel.
472 private JPanel initConnectionsTab()
474 JPanel connectTab = new JPanel();
475 connectTab.setLayout(new GridBagLayout());
476 JLabel serverLabel = new JLabel();
477 serverLabel.setText(MessageManager.getString("label.address"));
478 serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
479 serverLabel.setFont(LABEL_FONT);
480 proxyServerTB.setFont(LABEL_FONT);
481 proxyPortTB.setFont(LABEL_FONT);
482 JLabel portLabel = new JLabel();
483 portLabel.setFont(LABEL_FONT);
484 portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
485 portLabel.setText(MessageManager.getString("label.port"));
486 JLabel browserLabel = new JLabel();
487 browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
488 browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
489 browserLabel.setText(MessageManager
490 .getString("label.default_browser_unix"));
491 defaultBrowser.setFont(LABEL_FONT);
492 defaultBrowser.setText("");
493 usagestats.setText(MessageManager
494 .getString("label.send_usage_statistics"));
495 usagestats.setFont(LABEL_FONT);
496 usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
497 usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
498 questionnaire.setText(MessageManager
499 .getString("label.check_for_questionnaires"));
500 questionnaire.setFont(LABEL_FONT);
501 questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
502 questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
503 versioncheck.setText(MessageManager
504 .getString("label.check_for_latest_version"));
505 versioncheck.setFont(LABEL_FONT);
506 versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
507 versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
508 JButton newLink = new JButton();
509 newLink.setText(MessageManager.getString("action.new"));
510 newLink.addActionListener(new java.awt.event.ActionListener()
512 public void actionPerformed(ActionEvent e)
514 newLink_actionPerformed(e);
517 JButton editLink = new JButton();
518 editLink.setText(MessageManager.getString("action.edit"));
519 editLink.addActionListener(new java.awt.event.ActionListener()
521 public void actionPerformed(ActionEvent e)
523 editLink_actionPerformed(e);
526 JButton deleteLink = new JButton();
527 deleteLink.setText(MessageManager.getString("action.delete"));
528 deleteLink.addActionListener(new java.awt.event.ActionListener()
530 public void actionPerformed(ActionEvent e)
532 deleteLink_actionPerformed(e);
536 linkURLList.addListSelectionListener(new ListSelectionListener()
538 public void valueChanged(ListSelectionEvent e)
540 int index = linkURLList.getSelectedIndex();
541 linkNameList.setSelectedIndex(index);
545 linkNameList.addListSelectionListener(new ListSelectionListener()
547 public void valueChanged(ListSelectionEvent e)
549 int index = linkNameList.getSelectedIndex();
550 linkURLList.setSelectedIndex(index);
554 JScrollPane linkScrollPane = new JScrollPane();
555 linkScrollPane.setBorder(null);
556 JPanel linkPanel = new JPanel();
557 linkPanel.setBorder(new TitledBorder(MessageManager
558 .getString("label.url_linkfrom_sequence_id")));
559 linkPanel.setLayout(new BorderLayout());
560 GridLayout gridLayout1 = new GridLayout();
561 JPanel editLinkButtons = new JPanel();
562 editLinkButtons.setLayout(gridLayout1);
563 gridLayout1.setRows(3);
564 linkNameList.setFont(LABEL_FONT);
565 linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
566 BorderLayout borderLayout3 = new BorderLayout();
567 JPanel linkPanel2 = new JPanel();
568 linkPanel2.setLayout(borderLayout3);
569 linkURLList.setFont(LABEL_FONT);
570 linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
572 defaultBrowser.addMouseListener(new MouseAdapter()
574 public void mouseClicked(MouseEvent e)
576 if (e.getClickCount() > 1)
578 defaultBrowser_mouseClicked(e);
582 useProxy.setFont(LABEL_FONT);
583 useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
584 useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
585 useProxy.setText(MessageManager.getString("label.use_proxy_server"));
586 useProxy.addActionListener(new ActionListener()
588 public void actionPerformed(ActionEvent e)
590 useProxy_actionPerformed();
593 linkPanel.add(editLinkButtons, BorderLayout.EAST);
594 editLinkButtons.add(newLink, null);
595 editLinkButtons.add(editLink, null);
596 editLinkButtons.add(deleteLink, null);
597 linkPanel.add(linkScrollPane, BorderLayout.CENTER);
598 linkScrollPane.getViewport().add(linkPanel2, null);
599 linkPanel2.add(linkURLList, BorderLayout.CENTER);
600 linkPanel2.add(linkNameList, BorderLayout.WEST);
601 JPanel jPanel1 = new JPanel();
602 TitledBorder titledBorder1 = new TitledBorder(
603 MessageManager.getString("label.proxy_server"));
604 jPanel1.setBorder(titledBorder1);
605 jPanel1.setLayout(new GridBagLayout());
606 jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
607 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
609 jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
610 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
612 connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
613 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
614 16, 0, 0, 12), 359, -17));
615 connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
616 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
617 21, 0, 35, 12), 4, 6));
618 connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
619 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
620 new Insets(16, 0, 0, 0), 5, 1));
621 jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
622 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
624 jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
625 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
626 new Insets(0, 2, 4, 2), 54, 1));
627 jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
628 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
629 new Insets(0, 2, 4, 0), 263, 1));
630 connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
631 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
632 new Insets(15, 0, 0, 15), 307, 1));
633 connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
634 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
635 new Insets(0, 2, 4, 2), 70, 1));
636 connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
637 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
638 new Insets(0, 2, 4, 2), 70, 1));
639 connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
640 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
641 new Insets(0, 2, 4, 2), 70, 1));
646 * Initialises the parent panel which contains the tabbed sections.
650 private JPanel initOkCancelPanel()
652 JButton ok = new JButton();
653 ok.setText(MessageManager.getString("action.ok"));
654 ok.addActionListener(new ActionListener()
656 public void actionPerformed(ActionEvent e)
658 ok_actionPerformed(e);
661 JButton cancel = new JButton();
662 cancel.setText(MessageManager.getString("action.cancel"));
663 cancel.addActionListener(new ActionListener()
665 public void actionPerformed(ActionEvent e)
667 cancel_actionPerformed(e);
670 JPanel okCancelPanel = new JPanel();
671 okCancelPanel.add(ok);
672 okCancelPanel.add(cancel);
673 return okCancelPanel;
677 * Initialises the Colours tabbed panel.
681 private JPanel initColoursTab()
683 JPanel coloursTab = new JPanel();
684 coloursTab.setBorder(new TitledBorder(MessageManager
685 .getString("action.open_new_alignment")));
686 coloursTab.setLayout(new FlowLayout());
687 JLabel mincolourLabel = new JLabel();
688 mincolourLabel.setFont(LABEL_FONT);
689 mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
690 mincolourLabel.setText(MessageManager.getString("label.min_colour"));
691 minColour.setFont(LABEL_FONT);
692 minColour.setBorder(BorderFactory.createEtchedBorder());
693 minColour.setPreferredSize(new Dimension(40, 20));
694 minColour.addMouseListener(new MouseAdapter()
696 public void mousePressed(MouseEvent e)
698 minColour_actionPerformed(minColour);
701 JLabel maxcolourLabel = new JLabel();
702 maxcolourLabel.setFont(LABEL_FONT);
703 maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
704 maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
705 maxColour.setFont(LABEL_FONT);
706 maxColour.setBorder(BorderFactory.createEtchedBorder());
707 maxColour.setPreferredSize(new Dimension(40, 20));
708 maxColour.addMouseListener(new MouseAdapter()
710 public void mousePressed(MouseEvent e)
712 maxColour_actionPerformed(maxColour);
716 protColour.setFont(LABEL_FONT);
717 protColour.setBounds(new Rectangle(172, 225, 155, 21));
718 JLabel protColourLabel = new JLabel();
719 protColourLabel.setFont(LABEL_FONT);
720 protColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
721 protColourLabel.setText(MessageManager
722 .getString("label.prot_alignment_colour") + " ");
723 JvSwingUtils.addtoLayout(coloursTab, MessageManager
724 .getString("label.default_colour_scheme_for_alignment"),
725 protColourLabel, protColour);
727 nucColour.setFont(LABEL_FONT);
728 nucColour.setBounds(new Rectangle(172, 240, 155, 21));
729 JLabel nucColourLabel = new JLabel();
730 nucColourLabel.setFont(LABEL_FONT);
731 nucColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
732 nucColourLabel.setText(MessageManager
733 .getString("label.nuc_alignment_colour") + " ");
734 JvSwingUtils.addtoLayout(coloursTab, MessageManager
735 .getString("label.default_colour_scheme_for_alignment"),
736 nucColourLabel, nucColour);
738 JPanel annotationShding = new JPanel();
739 annotationShding.setBorder(new TitledBorder(MessageManager
740 .getString("label.annotation_shading_default")));
741 annotationShding.setLayout(new GridLayout(1, 2));
742 JvSwingUtils.addtoLayout(annotationShding, MessageManager
743 .getString("label.default_minimum_colour_annotation_shading"),
744 mincolourLabel, minColour);
745 JvSwingUtils.addtoLayout(annotationShding, MessageManager
746 .getString("label.default_maximum_colour_annotation_shading"),
747 maxcolourLabel, maxColour);
748 coloursTab.add(annotationShding); // , FlowLayout.LEFT);
753 * Initialises the Structure tabbed panel.
757 private JPanel initStructureTab()
759 structureTab = new JPanel();
761 structureTab.setBorder(new TitledBorder(MessageManager
762 .getString("label.structure_options")));
763 structureTab.setLayout(null);
764 final int width = 400;
765 final int height = 22;
766 final int lineSpacing = 25;
769 structFromPdb.setFont(LABEL_FONT);
771 .setText(MessageManager.getString("label.struct_from_pdb"));
772 structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
773 structFromPdb.addActionListener(new ActionListener()
776 public void actionPerformed(ActionEvent e)
778 boolean selected = structFromPdb.isSelected();
779 // enable other options only when the first is checked
780 useRnaView.setEnabled(selected);
781 addSecondaryStructure.setEnabled(selected);
782 addTempFactor.setEnabled(selected);
785 structureTab.add(structFromPdb);
787 // indent checkboxes that are conditional on the first one
789 useRnaView.setFont(LABEL_FONT);
790 useRnaView.setText(MessageManager.getString("label.use_rnaview"));
791 useRnaView.setBounds(new Rectangle(25, ypos, width, height));
792 structureTab.add(useRnaView);
795 addSecondaryStructure.setFont(LABEL_FONT);
796 addSecondaryStructure.setText(MessageManager
797 .getString("label.autoadd_secstr"));
798 addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
799 structureTab.add(addSecondaryStructure);
802 addTempFactor.setFont(LABEL_FONT);
803 addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
804 addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
805 structureTab.add(addTempFactor);
808 JLabel viewerLabel = new JLabel();
809 viewerLabel.setFont(LABEL_FONT);
810 viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
811 viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
812 viewerLabel.setBounds(new Rectangle(10, ypos, 200, height));
813 structureTab.add(viewerLabel);
815 structViewer.setFont(LABEL_FONT);
816 structViewer.setBounds(new Rectangle(160, ypos, 120, height));
817 structViewer.addItem(ViewerType.JMOL.name());
818 structViewer.addItem(ViewerType.CHIMERA.name());
819 structViewer.addActionListener(new ActionListener()
822 public void actionPerformed(ActionEvent e)
824 structureViewer_actionPerformed((String) structViewer
828 structureTab.add(structViewer);
831 JLabel pathLabel = new JLabel();
832 pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
833 pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
834 pathLabel.setText(MessageManager.getString("label.chimera_path"));
835 final String tooltip = JvSwingUtils.wrapTooltip(true,
836 MessageManager.getString("label.chimera_path_tip"));
837 pathLabel.setToolTipText(tooltip);
838 pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
839 structureTab.add(pathLabel);
841 chimeraPath.setFont(LABEL_FONT);
842 chimeraPath.setText("");
843 chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
844 chimeraPath.addMouseListener(new MouseAdapter()
847 public void mouseClicked(MouseEvent e)
849 if (e.getClickCount() == 2)
851 String chosen = openFileChooser();
854 chimeraPath.setText(chosen);
859 structureTab.add(chimeraPath);
862 // scrl_pdbDocFieldConfig.setPreferredSize(new Dimension(450, 100));
863 // scrl_pdbDocFieldConfig
864 // .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
865 // scrl_pdbDocFieldConfig.setBounds();
866 PDBDocFieldPreferences docFieldPref = new PDBDocFieldPreferences(
867 PreferenceSource.PREFERENCES);
868 docFieldPref.setBounds(new Rectangle(10, ypos + 5, 450, 120));
869 structureTab.add(docFieldPref);
875 * Action on choosing a structure viewer from combobox options.
877 * @param selectedItem
879 protected void structureViewer_actionPerformed(String selectedItem)
884 * Show a dialog for the user to choose a file. Returns the chosen path, or
889 protected String openFileChooser()
891 String choice = null;
892 JFileChooser chooser = new JFileChooser();
894 // chooser.setFileView(new JalviewFileView());
895 chooser.setDialogTitle(MessageManager
896 .getString("label.open_local_file"));
897 chooser.setToolTipText(MessageManager.getString("action.open"));
899 int value = chooser.showOpenDialog(this);
901 if (value == JFileChooser.APPROVE_OPTION)
903 choice = chooser.getSelectedFile().getPath();
909 * Validate the structure tab preferences; if invalid, set focus on this tab.
913 protected boolean validateStructure(FocusEvent e)
915 if (!validateStructure())
917 e.getComponent().requestFocusInWindow();
923 protected boolean validateStructure()
929 * Initialises the Visual tabbed panel.
933 private JPanel initVisualTab()
935 JPanel visualTab = new JPanel();
936 visualTab.setBorder(new TitledBorder(MessageManager
937 .getString("action.open_new_alignment")));
938 visualTab.setLayout(null);
939 fullScreen.setFont(LABEL_FONT);
940 fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
941 fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
942 fullScreen.setText(MessageManager.getString("label.maximize_window"));
943 quality.setEnabled(false);
944 quality.setFont(LABEL_FONT);
945 quality.setHorizontalAlignment(SwingConstants.RIGHT);
946 quality.setHorizontalTextPosition(SwingConstants.LEFT);
947 quality.setSelected(true);
948 quality.setText(MessageManager.getString("label.quality"));
949 conservation.setEnabled(false);
950 conservation.setFont(LABEL_FONT);
951 conservation.setHorizontalAlignment(SwingConstants.RIGHT);
952 conservation.setHorizontalTextPosition(SwingConstants.LEFT);
953 conservation.setSelected(true);
954 conservation.setText(MessageManager.getString("label.conservation"));
955 identity.setEnabled(false);
956 identity.setFont(LABEL_FONT);
957 identity.setHorizontalAlignment(SwingConstants.RIGHT);
958 identity.setHorizontalTextPosition(SwingConstants.LEFT);
959 identity.setSelected(true);
960 identity.setText(MessageManager.getString("label.consensus"));
961 JLabel showGroupbits = new JLabel();
962 showGroupbits.setFont(LABEL_FONT);
963 showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
964 showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
965 showGroupbits.setText(MessageManager.getString("action.show_group")
967 JLabel showConsensbits = new JLabel();
968 showConsensbits.setFont(LABEL_FONT);
969 showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
970 showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
971 showConsensbits.setText(MessageManager.getString("label.consensus")
973 showConsensHistogram.setEnabled(false);
974 showConsensHistogram.setFont(LABEL_FONT);
975 showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
976 showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
977 showConsensHistogram.setSelected(true);
978 showConsensHistogram.setText(MessageManager
979 .getString("label.histogram"));
980 showConsensLogo.setEnabled(false);
981 showConsensLogo.setFont(LABEL_FONT);
982 showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
983 showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
984 showConsensLogo.setSelected(true);
985 showConsensLogo.setText(MessageManager.getString("label.logo"));
986 showGroupConsensus.setEnabled(false);
987 showGroupConsensus.setFont(LABEL_FONT);
988 showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
989 showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
990 showGroupConsensus.setSelected(true);
991 showGroupConsensus.setText(MessageManager.getString("label.consensus"));
992 showGroupConservation.setEnabled(false);
993 showGroupConservation.setFont(LABEL_FONT);
994 showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
995 showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
996 showGroupConservation.setSelected(true);
997 showGroupConservation.setText(MessageManager
998 .getString("label.conservation"));
999 showNpTooltip.setEnabled(true);
1000 showNpTooltip.setFont(LABEL_FONT);
1001 showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
1002 showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
1003 showNpTooltip.setSelected(true);
1004 showNpTooltip.setText(MessageManager
1005 .getString("label.non_positional_features"));
1006 showDbRefTooltip.setEnabled(true);
1007 showDbRefTooltip.setFont(LABEL_FONT);
1008 showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
1009 showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
1010 showDbRefTooltip.setSelected(true);
1011 showDbRefTooltip.setText(MessageManager
1012 .getString("label.database_references"));
1013 annotations.setFont(LABEL_FONT);
1014 annotations.setHorizontalAlignment(SwingConstants.RIGHT);
1015 annotations.setHorizontalTextPosition(SwingConstants.LEADING);
1016 annotations.setSelected(true);
1017 annotations.setText(MessageManager.getString("label.show_annotations"));
1018 annotations.setBounds(new Rectangle(169, 12, 200, 23));
1019 annotations.addActionListener(new ActionListener()
1021 public void actionPerformed(ActionEvent e)
1023 annotations_actionPerformed(e);
1026 identity.addActionListener(new ActionListener()
1028 public void actionPerformed(ActionEvent e)
1030 annotations_actionPerformed(e);
1033 showGroupConsensus.addActionListener(new ActionListener()
1035 public void actionPerformed(ActionEvent e)
1037 annotations_actionPerformed(e);
1040 showUnconserved.setFont(LABEL_FONT);
1041 showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
1042 showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
1043 showUnconserved.setSelected(true);
1044 showUnconserved.setText(MessageManager
1045 .getString("action.show_unconserved"));
1046 showUnconserved.addActionListener(new ActionListener()
1048 public void actionPerformed(ActionEvent e)
1050 showunconserved_actionPerformed(e);
1054 // TODO these are not yet added to / action from Preferences
1055 // JCheckBox shareSelections = new JCheckBox();
1056 // shareSelections.setFont(verdana11);
1057 // shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
1058 // shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
1059 // shareSelections.setSelected(true);
1060 // shareSelections.setText(MessageManager
1061 // .getString("label.share_selection_across_views"));
1062 // JCheckBox followHighlight = new JCheckBox();
1063 // followHighlight.setFont(verdana11);
1064 // followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
1065 // followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
1066 // // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
1067 // followHighlight.setSelected(true);
1068 // followHighlight.setText(MessageManager
1069 // .getString("label.scroll_highlighted_regions"));
1071 seqLimit.setFont(LABEL_FONT);
1072 seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
1073 seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
1074 seqLimit.setText(MessageManager.getString("label.full_sequence_id"));
1075 smoothFont.setFont(LABEL_FONT);
1076 smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
1077 smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
1078 smoothFont.setText(MessageManager.getString("label.smooth_font"));
1079 scaleProteinToCdna.setFont(LABEL_FONT);
1080 scaleProteinToCdna.setHorizontalAlignment(SwingConstants.RIGHT);
1081 scaleProteinToCdna.setHorizontalTextPosition(SwingConstants.LEADING);
1082 scaleProteinToCdna.setText(MessageManager
1083 .getString("label.scale_protein_to_cdna"));
1084 scaleProteinToCdna.setToolTipText(MessageManager
1085 .getString("label.scale_protein_to_cdna_tip"));
1086 JLabel gapLabel = new JLabel();
1087 gapLabel.setFont(LABEL_FONT);
1088 gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1089 gapLabel.setText(MessageManager.getString("label.gap_symbol") + " ");
1090 JLabel fontLabel = new JLabel();
1091 fontLabel.setFont(LABEL_FONT);
1092 fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1093 fontLabel.setText(MessageManager.getString("label.font"));
1094 fontSizeCB.setFont(LABEL_FONT);
1095 fontSizeCB.setBounds(new Rectangle(320, 112, 65, 23));
1096 fontStyleCB.setFont(LABEL_FONT);
1097 fontStyleCB.setBounds(new Rectangle(382, 112, 80, 23));
1098 fontNameCB.setFont(LABEL_FONT);
1099 fontNameCB.setBounds(new Rectangle(172, 112, 147, 23));
1100 gapSymbolCB.setFont(LABEL_FONT);
1101 gapSymbolCB.setBounds(new Rectangle(172, 215, 69, 23));
1102 DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
1103 dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
1104 gapSymbolCB.setRenderer(dlcr);
1106 startupCheckbox.setText(MessageManager.getString("action.open_file"));
1107 startupCheckbox.setFont(LABEL_FONT);
1108 startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
1109 startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
1110 startupCheckbox.setSelected(true);
1111 startupFileTextfield.setFont(LABEL_FONT);
1112 startupFileTextfield.setBounds(new Rectangle(172, 310, 330, 20));
1113 startupFileTextfield.addMouseListener(new MouseAdapter()
1115 public void mouseClicked(MouseEvent e)
1117 if (e.getClickCount() > 1)
1119 startupFileTextfield_mouseClicked();
1124 sortby.setFont(LABEL_FONT);
1125 sortby.setBounds(new Rectangle(172, 260, 155, 21));
1126 JLabel sortLabel = new JLabel();
1127 sortLabel.setFont(LABEL_FONT);
1128 sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1129 sortLabel.setText(MessageManager.getString("label.sort_by"));
1130 sortAnnBy.setFont(LABEL_FONT);
1131 sortAnnBy.setBounds(new Rectangle(172, 285, 110, 21));
1132 JLabel sortAnnLabel = new JLabel();
1133 sortAnnLabel.setFont(LABEL_FONT);
1134 sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
1135 sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
1136 sortAutocalc.setFont(LABEL_FONT);
1137 sortAutocalc.setBounds(new Rectangle(290, 285, 165, 21));
1139 JPanel annsettingsPanel = new JPanel();
1140 annsettingsPanel.setBounds(new Rectangle(173, 34, 320, 75));
1141 annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
1142 annsettingsPanel.setBorder(new EtchedBorder());
1143 visualTab.add(annsettingsPanel);
1144 Border jb = new EmptyBorder(1, 1, 4, 5);
1145 quality.setBorder(jb);
1146 conservation.setBorder(jb);
1147 identity.setBorder(jb);
1148 showConsensbits.setBorder(jb);
1149 showGroupbits.setBorder(jb);
1150 showGroupConsensus.setBorder(jb);
1151 showGroupConservation.setBorder(jb);
1152 showConsensHistogram.setBorder(jb);
1153 showConsensLogo.setBorder(jb);
1155 JPanel autoAnnotSettings = new JPanel();
1156 autoAnnotSettings.setLayout(new GridLayout(3, 3));
1157 annsettingsPanel.add(autoAnnotSettings);
1158 autoAnnotSettings.add(quality);
1159 autoAnnotSettings.add(conservation);
1160 autoAnnotSettings.add(identity);
1161 autoAnnotSettings.add(showGroupbits);
1162 autoAnnotSettings.add(showGroupConservation);
1163 autoAnnotSettings.add(showGroupConsensus);
1164 autoAnnotSettings.add(showConsensbits);
1165 autoAnnotSettings.add(showConsensHistogram);
1166 autoAnnotSettings.add(showConsensLogo);
1168 JPanel tooltipSettings = new JPanel();
1169 tooltipSettings.setBorder(new TitledBorder(MessageManager
1170 .getString("label.sequence_id_tooltip")));
1171 tooltipSettings.setBounds(173, 140, 220, 62);
1172 tooltipSettings.setLayout(new GridLayout(2, 1));
1173 tooltipSettings.add(showDbRefTooltip);
1174 tooltipSettings.add(showNpTooltip);
1175 visualTab.add(tooltipSettings);
1177 wrap.setFont(LABEL_FONT);
1178 wrap.setHorizontalAlignment(SwingConstants.TRAILING);
1179 wrap.setHorizontalTextPosition(SwingConstants.LEADING);
1180 wrap.setText(MessageManager.getString("label.wrap_alignment"));
1181 rightAlign.setFont(LABEL_FONT);
1182 rightAlign.setForeground(Color.black);
1183 rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
1184 rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
1185 rightAlign.setText(MessageManager.getString("label.right_align_ids"));
1186 idItalics.setFont(LABEL_FONT_ITALIC);
1187 idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
1188 idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
1189 idItalics.setText(MessageManager
1190 .getString("label.sequence_name_italics"));
1191 openoverv.setFont(LABEL_FONT);
1192 openoverv.setActionCommand(MessageManager
1193 .getString("label.open_overview"));
1194 openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
1195 openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
1196 openoverv.setText(MessageManager.getString(("label.open_overview")));
1197 JPanel jPanel2 = new JPanel();
1198 jPanel2.setBounds(new Rectangle(7, 17, 158, 310));
1199 jPanel2.setLayout(new GridLayout(14, 1));
1200 jPanel2.add(fullScreen);
1201 jPanel2.add(openoverv);
1202 jPanel2.add(seqLimit);
1203 jPanel2.add(rightAlign);
1204 jPanel2.add(fontLabel);
1205 jPanel2.add(showUnconserved);
1206 jPanel2.add(idItalics);
1207 jPanel2.add(smoothFont);
1208 jPanel2.add(scaleProteinToCdna);
1209 jPanel2.add(gapLabel);
1211 jPanel2.add(sortLabel);
1212 jPanel2.add(sortAnnLabel);
1213 jPanel2.add(startupCheckbox);
1214 visualTab.add(jPanel2);
1215 visualTab.add(annotations);
1216 visualTab.add(startupFileTextfield);
1217 visualTab.add(sortby);
1218 visualTab.add(sortAnnBy);
1219 visualTab.add(sortAutocalc);
1220 visualTab.add(gapSymbolCB);
1221 visualTab.add(fontNameCB);
1222 visualTab.add(fontSizeCB);
1223 visualTab.add(fontStyleCB);
1227 protected void autoIdWidth_actionPerformed()
1229 // TODO Auto-generated method stub
1233 protected void userIdWidth_actionPerformed()
1235 // TODO Auto-generated method stub
1239 protected void maxColour_actionPerformed(JPanel panel)
1243 protected void minColour_actionPerformed(JPanel panel)
1247 protected void showunconserved_actionPerformed(ActionEvent e)
1249 // TODO Auto-generated method stub
1259 public void ok_actionPerformed(ActionEvent e)
1269 public void cancel_actionPerformed(ActionEvent e)
1279 public void annotations_actionPerformed(ActionEvent e)
1286 public void startupFileTextfield_mouseClicked()
1290 public void newLink_actionPerformed(ActionEvent e)
1295 public void editLink_actionPerformed(ActionEvent e)
1300 public void deleteLink_actionPerformed(ActionEvent e)
1305 public void defaultBrowser_mouseClicked(MouseEvent e)
1310 public void linkURLList_keyTyped(KeyEvent e)
1315 public void useProxy_actionPerformed()
1317 proxyServerTB.setEnabled(useProxy.isSelected());
1318 proxyPortTB.setEnabled(useProxy.isSelected());