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>();
143 protected JTextField chimeraPath = new JTextField();
146 * Colours tab components
148 protected JPanel minColour = new JPanel();
150 protected JPanel maxColour = new JPanel();
152 protected JComboBox<String> colour = new JComboBox<String>();
155 * Connections tab components
157 protected JList linkURLList = new JList();
159 protected JTextField proxyServerTB = new JTextField();
161 protected JTextField proxyPortTB = new JTextField();
163 protected JTextField defaultBrowser = new JTextField();
165 protected JList linkNameList = new JList();
167 protected JCheckBox useProxy = new JCheckBox();
169 protected JCheckBox usagestats = new JCheckBox();
171 protected JCheckBox questionnaire = new JCheckBox();
173 protected JCheckBox versioncheck = new JCheckBox();
176 * Output tab components
178 protected JComboBox<String> epsRendering = new JComboBox<String>();
180 protected JLabel userIdWidthlabel = new JLabel();
182 protected JCheckBox autoIdWidth = new JCheckBox();
184 protected JTextField userIdWidth = new JTextField();
186 protected JCheckBox blcjv = new JCheckBox();
188 protected JCheckBox pileupjv = new JCheckBox();
190 protected JCheckBox clustaljv = new JCheckBox();
192 protected JCheckBox msfjv = new JCheckBox();
194 protected JCheckBox fastajv = new JCheckBox();
196 protected JCheckBox pfamjv = new JCheckBox();
198 protected JCheckBox pirjv = new JCheckBox();
200 protected JCheckBox modellerOutput = new JCheckBox();
203 * Editing tab components
205 protected JCheckBox autoCalculateConsCheck = new JCheckBox();
207 protected JCheckBox padGaps = new JCheckBox();
209 protected JCheckBox sortByTree = new JCheckBox();
214 protected JPanel dasTab = new JPanel();
219 protected JPanel wsTab = new JPanel();
222 * Creates a new GPreferences object.
224 public GPreferences()
229 } catch (Exception ex)
231 ex.printStackTrace();
236 * Construct the panel and its tabbed sub-panels.
240 private void jbInit() throws Exception
242 JTabbedPane tabbedPane = new JTabbedPane();
243 this.setLayout(new BorderLayout());
244 JPanel okCancelPanel = initOkCancelPanel();
245 this.add(tabbedPane, BorderLayout.CENTER);
246 this.add(okCancelPanel, BorderLayout.SOUTH);
248 tabbedPane.add(initVisualTab(),
249 MessageManager.getString("label.visual"));
251 tabbedPane.add(initColoursTab(),
252 MessageManager.getString("label.colours"));
254 tabbedPane.add(initStructureTab(),
255 MessageManager.getString("label.structure"));
257 tabbedPane.add(initConnectionsTab(),
258 MessageManager.getString("label.connections"));
260 tabbedPane.add(initOutputTab(), MessageManager.getString("label.output"));
262 tabbedPane.add(initEditingTab(), MessageManager.getString("label.editing"));
265 * See DasSourceBrowser for the real work of configuring this tab.
267 dasTab.setLayout(new BorderLayout());
269 .add(dasTab, MessageManager.getString("label.das_settings"));
272 * See WsPreferences for the real work of configuring this tab.
274 wsTab.setLayout(new BorderLayout());
275 tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
279 * Initialises the Editing tabbed panel.
283 private JPanel initEditingTab()
285 JPanel editingTab = new JPanel();
286 editingTab.setLayout(null);
287 autoCalculateConsCheck.setFont(verdana11);
288 autoCalculateConsCheck.setText(MessageManager
289 .getString("label.autocalculate_consensus"));
290 autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
291 padGaps.setFont(verdana11);
292 padGaps.setText(MessageManager.getString("label.pad_gaps_when_editing"));
293 padGaps.setBounds(new Rectangle(22, 94, 168, 23));
294 sortByTree.setFont(verdana11);
296 .setText(MessageManager.getString("label.sort_with_new_tree"));
298 .setToolTipText(MessageManager
299 .getString("label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
300 sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
301 editingTab.add(autoCalculateConsCheck);
302 editingTab.add(padGaps);
303 editingTab.add(sortByTree);
308 * Initialises the Output tabbed panel.
312 private JPanel initOutputTab()
314 JPanel outputTab = new JPanel();
315 outputTab.setLayout(null);
316 JLabel epsLabel = new JLabel();
317 epsLabel.setFont(verdana11);
318 epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
319 epsLabel.setText(MessageManager.getString("label.eps_rendering_style"));
320 epsLabel.setBounds(new Rectangle(9, 31, 140, 24));
321 epsRendering.setFont(verdana11);
322 epsRendering.setBounds(new Rectangle(154, 34, 187, 21));
323 JLabel jLabel1 = new JLabel();
324 jLabel1.setFont(verdana11);
325 jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
326 jLabel1.setText(MessageManager.getString("label.append_start_end"));
327 jLabel1.setFont(verdana11);
328 fastajv.setFont(verdana11);
329 fastajv.setHorizontalAlignment(SwingConstants.LEFT);
330 clustaljv.setText(MessageManager.getString("label.clustal") + " ");
331 blcjv.setText(MessageManager.getString("label.blc") + " ");
332 fastajv.setText(MessageManager.getString("label.fasta") + " ");
333 msfjv.setText(MessageManager.getString("label.msf") + " ");
334 pfamjv.setText(MessageManager.getString("label.pfam") + " ");
335 pileupjv.setText(MessageManager.getString("label.pileup") + " ");
336 msfjv.setFont(verdana11);
337 msfjv.setHorizontalAlignment(SwingConstants.LEFT);
338 pirjv.setText(MessageManager.getString("label.pir") + " ");
339 JPanel jPanel11 = new JPanel();
340 jPanel11.setFont(verdana11);
341 TitledBorder titledBorder2 = new TitledBorder(
342 MessageManager.getString("label.file_output"));
343 jPanel11.setBorder(titledBorder2);
344 jPanel11.setBounds(new Rectangle(30, 72, 196, 182));
345 GridLayout gridLayout3 = new GridLayout();
346 jPanel11.setLayout(gridLayout3);
347 gridLayout3.setRows(8);
348 blcjv.setFont(verdana11);
349 blcjv.setHorizontalAlignment(SwingConstants.LEFT);
350 clustaljv.setFont(verdana11);
351 clustaljv.setHorizontalAlignment(SwingConstants.LEFT);
352 pfamjv.setFont(verdana11);
353 pfamjv.setHorizontalAlignment(SwingConstants.LEFT);
354 pileupjv.setFont(verdana11);
355 pileupjv.setHorizontalAlignment(SwingConstants.LEFT);
356 pirjv.setFont(verdana11);
357 pirjv.setHorizontalAlignment(SwingConstants.LEFT);
358 autoIdWidth.setFont(verdana11);
359 autoIdWidth.setText(MessageManager
360 .getString("label.automatically_set_id_width"));
362 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.adjusts_width_generated_eps_png")));
363 autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23));
364 autoIdWidth.addActionListener(new ActionListener()
368 public void actionPerformed(ActionEvent e)
370 autoIdWidth_actionPerformed();
373 userIdWidthlabel.setFont(verdana11);
374 userIdWidthlabel.setText(MessageManager
375 .getString("label.figure_id_column_width"));
377 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column")));
379 .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column")));
380 userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23));
381 userIdWidth.setFont(JvSwingUtils.getTextAreaFont());
382 userIdWidth.setText("");
383 userIdWidth.setBounds(new Rectangle(232, 144, 84, 23));
384 userIdWidth.addActionListener(new ActionListener()
388 public void actionPerformed(ActionEvent e)
390 userIdWidth_actionPerformed();
393 jPanel11.add(jLabel1);
395 jPanel11.add(clustaljv);
396 jPanel11.add(fastajv);
398 jPanel11.add(pfamjv);
399 jPanel11.add(pileupjv);
401 outputTab.add(autoIdWidth);
402 outputTab.add(userIdWidth);
403 outputTab.add(userIdWidthlabel);
404 outputTab.add(modellerOutput);
405 outputTab.add(epsLabel);
406 outputTab.add(epsRendering);
407 outputTab.add(jPanel11);
408 modellerOutput.setFont(verdana11);
409 modellerOutput.setText(MessageManager
410 .getString("label.use_modeller_output"));
411 modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
416 * Initialises the Connections tabbed panel.
420 private JPanel initConnectionsTab()
422 JPanel connectTab = new JPanel();
423 connectTab.setLayout(new GridBagLayout());
424 JLabel serverLabel = new JLabel();
425 serverLabel.setText(MessageManager.getString("label.address"));
426 serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
427 serverLabel.setFont(verdana11);
428 proxyServerTB.setFont(verdana11);
429 proxyPortTB.setFont(verdana11);
430 JLabel portLabel = new JLabel();
431 portLabel.setFont(verdana11);
432 portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
433 portLabel.setText(MessageManager.getString("label.port"));
434 JLabel browserLabel = new JLabel();
435 browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
436 browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
437 browserLabel.setText(MessageManager
438 .getString("label.default_browser_unix"));
439 defaultBrowser.setFont(verdana11);
440 defaultBrowser.setText("");
441 usagestats.setText(MessageManager
442 .getString("label.send_usage_statistics"));
443 usagestats.setFont(verdana11);
444 usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
445 usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
446 questionnaire.setText(MessageManager
447 .getString("label.check_for_questionnaires"));
448 questionnaire.setFont(verdana11);
449 questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
450 questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
451 versioncheck.setText(MessageManager
452 .getString("label.check_for_latest_version"));
453 versioncheck.setFont(verdana11);
454 versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
455 versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
456 JButton newLink = new JButton();
457 newLink.setText(MessageManager.getString("action.new"));
458 newLink.addActionListener(new java.awt.event.ActionListener()
460 public void actionPerformed(ActionEvent e)
462 newLink_actionPerformed(e);
465 JButton editLink = new JButton();
466 editLink.setText(MessageManager.getString("action.edit"));
467 editLink.addActionListener(new java.awt.event.ActionListener()
469 public void actionPerformed(ActionEvent e)
471 editLink_actionPerformed(e);
474 JButton deleteLink = new JButton();
475 deleteLink.setText(MessageManager.getString("action.delete"));
476 deleteLink.addActionListener(new java.awt.event.ActionListener()
478 public void actionPerformed(ActionEvent e)
480 deleteLink_actionPerformed(e);
484 linkURLList.addListSelectionListener(new ListSelectionListener()
486 public void valueChanged(ListSelectionEvent e)
488 int index = linkURLList.getSelectedIndex();
489 linkNameList.setSelectedIndex(index);
493 linkNameList.addListSelectionListener(new ListSelectionListener()
495 public void valueChanged(ListSelectionEvent e)
497 int index = linkNameList.getSelectedIndex();
498 linkURLList.setSelectedIndex(index);
502 JScrollPane linkScrollPane = new JScrollPane();
503 linkScrollPane.setBorder(null);
504 JPanel linkPanel = new JPanel();
505 linkPanel.setBorder(new TitledBorder(MessageManager
506 .getString("label.url_linkfrom_sequence_id")));
507 linkPanel.setLayout(new BorderLayout());
508 GridLayout gridLayout1 = new GridLayout();
509 JPanel editLinkButtons = new JPanel();
510 editLinkButtons.setLayout(gridLayout1);
511 gridLayout1.setRows(3);
512 linkNameList.setFont(verdana11);
513 linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
514 BorderLayout borderLayout3 = new BorderLayout();
515 JPanel linkPanel2 = new JPanel();
516 linkPanel2.setLayout(borderLayout3);
517 linkURLList.setFont(verdana11);
518 linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
520 defaultBrowser.addMouseListener(new MouseAdapter()
522 public void mouseClicked(MouseEvent e)
524 if (e.getClickCount() > 1)
526 defaultBrowser_mouseClicked(e);
530 useProxy.setFont(verdana11);
531 useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
532 useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
533 useProxy.setText(MessageManager.getString("label.use_proxy_server"));
534 useProxy.addActionListener(new ActionListener()
536 public void actionPerformed(ActionEvent e)
538 useProxy_actionPerformed();
541 linkPanel.add(editLinkButtons, BorderLayout.EAST);
542 editLinkButtons.add(newLink, null);
543 editLinkButtons.add(editLink, null);
544 editLinkButtons.add(deleteLink, null);
545 linkPanel.add(linkScrollPane, BorderLayout.CENTER);
546 linkScrollPane.getViewport().add(linkPanel2, null);
547 linkPanel2.add(linkURLList, BorderLayout.CENTER);
548 linkPanel2.add(linkNameList, BorderLayout.WEST);
549 JPanel jPanel1 = new JPanel();
550 TitledBorder titledBorder1 = new TitledBorder(
551 MessageManager.getString("label.proxy_server"));
552 jPanel1.setBorder(titledBorder1);
553 jPanel1.setLayout(new GridBagLayout());
554 jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
555 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
557 jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
558 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
560 connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
561 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
562 16, 0, 0, 12), 359, -17));
563 connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
564 GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
565 21, 0, 35, 12), 4, 6));
566 connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
567 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
568 new Insets(16, 0, 0, 0), 5, 1));
569 jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
570 GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
572 jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
573 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
574 new Insets(0, 2, 4, 2), 54, 1));
575 jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
576 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
577 new Insets(0, 2, 4, 0), 263, 1));
578 connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
579 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
580 new Insets(15, 0, 0, 15), 307, 1));
581 connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
582 GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
583 new Insets(0, 2, 4, 2), 70, 1));
584 connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
585 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
586 new Insets(0, 2, 4, 2), 70, 1));
587 connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
588 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
589 new Insets(0, 2, 4, 2), 70, 1));
594 * Initialises the parent panel which contains the tabbed sections.
598 private JPanel initOkCancelPanel()
600 JButton ok = new JButton();
601 ok.setText(MessageManager.getString("action.ok"));
602 ok.addActionListener(new ActionListener()
604 public void actionPerformed(ActionEvent e)
606 ok_actionPerformed(e);
609 JButton cancel = new JButton();
610 cancel.setText(MessageManager.getString("action.cancel"));
611 cancel.addActionListener(new ActionListener()
613 public void actionPerformed(ActionEvent e)
615 cancel_actionPerformed(e);
618 JPanel okCancelPanel = new JPanel();
619 okCancelPanel.add(ok);
620 okCancelPanel.add(cancel);
621 return okCancelPanel;
625 * Initialises the Colours tabbed panel.
629 private JPanel initColoursTab()
631 JPanel coloursTab = new JPanel();
632 coloursTab.setBorder(new TitledBorder(MessageManager
633 .getString("action.open_new_alignment")));
634 coloursTab.setLayout(new FlowLayout());
635 JLabel mincolourLabel = new JLabel();
636 mincolourLabel.setFont(verdana11);
637 mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
638 mincolourLabel.setText(MessageManager.getString("label.min_colour"));
639 minColour.setFont(verdana11);
640 minColour.setBorder(BorderFactory.createEtchedBorder());
641 minColour.setPreferredSize(new Dimension(40, 20));
642 minColour.addMouseListener(new MouseAdapter()
644 public void mousePressed(MouseEvent e)
646 minColour_actionPerformed(minColour);
649 JLabel maxcolourLabel = new JLabel();
650 maxcolourLabel.setFont(verdana11);
651 maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
652 maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
653 maxColour.setFont(verdana11);
654 maxColour.setBorder(BorderFactory.createEtchedBorder());
655 maxColour.setPreferredSize(new Dimension(40, 20));
656 maxColour.addMouseListener(new MouseAdapter()
658 public void mousePressed(MouseEvent e)
660 maxColour_actionPerformed(maxColour);
663 colour.setFont(verdana11);
664 colour.setBounds(new Rectangle(172, 225, 155, 21));
665 JLabel colourLabel = new JLabel();
666 colourLabel.setFont(verdana11);
667 colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
668 colourLabel.setText(MessageManager.getString("label.alignment_colour")
670 JvSwingUtils.addtoLayout(coloursTab, MessageManager
671 .getString("label.default_colour_scheme_for_alignment"),
672 colourLabel, colour);
673 JPanel annotationShding = new JPanel();
674 annotationShding.setBorder(new TitledBorder(MessageManager
675 .getString("label.annotation_shading_default")));
676 annotationShding.setLayout(new GridLayout(1, 2));
677 JvSwingUtils.addtoLayout(annotationShding, MessageManager
678 .getString("label.default_minimum_colour_annotation_shading"),
679 mincolourLabel, minColour);
680 JvSwingUtils.addtoLayout(annotationShding, MessageManager
681 .getString("label.default_maximum_colour_annotation_shading"),
682 maxcolourLabel, maxColour);
683 coloursTab.add(annotationShding); // , FlowLayout.LEFT);
688 * Initialises the Structure tabbed panel.
692 private JPanel initStructureTab()
694 JPanel structureTab = new JPanel();
695 structureTab.setBorder(new TitledBorder(MessageManager
696 .getString("label.structure_options")));
697 structureTab.setLayout(null);
698 final int width = 400;
699 final int height = 23;
700 final int lineSpacing = 30;
703 structFromPdb.setFont(verdana11);
704 structFromPdb.setText(MessageManager.getString("label.struct_from_pdb"));
705 structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
706 structFromPdb.addActionListener(new ActionListener()
709 public void actionPerformed(ActionEvent e)
711 boolean selected = structFromPdb.isSelected();
712 // enable other options only when the first is checked
713 useRnaView.setEnabled(selected);
714 addSecondaryStructure.setEnabled(selected);
715 addTempFactor.setEnabled(selected);
718 structureTab.add(structFromPdb);
720 // indent checkboxes that are conditional on the first one
722 useRnaView.setFont(verdana11);
723 useRnaView.setText(MessageManager.getString("label.use_rnaview"));
724 useRnaView.setBounds(new Rectangle(25, ypos, width, height));
725 structureTab.add(useRnaView);
728 addSecondaryStructure.setFont(verdana11);
729 addSecondaryStructure.setText(MessageManager
730 .getString("label.autoadd_secstr"));
731 addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
732 structureTab.add(addSecondaryStructure);
735 addTempFactor.setFont(verdana11);
736 addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
737 addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
738 structureTab.add(addTempFactor);
741 JLabel viewerLabel = new JLabel();
742 viewerLabel.setFont(verdana11);
743 viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
744 viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
745 viewerLabel.setBounds(new Rectangle(10, ypos, 200, height));
746 structureTab.add(viewerLabel);
748 structViewer.setFont(verdana11);
749 structViewer.setBounds(new Rectangle(160, ypos, 120, height));
750 structViewer.addItem(Viewer.JMOL.name());
751 structViewer.addItem(Viewer.CHIMERA.name());
752 structureTab.add(structViewer);
755 JLabel pathLabel = new JLabel();
756 pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
757 pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
758 pathLabel.setText(MessageManager.getString("label.chimera_path"));
759 pathLabel.setToolTipText(MessageManager
760 .getString("label.chimera_path_tip"));
761 pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
762 structureTab.add(pathLabel);
764 chimeraPath.setFont(verdana11);
765 chimeraPath.setText("");
766 chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
767 structureTab.add(chimeraPath);
773 * Initialises the Visual tabbed panel.
777 private JPanel initVisualTab()
779 JPanel visualTab = new JPanel();
780 visualTab.setBorder(new TitledBorder(MessageManager
781 .getString("action.open_new_alignment")));
782 visualTab.setLayout(null);
783 fullScreen.setFont(verdana11);
784 fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
785 fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
786 fullScreen.setText(MessageManager.getString("label.maximize_window"));
787 quality.setEnabled(false);
788 quality.setFont(verdana11);
789 quality.setHorizontalAlignment(SwingConstants.RIGHT);
790 quality.setHorizontalTextPosition(SwingConstants.LEFT);
791 quality.setSelected(true);
792 quality.setText(MessageManager.getString("label.quality"));
793 conservation.setEnabled(false);
794 conservation.setFont(verdana11);
795 conservation.setHorizontalAlignment(SwingConstants.RIGHT);
796 conservation.setHorizontalTextPosition(SwingConstants.LEFT);
797 conservation.setSelected(true);
798 conservation.setText(MessageManager.getString("label.conservation"));
799 identity.setEnabled(false);
800 identity.setFont(verdana11);
801 identity.setHorizontalAlignment(SwingConstants.RIGHT);
802 identity.setHorizontalTextPosition(SwingConstants.LEFT);
803 identity.setSelected(true);
804 identity.setText(MessageManager.getString("label.consensus"));
805 JLabel showGroupbits = new JLabel();
806 showGroupbits.setFont(verdana11);
807 showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
808 showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
809 showGroupbits.setText(MessageManager.getString("action.show_group")
811 JLabel showConsensbits = new JLabel();
812 showConsensbits.setFont(verdana11);
813 showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
814 showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
815 showConsensbits.setText(MessageManager.getString("label.consensus")
817 showConsensHistogram.setEnabled(false);
818 showConsensHistogram.setFont(verdana11);
819 showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
820 showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
821 showConsensHistogram.setSelected(true);
822 showConsensHistogram.setText(MessageManager
823 .getString("label.histogram"));
824 showConsensLogo.setEnabled(false);
825 showConsensLogo.setFont(verdana11);
826 showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
827 showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
828 showConsensLogo.setSelected(true);
829 showConsensLogo.setText(MessageManager.getString("label.logo"));
830 showGroupConsensus.setEnabled(false);
831 showGroupConsensus.setFont(verdana11);
832 showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
833 showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
834 showGroupConsensus.setSelected(true);
835 showGroupConsensus.setText(MessageManager.getString("label.consensus"));
836 showGroupConservation.setEnabled(false);
837 showGroupConservation.setFont(verdana11);
838 showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
839 showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
840 showGroupConservation.setSelected(true);
841 showGroupConservation.setText(MessageManager
842 .getString("label.conservation"));
843 showNpTooltip.setEnabled(true);
844 showNpTooltip.setFont(verdana11);
845 showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
846 showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
847 showNpTooltip.setSelected(true);
848 showNpTooltip.setText(MessageManager
849 .getString("label.non_positional_features"));
850 showDbRefTooltip.setEnabled(true);
851 showDbRefTooltip.setFont(verdana11);
852 showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
853 showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
854 showDbRefTooltip.setSelected(true);
855 showDbRefTooltip.setText(MessageManager
856 .getString("label.database_references"));
857 annotations.setFont(verdana11);
858 annotations.setHorizontalAlignment(SwingConstants.RIGHT);
859 annotations.setHorizontalTextPosition(SwingConstants.LEADING);
860 annotations.setSelected(true);
861 annotations.setText(MessageManager.getString("label.show_annotations"));
862 annotations.setBounds(new Rectangle(169, 12, 200, 23));
863 annotations.addActionListener(new ActionListener()
865 public void actionPerformed(ActionEvent e)
867 annotations_actionPerformed(e);
870 identity.addActionListener(new ActionListener()
872 public void actionPerformed(ActionEvent e)
874 annotations_actionPerformed(e);
877 showGroupConsensus.addActionListener(new ActionListener()
879 public void actionPerformed(ActionEvent e)
881 annotations_actionPerformed(e);
884 showUnconserved.setFont(verdana11);
885 showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
886 showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
887 showUnconserved.setSelected(true);
888 showUnconserved.setText(MessageManager
889 .getString("action.show_unconserved"));
890 showUnconserved.addActionListener(new ActionListener()
892 public void actionPerformed(ActionEvent e)
894 showunconserved_actionPerformed(e);
898 // TODO these are not yet added to / action from Preferences
899 // JCheckBox shareSelections = new JCheckBox();
900 // shareSelections.setFont(verdana11);
901 // shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
902 // shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
903 // shareSelections.setSelected(true);
904 // shareSelections.setText(MessageManager
905 // .getString("label.share_selection_across_views"));
906 // JCheckBox followHighlight = new JCheckBox();
907 // followHighlight.setFont(verdana11);
908 // followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
909 // followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
910 // // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
911 // followHighlight.setSelected(true);
912 // followHighlight.setText(MessageManager
913 // .getString("label.scroll_highlighted_regions"));
915 seqLimit.setFont(verdana11);
916 seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
917 seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
918 seqLimit.setText(MessageManager.getString("label.full_sequence_id"));
919 smoothFont.setFont(verdana11);
920 smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
921 smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
922 smoothFont.setText(MessageManager.getString("label.smooth_font"));
923 JLabel gapLabel = new JLabel();
924 gapLabel.setFont(verdana11);
925 gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
926 gapLabel.setText(MessageManager.getString("label.gap_symbol") + " ");
927 JLabel fontLabel = new JLabel();
928 fontLabel.setFont(verdana11);
929 fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
930 fontLabel.setText(MessageManager.getString("label.font"));
931 fontSizeCB.setFont(verdana11);
932 fontSizeCB.setBounds(new Rectangle(320, 104, 65, 23));
933 fontStyleCB.setFont(verdana11);
934 fontStyleCB.setBounds(new Rectangle(382, 104, 80, 23));
935 fontNameCB.setFont(verdana11);
936 fontNameCB.setBounds(new Rectangle(172, 104, 147, 23));
937 gapSymbolCB.setFont(verdana11);
938 gapSymbolCB.setBounds(new Rectangle(172, 196, 69, 23));
939 DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
940 dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
941 gapSymbolCB.setRenderer(dlcr);
943 startupCheckbox.setText(MessageManager.getString("action.open_file"));
944 startupCheckbox.setFont(verdana11);
945 startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
946 startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
947 startupCheckbox.setSelected(true);
948 startupFileTextfield.setFont(verdana11);
949 startupFileTextfield.setBounds(new Rectangle(172, 290, 270, 20));
950 startupFileTextfield.addMouseListener(new MouseAdapter()
952 public void mouseClicked(MouseEvent e)
954 if (e.getClickCount() > 1)
956 startupFileTextfield_mouseClicked();
961 sortby.setFont(verdana11);
962 sortby.setBounds(new Rectangle(172, 240, 155, 21));
963 JLabel sortLabel = new JLabel();
964 sortLabel.setFont(verdana11);
965 sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
966 sortLabel.setText(MessageManager.getString("label.sort_by"));
967 sortAnnBy.setFont(verdana11);
968 sortAnnBy.setBounds(new Rectangle(172, 265, 110, 21));
969 JLabel sortAnnLabel = new JLabel();
970 sortAnnLabel.setFont(verdana11);
971 sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
972 sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
973 sortAutocalc.setFont(verdana11);
974 sortAutocalc.setBounds(new Rectangle(290, 265, 165, 21));
975 JPanel annsettingsPanel = new JPanel();
976 annsettingsPanel.setBounds(new Rectangle(173, 34, 300, 61));
977 annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
978 JPanel autoAnnotSettings1 = new JPanel();
979 autoAnnotSettings1.setLayout(new GridLayout(3, 1, 0, 0));
980 annsettingsPanel.add(autoAnnotSettings1);
981 JPanel autoAnnotSettings2 = new JPanel();
982 autoAnnotSettings2.setLayout(new GridLayout(3, 1, 0, 0));
983 annsettingsPanel.add(autoAnnotSettings2);
984 JPanel autoAnnotSettings3 = new JPanel();
985 autoAnnotSettings3.setLayout(new GridLayout(3, 1, 0, 0));
986 annsettingsPanel.add(autoAnnotSettings3);
987 visualTab.add(annsettingsPanel);
988 Border jb = new EmptyBorder(1, 1, 4, 5);
989 quality.setBorder(jb);
990 conservation.setBorder(jb);
991 identity.setBorder(jb);
992 showConsensbits.setBorder(jb);
993 showGroupbits.setBorder(jb);
994 showGroupConsensus.setBorder(jb);
995 showGroupConservation.setBorder(jb);
996 showConsensHistogram.setBorder(jb);
997 showConsensLogo.setBorder(jb);
999 autoAnnotSettings2.add(conservation);
1000 autoAnnotSettings1.add(quality);
1001 autoAnnotSettings3.add(identity);
1002 autoAnnotSettings1.add(showGroupbits);
1003 autoAnnotSettings3.add(showGroupConsensus);
1004 autoAnnotSettings2.add(showGroupConservation);
1005 autoAnnotSettings1.add(showConsensbits);
1006 autoAnnotSettings2.add(showConsensHistogram);
1007 autoAnnotSettings3.add(showConsensLogo);
1009 JPanel tooltipSettings = new JPanel();
1010 tooltipSettings.setBorder(new TitledBorder(MessageManager
1011 .getString("label.sequence_id_tooltip")));
1012 tooltipSettings.setBounds(173, 130, 200, 62);
1013 tooltipSettings.setLayout(new GridLayout(2, 1));
1014 tooltipSettings.add(showDbRefTooltip);
1015 tooltipSettings.add(showNpTooltip);
1016 visualTab.add(tooltipSettings);
1018 wrap.setFont(verdana11);
1019 wrap.setHorizontalAlignment(SwingConstants.TRAILING);
1020 wrap.setHorizontalTextPosition(SwingConstants.LEADING);
1021 wrap.setText(MessageManager.getString("label.wrap_alignment"));
1022 rightAlign.setFont(verdana11);
1023 rightAlign.setForeground(Color.black);
1024 rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
1025 rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
1026 rightAlign.setText(MessageManager.getString("label.right_align_ids"));
1027 idItalics.setFont(verdana11);
1028 idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
1029 idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
1030 idItalics.setText(MessageManager
1031 .getString("label.sequence_name_italics"));
1032 openoverv.setFont(verdana11);
1033 openoverv.setActionCommand(MessageManager
1034 .getString("label.open_overview"));
1035 openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
1036 openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
1037 openoverv.setText(MessageManager.getString(("label.open_overview")));
1038 JPanel jPanel2 = new JPanel();
1039 jPanel2.setBounds(new Rectangle(7, 17, 158, 297));
1040 GridLayout gridLayout2 = new GridLayout();
1041 jPanel2.setLayout(gridLayout2);
1042 gridLayout2.setRows(13);
1043 jPanel2.add(fullScreen);
1044 jPanel2.add(openoverv);
1045 jPanel2.add(seqLimit);
1046 jPanel2.add(rightAlign);
1047 jPanel2.add(fontLabel);
1048 jPanel2.add(showUnconserved);
1049 jPanel2.add(idItalics);
1050 jPanel2.add(smoothFont);
1051 jPanel2.add(gapLabel);
1053 jPanel2.add(sortLabel);
1054 jPanel2.add(sortAnnLabel);
1055 jPanel2.add(startupCheckbox);
1056 visualTab.add(jPanel2);
1057 visualTab.add(annotations);
1058 visualTab.add(startupFileTextfield);
1059 visualTab.add(sortby);
1060 visualTab.add(sortAnnBy);
1061 visualTab.add(sortAutocalc);
1062 visualTab.add(gapSymbolCB);
1063 visualTab.add(fontNameCB);
1064 visualTab.add(fontSizeCB);
1065 visualTab.add(fontStyleCB);
1069 protected void autoIdWidth_actionPerformed()
1071 // TODO Auto-generated method stub
1075 protected void userIdWidth_actionPerformed()
1077 // TODO Auto-generated method stub
1081 protected void maxColour_actionPerformed(JPanel panel)
1085 protected void minColour_actionPerformed(JPanel panel)
1089 protected void showunconserved_actionPerformed(ActionEvent e)
1091 // TODO Auto-generated method stub
1101 public void ok_actionPerformed(ActionEvent e)
1111 public void cancel_actionPerformed(ActionEvent e)
1121 public void annotations_actionPerformed(ActionEvent e)
1128 public void startupFileTextfield_mouseClicked()
1132 public void newLink_actionPerformed(ActionEvent e)
1137 public void editLink_actionPerformed(ActionEvent e)
1142 public void deleteLink_actionPerformed(ActionEvent e)
1147 public void defaultBrowser_mouseClicked(MouseEvent e)
1152 public void linkURLList_keyTyped(KeyEvent e)
1157 public void useProxy_actionPerformed()
1159 proxyServerTB.setEnabled(useProxy.isSelected());
1160 proxyPortTB.setEnabled(useProxy.isSelected());