+ JButton deleteLink = new JButton();
+ deleteLink.setText(MessageManager.getString("action.delete"));
+ deleteLink.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ deleteLink_actionPerformed(e);
+ }
+ });
+
+ linkURLList.addListSelectionListener(new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ int index = linkURLList.getSelectedIndex();
+ linkNameList.setSelectedIndex(index);
+ }
+ });
+
+ linkNameList.addListSelectionListener(new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ int index = linkNameList.getSelectedIndex();
+ linkURLList.setSelectedIndex(index);
+ }
+ });
+
+ JScrollPane linkScrollPane = new JScrollPane();
+ linkScrollPane.setBorder(null);
+ JPanel linkPanel = new JPanel();
+ linkPanel.setBorder(new TitledBorder(MessageManager
+ .getString("label.url_linkfrom_sequence_id")));
+ linkPanel.setLayout(new BorderLayout());
+ GridLayout gridLayout1 = new GridLayout();
+ JPanel editLinkButtons = new JPanel();
+ editLinkButtons.setLayout(gridLayout1);
+ gridLayout1.setRows(3);
+ linkNameList.setFont(verdana11);
+ linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ BorderLayout borderLayout3 = new BorderLayout();
+ JPanel linkPanel2 = new JPanel();
+ linkPanel2.setLayout(borderLayout3);
+ linkURLList.setFont(verdana11);
+ linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+ defaultBrowser.addMouseListener(new MouseAdapter()
+ {
+ public void mouseClicked(MouseEvent e)
+ {
+ if (e.getClickCount() > 1)
+ {
+ defaultBrowser_mouseClicked(e);
+ }
+ }
+ });
+ useProxy.setFont(verdana11);
+ useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
+ useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
+ useProxy.setText(MessageManager.getString("label.use_proxy_server"));
+ useProxy.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ useProxy_actionPerformed();
+ }
+ });
+ linkPanel.add(editLinkButtons, BorderLayout.EAST);
+ editLinkButtons.add(newLink, null);
+ editLinkButtons.add(editLink, null);
+ editLinkButtons.add(deleteLink, null);
+ linkPanel.add(linkScrollPane, BorderLayout.CENTER);
+ linkScrollPane.getViewport().add(linkPanel2, null);
+ linkPanel2.add(linkURLList, BorderLayout.CENTER);
+ linkPanel2.add(linkNameList, BorderLayout.WEST);
+ JPanel jPanel1 = new JPanel();
+ TitledBorder titledBorder1 = new TitledBorder(
+ MessageManager.getString("label.proxy_server"));
+ jPanel1.setBorder(titledBorder1);
+ jPanel1.setLayout(new GridBagLayout());
+ jPanel1.add(serverLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+ 2, 4, 0), 5, 0));
+ jPanel1.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+ 0, 4, 0), 11, 6));
+ connectTab.add(linkPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
+ GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
+ 16, 0, 0, 12), 359, -17));
+ connectTab.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0,
+ GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
+ 21, 0, 35, 12), 4, 6));
+ connectTab.add(browserLabel, new GridBagConstraints(0, 1, 1, 1, 0.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
+ new Insets(16, 0, 0, 0), 5, 1));
+ jPanel1.add(useProxy, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+ 2, 5, 185), 2, -4));
+ jPanel1.add(proxyPortTB, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 4, 2), 54, 1));
+ jPanel1.add(proxyServerTB, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 4, 0), 263, 1));
+ connectTab.add(defaultBrowser, new GridBagConstraints(1, 1, 1, 1, 1.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(15, 0, 0, 15), 307, 1));
+ connectTab.add(usagestats, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 4, 2), 70, 1));
+ connectTab.add(questionnaire, new GridBagConstraints(1, 4, 1, 1, 1.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 4, 2), 70, 1));
+ connectTab.add(versioncheck, new GridBagConstraints(0, 5, 1, 1, 1.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 4, 2), 70, 1));
+ return connectTab;
+ }
+
+ /**
+ * Initialises the parent panel which contains the tabbed sections.
+ *
+ * @return
+ */
+ private JPanel initOkCancelPanel()
+ {
+ JButton ok = new JButton();
+ ok.setText(MessageManager.getString("action.ok"));
+ ok.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ ok_actionPerformed(e);
+ }
+ });
+ JButton cancel = new JButton();
+ cancel.setText(MessageManager.getString("action.cancel"));
+ cancel.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ cancel_actionPerformed(e);
+ }
+ });
+ JPanel okCancelPanel = new JPanel();
+ okCancelPanel.add(ok);
+ okCancelPanel.add(cancel);
+ return okCancelPanel;
+ }
+
+ /**
+ * Initialises the Colours tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initColoursTab()
+ {
+ JPanel coloursTab = new JPanel();
+ coloursTab.setBorder(new TitledBorder(MessageManager
+ .getString("action.open_new_alignment")));
+ coloursTab.setLayout(new FlowLayout());
+ JLabel mincolourLabel = new JLabel();
+ mincolourLabel.setFont(verdana11);
+ mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ mincolourLabel.setText(MessageManager.getString("label.min_colour"));
+ minColour.setFont(verdana11);
+ minColour.setBorder(BorderFactory.createEtchedBorder());
+ minColour.setPreferredSize(new Dimension(40, 20));
+ minColour.addMouseListener(new MouseAdapter()
+ {
+ public void mousePressed(MouseEvent e)
+ {
+ minColour_actionPerformed(minColour);
+ }
+ });
+ JLabel maxcolourLabel = new JLabel();
+ maxcolourLabel.setFont(verdana11);
+ maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
+ maxColour.setFont(verdana11);
+ maxColour.setBorder(BorderFactory.createEtchedBorder());
+ maxColour.setPreferredSize(new Dimension(40, 20));
+ maxColour.addMouseListener(new MouseAdapter()
+ {
+ public void mousePressed(MouseEvent e)
+ {
+ maxColour_actionPerformed(maxColour);
+ }
+ });
+ colour.setFont(verdana11);
+ colour.setBounds(new Rectangle(172, 225, 155, 21));
+ JLabel colourLabel = new JLabel();
+ colourLabel.setFont(verdana11);
+ colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ colourLabel.setText(MessageManager.getString("label.alignment_colour")
+ + " ");
+ JvSwingUtils.addtoLayout(coloursTab, MessageManager
+ .getString("label.default_colour_scheme_for_alignment"),
+ colourLabel, colour);
+ JPanel annotationShding = new JPanel();
+ annotationShding.setBorder(new TitledBorder(MessageManager
+ .getString("label.annotation_shading_default")));
+ annotationShding.setLayout(new GridLayout(1, 2));
+ JvSwingUtils.addtoLayout(annotationShding, MessageManager
+ .getString("label.default_minimum_colour_annotation_shading"),
+ mincolourLabel, minColour);
+ JvSwingUtils.addtoLayout(annotationShding, MessageManager
+ .getString("label.default_maximum_colour_annotation_shading"),
+ maxcolourLabel, maxColour);
+ coloursTab.add(annotationShding); // , FlowLayout.LEFT);
+ return coloursTab;
+ }
+
+ /**
+ * Initialises the Structure tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initStructureTab()
+ {
+ JPanel structureTab = new JPanel();
+ structureTab.setBorder(new TitledBorder(MessageManager
+ .getString("label.structure_options")));
+ structureTab.setLayout(null);
+ final int width = 400;
+ final int height = 23;
+ final int lineSpacing = 30;
+ int ypos = 30;
+
+ structFromPdb.setFont(verdana11);
+ structFromPdb.setText(MessageManager.getString("label.struct_from_pdb"));
+ structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
+ structFromPdb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ boolean selected = structFromPdb.isSelected();
+ // enable other options only when the first is checked
+ useRnaView.setEnabled(selected);
+ addSecondaryStructure.setEnabled(selected);
+ addTempFactor.setEnabled(selected);
+ }
+ });
+ structureTab.add(structFromPdb);
+
+ // indent checkboxes that are conditional on the first one
+ ypos += lineSpacing;
+ useRnaView.setFont(verdana11);
+ useRnaView.setText(MessageManager.getString("label.use_rnaview"));
+ useRnaView.setBounds(new Rectangle(25, ypos, width, height));
+ structureTab.add(useRnaView);
+
+ ypos += lineSpacing;
+ addSecondaryStructure.setFont(verdana11);
+ addSecondaryStructure.setText(MessageManager
+ .getString("label.autoadd_secstr"));
+ addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
+ structureTab.add(addSecondaryStructure);
+
+ ypos += lineSpacing;
+ addTempFactor.setFont(verdana11);
+ addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
+ addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
+ structureTab.add(addTempFactor);
+
+ ypos += lineSpacing;
+ JLabel viewerLabel = new JLabel();
+ viewerLabel.setFont(verdana11);
+ viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
+ viewerLabel.setBounds(new Rectangle(10, ypos, 200, height));
+ structureTab.add(viewerLabel);
+
+ structViewer.setFont(verdana11);
+ structViewer.setBounds(new Rectangle(160, ypos, 120, height));
+ structViewer.addItem(Viewer.JMOL.name());
+ structViewer.addItem(Viewer.CHIMERA.name());
+ structureTab.add(structViewer);
+
+ ypos += lineSpacing;
+ JLabel pathLabel = new JLabel();
+ pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
+ pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ pathLabel.setText(MessageManager.getString("label.chimera_path"));
+ pathLabel.setToolTipText(MessageManager
+ .getString("label.chimera_path_tip"));
+ pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
+ structureTab.add(pathLabel);
+
+ chimeraPath.setFont(verdana11);
+ chimeraPath.setText("");
+ chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
+ structureTab.add(chimeraPath);
+
+ return structureTab;
+ }
+
+ /**
+ * Initialises the Visual tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initVisualTab()
+ {
+ JPanel visualTab = new JPanel();
+ visualTab.setBorder(new TitledBorder(MessageManager
+ .getString("action.open_new_alignment")));
+ visualTab.setLayout(null);
+ fullScreen.setFont(verdana11);
+ fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
+ fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
+ fullScreen.setText(MessageManager.getString("label.maximize_window"));
+ quality.setEnabled(false);
+ quality.setFont(verdana11);
+ quality.setHorizontalAlignment(SwingConstants.RIGHT);
+ quality.setHorizontalTextPosition(SwingConstants.LEFT);
+ quality.setSelected(true);
+ quality.setText(MessageManager.getString("label.quality"));
+ conservation.setEnabled(false);
+ conservation.setFont(verdana11);
+ conservation.setHorizontalAlignment(SwingConstants.RIGHT);
+ conservation.setHorizontalTextPosition(SwingConstants.LEFT);
+ conservation.setSelected(true);
+ conservation.setText(MessageManager.getString("label.conservation"));
+ identity.setEnabled(false);
+ identity.setFont(verdana11);
+ identity.setHorizontalAlignment(SwingConstants.RIGHT);
+ identity.setHorizontalTextPosition(SwingConstants.LEFT);
+ identity.setSelected(true);
+ identity.setText(MessageManager.getString("label.consensus"));
+ JLabel showGroupbits = new JLabel();
+ showGroupbits.setFont(verdana11);
+ showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupbits.setText(MessageManager.getString("action.show_group")
+ + ":");
+ JLabel showConsensbits = new JLabel();
+ showConsensbits.setFont(verdana11);
+ showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensbits.setText(MessageManager.getString("label.consensus")
+ + ":");
+ showConsensHistogram.setEnabled(false);
+ showConsensHistogram.setFont(verdana11);
+ showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensHistogram.setSelected(true);
+ showConsensHistogram.setText(MessageManager
+ .getString("label.histogram"));