2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 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.Viewer;
25 import jalview.util.MessageManager;
27 import java.awt.BorderLayout;
28 import java.awt.Color;
29 import java.awt.Dimension;
30 import java.awt.FlowLayout;
32 import java.awt.GridBagConstraints;
33 import java.awt.GridBagLayout;
34 import java.awt.GridLayout;
35 import java.awt.Insets;
36 import java.awt.Rectangle;
37 import java.awt.event.ActionEvent;
38 import java.awt.event.ActionListener;
39 import java.awt.event.KeyEvent;
40 import java.awt.event.MouseAdapter;
41 import java.awt.event.MouseEvent;
43 import javax.swing.BorderFactory;
44 import javax.swing.DefaultListCellRenderer;
45 import javax.swing.JButton;
46 import javax.swing.JCheckBox;
47 import javax.swing.JComboBox;
48 import javax.swing.JLabel;
49 import javax.swing.JList;
50 import javax.swing.JPanel;
51 import javax.swing.JScrollPane;
52 import javax.swing.JTabbedPane;
53 import javax.swing.JTextField;
54 import javax.swing.ListSelectionModel;
55 import javax.swing.SwingConstants;
56 import javax.swing.border.Border;
57 import javax.swing.border.EmptyBorder;
58 import javax.swing.border.TitledBorder;
59 import javax.swing.event.ListSelectionEvent;
60 import javax.swing.event.ListSelectionListener;
63 * Base class for the Preferences panel.
68 public class GPreferences extends JPanel
70 private static final Font verdana11 = JvSwingUtils.getLabelFont();
73 * Visual tab components
75 protected JCheckBox fullScreen = new JCheckBox();
77 protected JCheckBox openoverv = new JCheckBox();
79 protected JCheckBox seqLimit = new JCheckBox();
81 protected JCheckBox rightAlign = new JCheckBox();
83 protected JComboBox<String> fontSizeCB = new JComboBox<String>();
85 protected JComboBox<String> fontStyleCB = new JComboBox<String>();
87 protected JComboBox<String> fontNameCB = new JComboBox<String>();
89 protected JCheckBox showUnconserved = new JCheckBox();
91 protected JCheckBox idItalics = new JCheckBox();
93 protected JCheckBox smoothFont = new JCheckBox();
95 protected JComboBox<String> gapSymbolCB = new JComboBox<String>();
97 protected JCheckBox wrap = new JCheckBox();
99 protected JComboBox<String> sortby = new JComboBox<String>();
101 protected JComboBox<String> sortAnnBy = new JComboBox<String>();
103 protected JComboBox<String> sortAutocalc = new JComboBox<String>();
105 protected JCheckBox startupCheckbox = new JCheckBox();
107 protected JTextField startupFileTextfield = new JTextField();
109 // below are in the 'second column'
110 protected JCheckBox annotations = new JCheckBox();
112 protected JCheckBox quality = new JCheckBox();
114 protected JCheckBox conservation = new JCheckBox();
116 protected JCheckBox identity = new JCheckBox();
118 protected JCheckBox showGroupConsensus = new JCheckBox();
120 protected JCheckBox showGroupConservation = new JCheckBox();
122 protected JCheckBox showConsensHistogram = new JCheckBox();
124 protected JCheckBox showConsensLogo = new JCheckBox();
126 protected JCheckBox showDbRefTooltip = new JCheckBox();
128 protected JCheckBox showNpTooltip = new JCheckBox();
131 * Annotations tab components
133 protected JCheckBox structFromPdb = new JCheckBox();
135 protected JCheckBox useRnaView = new JCheckBox();
137 protected JCheckBox addSecondaryStructure = new JCheckBox();
139 protected JCheckBox addTempFactor = new JCheckBox();
141 protected JComboBox<String> structViewer = new JComboBox<String>();
144 * Colours tab components
146 protected JPanel minColour = new JPanel();
148 protected JPanel maxColour = new JPanel();
150 protected JComboBox<String> colour = new JComboBox<String>();
153 * Connections tab components
155 protected JList linkURLList = new JList();
157 protected JTextField proxyServerTB = new JTextField();
159 protected JTextField proxyPortTB = new JTextField();
161 protected JTextField defaultBrowser = new JTextField();
163 protected JList linkNameList = new JList();
165 protected JCheckBox useProxy = new JCheckBox();
167 protected JCheckBox usagestats = new JCheckBox();
169 protected JCheckBox questionnaire = new JCheckBox();
171 protected JCheckBox versioncheck = new JCheckBox();
174 * Output tab components
176 protected JComboBox<String> epsRendering = new JComboBox<String>();
178 protected JLabel userIdWidthlabel = new JLabel();
180 protected JCheckBox autoIdWidth = new JCheckBox();
182 protected JTextField userIdWidth = new JTextField();
184 protected JCheckBox blcjv = new JCheckBox();
186 protected JCheckBox pileupjv = new JCheckBox();
188 protected JCheckBox clustaljv = new JCheckBox();
190 protected JCheckBox msfjv = new JCheckBox();
192 protected JCheckBox fastajv = new JCheckBox();
194 protected JCheckBox pfamjv = new JCheckBox();
196 protected JCheckBox pirjv = new JCheckBox();
198 protected JCheckBox modellerOutput = new JCheckBox();
201 * Editing tab components
203 protected JCheckBox autoCalculateConsCheck = new JCheckBox();
205 protected JCheckBox padGaps = new JCheckBox();
207 protected JCheckBox sortByTree = new JCheckBox();
212 protected JPanel dasTab = new JPanel();
217 protected JPanel wsTab = new JPanel();
220 * Creates a new GPreferences object.
222 public GPreferences()
227 } catch (Exception ex)
229 ex.printStackTrace();
234 * Construct the panel and its tabbed sub-panels.
238 private void jbInit() throws Exception
240 JTabbedPane tabbedPane = new JTabbedPane();
241 this.setLayout(new BorderLayout());
242 JPanel okCancelPanel = initOkCancelPanel();
243 this.add(tabbedPane, BorderLayout.CENTER);
244 this.add(okCancelPanel, BorderLayout.SOUTH);
246 tabbedPane.add(initVisualTab(),
247 MessageManager.getString("label.visual"));
249 tabbedPane.add(initColoursTab(),
250 MessageManager.getString("label.colours"));
252 tabbedPane.add(initStructureTab(),
253 MessageManager.getString("label.structure"));
255 tabbedPane.add(initConnectionsTab(),
256 MessageManager.getString("label.connections"));
258 tabbedPane.add(initOutputTab(), MessageManager.getString("label.output"));
260 tabbedPane.add(initEditingTab(), MessageManager.getString("label.editing"));
263 * See DasSourceBrowser for the real work of configuring this tab.
265 dasTab.setLayout(new BorderLayout());
267 .add(dasTab, MessageManager.getString("label.das_settings"));
270 * See WsPreferences for the real work of configuring this tab.
272 wsTab.setLayout(new BorderLayout());
273 tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
277 * Initialises the Editing tabbed panel.
281 private JPanel initEditingTab()
283 JPanel editingTab = new JPanel();
284 editingTab.setLayout(null);
285 autoCalculateConsCheck.setFont(verdana11);
286 autoCalculateConsCheck.setText(MessageManager
287 .getString("label.autocalculate_consensus"));
288 autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
289 padGaps.setFont(verdana11);
290 padGaps.setText(MessageManager.getString("label.pad_gaps_when_editing"));
291 padGaps.setBounds(new Rectangle(22, 94, 168, 23));
292 sortByTree.setFont(verdana11);
294 .setText(MessageManager.getString("label.sort_with_new_tree"));
296 .setToolTipText(MessageManager
297 .getString("label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
298 sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
299 editingTab.add(autoCalculateConsCheck);
300 editingTab.add(padGaps);
301 editingTab.add(sortByTree);
306 * Initialises the Output tabbed panel.
310 private JPanel initOutputTab()
312 JPanel outputTab = new JPanel();
313 outputTab.setLayout(null);
314 JLabel epsLabel = new JLabel();
315 epsLabel.setFont(verdana11);
316 epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
317 epsLabel.setText(MessageManager.getString("label.eps_rendering_style"));
318 epsLabel.setBounds(new Rectangle(9, 31, 140, 24));
319 epsRendering.setFont(verdana11);
320 epsRendering.setBounds(new Rectangle(154, 34, 187, 21));
321 JLabel jLabel1 = new JLabel();
322 jLabel1.setFont(verdana11);
323 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
324 jLabel1.setText(MessageManager.getString("label.append_start_end"));
325 jLabel1.setFont(verdana11);
326 fastajv.setFont(verdana11);
327 fastajv.setHorizontalAlignment(SwingConstants.LEFT);
328 clustaljv.setText(MessageManager.getString("label.clustal") + " ");
329 blcjv.setText(MessageManager.getString("label.blc") + " ");
330 fastajv.setText(MessageManager.getString("label.fasta") + " ");
331 msfjv.setText(MessageManager.getString("label.msf") + " ");
332 pfamjv.setText(MessageManager.getString("label.pfam") + " ");
333 pileupjv.setText(MessageManager.getString("label.pileup") + " ");
334 msfjv.setFont(verdana11);
335 msfjv.setHorizontalAlignment(SwingConstants.LEFT);
336 pirjv.setText(MessageManager.getString("label.pir") + " ");
337 JPanel jPanel11 = new JPanel();
338 jPanel11.setFont(verdana11);
339 TitledBorder titledBorder2 = new TitledBorder(
340 MessageManager.getString("label.file_output"));
341 jPanel11.setBorder(titledBorder2);
342 jPanel11.setBounds(new Rectangle(30, 72, 196, 182));
343 GridLayout gridLayout3 = new GridLayout();
344 jPanel11.setLayout(gridLayout3);
345 gridLayout3.setRows(8);
346 blcjv.setFont(verdana11);
347 blcjv.setHorizontalAlignment(SwingConstants.LEFT);
348 clustaljv.setFont(verdana11);
349 clustaljv.setHorizontalAlignment(SwingConstants.LEFT);
350 pfamjv.setFont(verdana11);
351 pfamjv.setHorizontalAlignment(SwingConstants.LEFT);
352 pileupjv.setFont(verdana11);
353 pileupjv.setHorizontalAlignment(SwingConstants.LEFT);
354 pirjv.setFont(verdana11);
355 pirjv.setHorizontalAlignment(SwingConstants.LEFT);
356 autoIdWidth.setFont(verdana11);
357 autoIdWidth.setText(MessageManager
358 .getString("label.automatically_set_id_width"));
360 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.adjusts_width_generated_eps_png")));
361 autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23));
362 autoIdWidth.addActionListener(new ActionListener()
366 public void actionPerformed(ActionEvent e)
368 autoIdWidth_actionPerformed();
371 userIdWidthlabel.setFont(verdana11);
372 userIdWidthlabel.setText(MessageManager
373 .getString("label.figure_id_column_width"));
375 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column")));
377 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column")));
378 userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23));
379 userIdWidth.setFont(JvSwingUtils.getTextAreaFont());
380 userIdWidth.setText("");
381 userIdWidth.setBounds(new Rectangle(232, 144, 84, 23));
382 userIdWidth.addActionListener(new ActionListener()
386 public void actionPerformed(ActionEvent e)
388 userIdWidth_actionPerformed();
391 jPanel11.add(jLabel1);
393 jPanel11.add(clustaljv);
394 jPanel11.add(fastajv);
396 jPanel11.add(pfamjv);
397 jPanel11.add(pileupjv);
399 outputTab.add(autoIdWidth);
400 outputTab.add(userIdWidth);
401 outputTab.add(userIdWidthlabel);
402 outputTab.add(modellerOutput);
403 outputTab.add(epsLabel);
404 outputTab.add(epsRendering);
405 outputTab.add(jPanel11);
406 modellerOutput.setFont(verdana11);
407 modellerOutput.setText(MessageManager
408 .getString("label.use_modeller_output"));
409 modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
414 * Initialises the Connections tabbed panel.
418 private JPanel initConnectionsTab()
420 JPanel connectTab = new JPanel();
421 connectTab.setLayout(new GridBagLayout());
422 JLabel serverLabel = new JLabel();
423 serverLabel.setText(MessageManager.getString("label.address"));
424 serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
425 serverLabel.setFont(verdana11);
426 proxyServerTB.setFont(verdana11);
427 proxyPortTB.setFont(verdana11);
428 JLabel portLabel = new JLabel();
429 portLabel.setFont(verdana11);
430 portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
431 portLabel.setText(MessageManager.getString("label.port"));
432 JLabel browserLabel = new JLabel();
433 browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
434 browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
435 browserLabel.setText(MessageManager
436 .getString("label.default_browser_unix"));
437 defaultBrowser.setFont(verdana11);
438 defaultBrowser.setText("");
439 usagestats.setText(MessageManager
440 .getString("label.send_usage_statistics"));
441 usagestats.setFont(verdana11);
442 usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
443 usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
444 questionnaire.setText(MessageManager
445 .getString("label.check_for_questionnaires"));
446 questionnaire.setFont(verdana11);
447 questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
448 questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
449 versioncheck.setText(MessageManager
450 .getString("label.check_for_latest_version"));
451 versioncheck.setFont(verdana11);
452 versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
453 versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
454 JButton newLink = new JButton();
455 newLink.setText(MessageManager.getString("action.new"));
456 newLink.addActionListener(new java.awt.event.ActionListener()
458 public void actionPerformed(ActionEvent e)
460 newLink_actionPerformed(e);
463 JButton editLink = new JButton();
464 editLink.setText(MessageManager.getString("action.edit"));
465 editLink.addActionListener(new java.awt.event.ActionListener()
467 public void actionPerformed(ActionEvent e)
469 editLink_actionPerformed(e);
472 JButton deleteLink = new JButton();
473 deleteLink.setText(MessageManager.getString("action.delete"));
474 deleteLink.addActionListener(new java.awt.event.ActionListener()
476 public void actionPerformed(ActionEvent e)
478 deleteLink_actionPerformed(e);
482 linkURLList.addListSelectionListener(new ListSelectionListener()
484 public void valueChanged(ListSelectionEvent e)
486 int index = linkURLList.getSelectedIndex();
487 linkNameList.setSelectedIndex(index);
491 linkNameList.addListSelectionListener(new ListSelectionListener()
493 public void valueChanged(ListSelectionEvent e)
495 int index = linkNameList.getSelectedIndex();
496 linkURLList.setSelectedIndex(index);
500 JScrollPane linkScrollPane = new JScrollPane();
501 linkScrollPane.setBorder(null);
502 JPanel linkPanel = new JPanel();
503 linkPanel.setBorder(new TitledBorder(MessageManager
504 .getString("label.url_linkfrom_sequence_id")));
505 linkPanel.setLayout(new BorderLayout());
506 GridLayout gridLayout1 = new GridLayout();
507 JPanel editLinkButtons = new JPanel();
508 editLinkButtons.setLayout(gridLayout1);
509 gridLayout1.setRows(3);
510 linkNameList.setFont(verdana11);
511 linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
512 BorderLayout borderLayout3 = new BorderLayout();
513 JPanel linkPanel2 = new JPanel();
514 linkPanel2.setLayout(borderLayout3);
515 linkURLList.setFont(verdana11);
516 linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
518 defaultBrowser.addMouseListener(new MouseAdapter()
520 public void mouseClicked(MouseEvent e)
522 if (e.getClickCount() > 1)
524 defaultBrowser_mouseClicked(e);
528 useProxy.setFont(verdana11);
529 useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
530 useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
531 useProxy.setText(MessageManager.getString("label.use_proxy_server"));
532 useProxy.addActionListener(new ActionListener()
534 public void actionPerformed(ActionEvent e)
536 useProxy_actionPerformed();
539 linkPanel.add(editLinkButtons, BorderLayout.EAST);
540 editLinkButtons.add(newLink, null);
541 editLinkButtons.add(editLink, null);
542 editLinkButtons.add(deleteLink, null);
543 linkPanel.add(linkScrollPane, BorderLayout.CENTER);
544 linkScrollPane.getViewport().add(linkPanel2, null);
545 linkPanel2.add(linkURLList, BorderLayout.CENTER);
546 linkPanel2.add(linkNameList, BorderLayout.WEST);
547 JPanel jPanel1 = new JPanel();
548 TitledBorder titledBorder1 = new TitledBorder(
549 MessageManager.getString("label.proxy_server"));
550 jPanel1.setBorder(titledBorder1);
551 jPanel1.setLayout(new GridBagLayout());
552 jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
553 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
555 jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
556 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
558 connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
559 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
560 16, 0, 0, 12), 359, -17));
561 connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
562 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
563 21, 0, 35, 12), 4, 6));
564 connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
565 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
566 new Insets(16, 0, 0, 0), 5, 1));
567 jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
568 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
570 jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
571 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
572 new Insets(0, 2, 4, 2), 54, 1));
573 jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
574 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
575 new Insets(0, 2, 4, 0), 263, 1));
576 connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
577 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
578 new Insets(15, 0, 0, 15), 307, 1));
579 connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
580 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
581 new Insets(0, 2, 4, 2), 70, 1));
582 connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
583 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
584 new Insets(0, 2, 4, 2), 70, 1));
585 connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
586 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
587 new Insets(0, 2, 4, 2), 70, 1));
592 * Initialises the parent panel which contains the tabbed sections.
596 private JPanel initOkCancelPanel()
598 JButton ok = new JButton();
599 ok.setText(MessageManager.getString("action.ok"));
600 ok.addActionListener(new ActionListener()
602 public void actionPerformed(ActionEvent e)
604 ok_actionPerformed(e);
607 JButton cancel = new JButton();
608 cancel.setText(MessageManager.getString("action.cancel"));
609 cancel.addActionListener(new ActionListener()
611 public void actionPerformed(ActionEvent e)
613 cancel_actionPerformed(e);
616 JPanel okCancelPanel = new JPanel();
617 okCancelPanel.add(ok);
618 okCancelPanel.add(cancel);
619 return okCancelPanel;
623 * Initialises the Colours tabbed panel.
627 private JPanel initColoursTab()
629 JPanel coloursTab = new JPanel();
630 coloursTab.setBorder(new TitledBorder(MessageManager
631 .getString("action.open_new_alignment")));
632 coloursTab.setLayout(new FlowLayout());
633 JLabel mincolourLabel = new JLabel();
634 mincolourLabel.setFont(verdana11);
635 mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
636 mincolourLabel.setText(MessageManager.getString("label.min_colour"));
637 minColour.setFont(verdana11);
638 minColour.setBorder(BorderFactory.createEtchedBorder());
639 minColour.setPreferredSize(new Dimension(40, 20));
640 minColour.addMouseListener(new MouseAdapter()
642 public void mousePressed(MouseEvent e)
644 minColour_actionPerformed(minColour);
647 JLabel maxcolourLabel = new JLabel();
648 maxcolourLabel.setFont(verdana11);
649 maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
650 maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
651 maxColour.setFont(verdana11);
652 maxColour.setBorder(BorderFactory.createEtchedBorder());
653 maxColour.setPreferredSize(new Dimension(40, 20));
654 maxColour.addMouseListener(new MouseAdapter()
656 public void mousePressed(MouseEvent e)
658 maxColour_actionPerformed(maxColour);
661 colour.setFont(verdana11);
662 colour.setBounds(new Rectangle(172, 225, 155, 21));
663 JLabel colourLabel = new JLabel();
664 colourLabel.setFont(verdana11);
665 colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
666 colourLabel.setText(MessageManager.getString("label.alignment_colour")
668 JvSwingUtils.addtoLayout(coloursTab, MessageManager
669 .getString("label.default_colour_scheme_for_alignment"),
670 colourLabel, colour);
671 JPanel annotationShding = new JPanel();
672 annotationShding.setBorder(new TitledBorder(MessageManager
673 .getString("label.annotation_shading_default")));
674 annotationShding.setLayout(new GridLayout(1, 2));
675 JvSwingUtils.addtoLayout(annotationShding, MessageManager
676 .getString("label.default_minimum_colour_annotation_shading"),
677 mincolourLabel, minColour);
678 JvSwingUtils.addtoLayout(annotationShding, MessageManager
679 .getString("label.default_maximum_colour_annotation_shading"),
680 maxcolourLabel, maxColour);
681 coloursTab.add(annotationShding); // , FlowLayout.LEFT);
686 * Initialises the Structure tabbed panel.
690 private JPanel initStructureTab()
692 JPanel structureTab = new JPanel();
693 structureTab.setBorder(new TitledBorder(MessageManager
694 .getString("label.structure_options")));
695 structureTab.setLayout(null);
696 final int width = 400;
697 final int height = 23;
698 final int lineSpacing = 30;
701 structFromPdb.setFont(verdana11);
702 structFromPdb.setText(MessageManager.getString("label.struct_from_pdb"));
703 structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
704 structFromPdb.addActionListener(new ActionListener()
707 public void actionPerformed(ActionEvent e)
709 boolean selected = structFromPdb.isSelected();
710 // enable other options only when the first is checked
711 useRnaView.setEnabled(selected);
712 addSecondaryStructure.setEnabled(selected);
713 addTempFactor.setEnabled(selected);
716 structureTab.add(structFromPdb);
718 // indent checkboxes that are conditional on the first one
720 useRnaView.setFont(verdana11);
721 useRnaView.setText(MessageManager.getString("label.use_rnaview"));
722 useRnaView.setBounds(new Rectangle(25, ypos, width, height));
723 structureTab.add(useRnaView);
726 addSecondaryStructure.setFont(verdana11);
727 addSecondaryStructure.setText(MessageManager
728 .getString("label.autoadd_secstr"));
729 addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
730 structureTab.add(addSecondaryStructure);
733 addTempFactor.setFont(verdana11);
734 addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
735 addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
736 structureTab.add(addTempFactor);
739 JLabel viewerLabel = new JLabel();
740 viewerLabel.setFont(verdana11);
741 viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
742 viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
743 viewerLabel.setBounds(new Rectangle(10, ypos, 200, height));
744 structureTab.add(viewerLabel);
746 structViewer.setFont(verdana11);
747 structViewer.setBounds(new Rectangle(150, ypos, 120, height));
748 structViewer.addItem(Viewer.JMOL.name());
749 structViewer.addItem(Viewer.CHIMERA.name());
750 structureTab.add(structViewer);
756 * Initialises the Visual tabbed panel.
760 private JPanel initVisualTab()
762 JPanel visualTab = new JPanel();
763 visualTab.setBorder(new TitledBorder(MessageManager
764 .getString("action.open_new_alignment")));
765 visualTab.setLayout(null);
766 fullScreen.setFont(verdana11);
767 fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
768 fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
769 fullScreen.setText(MessageManager.getString("label.maximize_window"));
770 quality.setEnabled(false);
771 quality.setFont(verdana11);
772 quality.setHorizontalAlignment(SwingConstants.RIGHT);
773 quality.setHorizontalTextPosition(SwingConstants.LEFT);
774 quality.setSelected(true);
775 quality.setText(MessageManager.getString("label.quality"));
776 conservation.setEnabled(false);
777 conservation.setFont(verdana11);
778 conservation.setHorizontalAlignment(SwingConstants.RIGHT);
779 conservation.setHorizontalTextPosition(SwingConstants.LEFT);
780 conservation.setSelected(true);
781 conservation.setText(MessageManager.getString("label.conservation"));
782 identity.setEnabled(false);
783 identity.setFont(verdana11);
784 identity.setHorizontalAlignment(SwingConstants.RIGHT);
785 identity.setHorizontalTextPosition(SwingConstants.LEFT);
786 identity.setSelected(true);
787 identity.setText(MessageManager.getString("label.consensus"));
788 JLabel showGroupbits = new JLabel();
789 showGroupbits.setFont(verdana11);
790 showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
791 showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
792 showGroupbits.setText(MessageManager.getString("action.show_group")
794 JLabel showConsensbits = new JLabel();
795 showConsensbits.setFont(verdana11);
796 showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
797 showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
798 showConsensbits.setText(MessageManager.getString("label.consensus")
800 showConsensHistogram.setEnabled(false);
801 showConsensHistogram.setFont(verdana11);
802 showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
803 showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
804 showConsensHistogram.setSelected(true);
805 showConsensHistogram.setText(MessageManager
806 .getString("label.histogram"));
807 showConsensLogo.setEnabled(false);
808 showConsensLogo.setFont(verdana11);
809 showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
810 showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
811 showConsensLogo.setSelected(true);
812 showConsensLogo.setText(MessageManager.getString("label.logo"));
813 showGroupConsensus.setEnabled(false);
814 showGroupConsensus.setFont(verdana11);
815 showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
816 showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
817 showGroupConsensus.setSelected(true);
818 showGroupConsensus.setText(MessageManager.getString("label.consensus"));
819 showGroupConservation.setEnabled(false);
820 showGroupConservation.setFont(verdana11);
821 showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
822 showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
823 showGroupConservation.setSelected(true);
824 showGroupConservation.setText(MessageManager
825 .getString("label.conservation"));
826 showNpTooltip.setEnabled(true);
827 showNpTooltip.setFont(verdana11);
828 showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
829 showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
830 showNpTooltip.setSelected(true);
831 showNpTooltip.setText(MessageManager
832 .getString("label.non_positional_features"));
833 showDbRefTooltip.setEnabled(true);
834 showDbRefTooltip.setFont(verdana11);
835 showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
836 showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
837 showDbRefTooltip.setSelected(true);
838 showDbRefTooltip.setText(MessageManager
839 .getString("label.database_references"));
840 annotations.setFont(verdana11);
841 annotations.setHorizontalAlignment(SwingConstants.RIGHT);
842 annotations.setHorizontalTextPosition(SwingConstants.LEADING);
843 annotations.setSelected(true);
844 annotations.setText(MessageManager.getString("label.show_annotations"));
845 annotations.setBounds(new Rectangle(169, 12, 200, 23));
846 annotations.addActionListener(new ActionListener()
848 public void actionPerformed(ActionEvent e)
850 annotations_actionPerformed(e);
853 identity.addActionListener(new ActionListener()
855 public void actionPerformed(ActionEvent e)
857 annotations_actionPerformed(e);
860 showGroupConsensus.addActionListener(new ActionListener()
862 public void actionPerformed(ActionEvent e)
864 annotations_actionPerformed(e);
867 showUnconserved.setFont(verdana11);
868 showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
869 showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
870 showUnconserved.setSelected(true);
871 showUnconserved.setText(MessageManager
872 .getString("action.show_unconserved"));
873 showUnconserved.addActionListener(new ActionListener()
875 public void actionPerformed(ActionEvent e)
877 showunconserved_actionPerformed(e);
881 // TODO these are not yet added to / action from Preferences
882 // JCheckBox shareSelections = new JCheckBox();
883 // shareSelections.setFont(verdana11);
884 // shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
885 // shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
886 // shareSelections.setSelected(true);
887 // shareSelections.setText(MessageManager
888 // .getString("label.share_selection_across_views"));
889 // JCheckBox followHighlight = new JCheckBox();
890 // followHighlight.setFont(verdana11);
891 // followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
892 // followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
893 // // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
894 // followHighlight.setSelected(true);
895 // followHighlight.setText(MessageManager
896 // .getString("label.scroll_highlighted_regions"));
898 seqLimit.setFont(verdana11);
899 seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
900 seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
901 seqLimit.setText(MessageManager.getString("label.full_sequence_id"));
902 smoothFont.setFont(verdana11);
903 smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
904 smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
905 smoothFont.setText(MessageManager.getString("label.smooth_font"));
906 JLabel gapLabel = new JLabel();
907 gapLabel.setFont(verdana11);
908 gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
909 gapLabel.setText(MessageManager.getString("label.gap_symbol") + " ");
910 JLabel fontLabel = new JLabel();
911 fontLabel.setFont(verdana11);
912 fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
913 fontLabel.setText(MessageManager.getString("label.font"));
914 fontSizeCB.setFont(verdana11);
915 fontSizeCB.setBounds(new Rectangle(319, 104, 49, 23));
916 fontStyleCB.setFont(verdana11);
917 fontStyleCB.setBounds(new Rectangle(367, 104, 70, 23));
918 fontNameCB.setFont(verdana11);
919 fontNameCB.setBounds(new Rectangle(172, 104, 147, 23));
920 gapSymbolCB.setFont(verdana11);
921 gapSymbolCB.setBounds(new Rectangle(172, 196, 69, 23));
922 DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
923 dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
924 gapSymbolCB.setRenderer(dlcr);
926 startupCheckbox.setText(MessageManager.getString("action.open_file"));
927 startupCheckbox.setFont(verdana11);
928 startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
929 startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
930 startupCheckbox.setSelected(true);
931 startupFileTextfield.setFont(verdana11);
932 startupFileTextfield.setBounds(new Rectangle(172, 290, 270, 20));
933 startupFileTextfield.addMouseListener(new MouseAdapter()
935 public void mouseClicked(MouseEvent e)
937 if (e.getClickCount() > 1)
939 startupFileTextfield_mouseClicked();
944 sortby.setFont(verdana11);
945 sortby.setBounds(new Rectangle(172, 240, 155, 21));
946 JLabel sortLabel = new JLabel();
947 sortLabel.setFont(verdana11);
948 sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
949 sortLabel.setText(MessageManager.getString("label.sort_by"));
950 sortAnnBy.setFont(verdana11);
951 sortAnnBy.setBounds(new Rectangle(172, 265, 120, 21));
952 JLabel sortAnnLabel = new JLabel();
953 sortAnnLabel.setFont(verdana11);
954 sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
955 sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
956 sortAutocalc.setFont(verdana11);
957 sortAutocalc.setBounds(new Rectangle(300, 265, 185, 21));
958 JPanel annsettingsPanel = new JPanel();
959 annsettingsPanel.setBounds(new Rectangle(173, 34, 300, 61));
960 annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
961 JPanel autoAnnotSettings1 = new JPanel();
962 autoAnnotSettings1.setLayout(new GridLayout(3, 1, 0, 0));
963 annsettingsPanel.add(autoAnnotSettings1);
964 JPanel autoAnnotSettings2 = new JPanel();
965 autoAnnotSettings2.setLayout(new GridLayout(3, 1, 0, 0));
966 annsettingsPanel.add(autoAnnotSettings2);
967 JPanel autoAnnotSettings3 = new JPanel();
968 autoAnnotSettings3.setLayout(new GridLayout(3, 1, 0, 0));
969 annsettingsPanel.add(autoAnnotSettings3);
970 visualTab.add(annsettingsPanel);
971 Border jb = new EmptyBorder(1, 1, 4, 5);
972 quality.setBorder(jb);
973 conservation.setBorder(jb);
974 identity.setBorder(jb);
975 showConsensbits.setBorder(jb);
976 showGroupbits.setBorder(jb);
977 showGroupConsensus.setBorder(jb);
978 showGroupConservation.setBorder(jb);
979 showConsensHistogram.setBorder(jb);
980 showConsensLogo.setBorder(jb);
982 autoAnnotSettings2.add(conservation);
983 autoAnnotSettings1.add(quality);
984 autoAnnotSettings3.add(identity);
985 autoAnnotSettings1.add(showGroupbits);
986 autoAnnotSettings3.add(showGroupConsensus);
987 autoAnnotSettings2.add(showGroupConservation);
988 autoAnnotSettings1.add(showConsensbits);
989 autoAnnotSettings2.add(showConsensHistogram);
990 autoAnnotSettings3.add(showConsensLogo);
992 JPanel tooltipSettings = new JPanel();
993 tooltipSettings.setBorder(new TitledBorder(MessageManager
994 .getString("label.sequence_id_tooltip")));
995 tooltipSettings.setBounds(173, 130, 200, 62);
996 tooltipSettings.setLayout(new GridLayout(2, 1));
997 tooltipSettings.add(showDbRefTooltip);
998 tooltipSettings.add(showNpTooltip);
999 visualTab.add(tooltipSettings);
1001 wrap.setFont(verdana11);
1002 wrap.setHorizontalAlignment(SwingConstants.TRAILING);
1003 wrap.setHorizontalTextPosition(SwingConstants.LEADING);
1004 wrap.setText(MessageManager.getString("label.wrap_alignment"));
1005 rightAlign.setFont(verdana11);
1006 rightAlign.setForeground(Color.black);
1007 rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
1008 rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
1009 rightAlign.setText(MessageManager.getString("label.right_align_ids"));
1010 idItalics.setFont(verdana11);
1011 idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
1012 idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
1013 idItalics.setText(MessageManager
1014 .getString("label.sequence_name_italics"));
1015 openoverv.setFont(verdana11);
1016 openoverv.setActionCommand(MessageManager
1017 .getString("label.open_overview"));
1018 openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
1019 openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
1020 openoverv.setText(MessageManager.getString(("label.open_overview")));
1021 JPanel jPanel2 = new JPanel();
1022 jPanel2.setBounds(new Rectangle(7, 17, 158, 297));
1023 GridLayout gridLayout2 = new GridLayout();
1024 jPanel2.setLayout(gridLayout2);
1025 gridLayout2.setRows(13);
1026 jPanel2.add(fullScreen);
1027 jPanel2.add(openoverv);
1028 jPanel2.add(seqLimit);
1029 jPanel2.add(rightAlign);
1030 jPanel2.add(fontLabel);
1031 jPanel2.add(showUnconserved);
1032 jPanel2.add(idItalics);
1033 jPanel2.add(smoothFont);
1034 jPanel2.add(gapLabel);
1036 jPanel2.add(sortLabel);
1037 jPanel2.add(sortAnnLabel);
1038 jPanel2.add(startupCheckbox);
1039 visualTab.add(jPanel2);
1040 visualTab.add(annotations);
1041 visualTab.add(startupFileTextfield);
1042 visualTab.add(sortby);
1043 visualTab.add(sortAnnBy);
1044 visualTab.add(sortAutocalc);
1045 visualTab.add(gapSymbolCB);
1046 visualTab.add(fontNameCB);
1047 visualTab.add(fontSizeCB);
1048 visualTab.add(fontStyleCB);
1052 protected void autoIdWidth_actionPerformed()
1054 // TODO Auto-generated method stub
1058 protected void userIdWidth_actionPerformed()
1060 // TODO Auto-generated method stub
1064 protected void maxColour_actionPerformed(JPanel panel)
1068 protected void minColour_actionPerformed(JPanel panel)
1072 protected void showunconserved_actionPerformed(ActionEvent e)
1074 // TODO Auto-generated method stub
1084 public void ok_actionPerformed(ActionEvent e)
1094 public void cancel_actionPerformed(ActionEvent e)
1104 public void annotations_actionPerformed(ActionEvent e)
1111 public void startupFileTextfield_mouseClicked()
1115 public void newLink_actionPerformed(ActionEvent e)
1120 public void editLink_actionPerformed(ActionEvent e)
1125 public void deleteLink_actionPerformed(ActionEvent e)
1130 public void defaultBrowser_mouseClicked(MouseEvent e)
1135 public void linkURLList_keyTyped(KeyEvent e)
1140 public void useProxy_actionPerformed()
1142 proxyServerTB.setEnabled(useProxy.isSelected());
1143 proxyPortTB.setEnabled(useProxy.isSelected());