*/
package jalview.jbgui;
+import jalview.fts.core.FTSDataColumnPreferences;
+import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
+import jalview.fts.service.pdb.PDBFTSRestClient;
import jalview.gui.JvSwingUtils;
import jalview.gui.StructureViewer.ViewerType;
-import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
-import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
+import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
/**
* Base class for the Preferences panel.
protected JComboBox<String> fontNameCB = new JComboBox<String>();
+ protected JCheckBox showOccupancy = new JCheckBox();
+
protected JCheckBox showUnconserved = new JCheckBox();
protected JCheckBox idItalics = new JCheckBox();
protected JCheckBox wrap = new JCheckBox();
- protected JCheckBox hideIntrons = new JCheckBox();
-
protected JComboBox<String> sortby = new JComboBox<String>();
protected JComboBox<String> sortAnnBy = new JComboBox<String>();
/*
* Connections tab components
*/
- protected JList linkURLList = new JList();
+ protected JTable linkUrlTable = new JTable();
+
+ protected JButton editLink = new JButton();
+
+ protected JButton deleteLink = new JButton();
+
+ protected JTextField filterTB = new JTextField();
+
+ protected JButton doReset = new JButton();
+
+ protected JButton userOnly = new JButton();
+
+ protected JLabel portLabel = new JLabel();
+
+ protected JLabel serverLabel = new JLabel();
protected JTextField proxyServerTB = new JTextField();
protected JTextField defaultBrowser = new JTextField();
- protected JList linkNameList = new JList();
-
protected JCheckBox useProxy = new JCheckBox();
protected JCheckBox usagestats = new JCheckBox();
/*
* Output tab components
*/
- protected JComboBox<String> epsRendering = new JComboBox<String>();
+ protected JComboBox<Object> epsRendering = new JComboBox<Object>();
protected JLabel userIdWidthlabel = new JLabel();
tabbedPane.add(initConnectionsTab(),
MessageManager.getString("label.connections"));
+ tabbedPane.add(initLinksTab(),
+ MessageManager.getString("label.urllinks"));
+
tabbedPane.add(initOutputTab(),
MessageManager.getString("label.output"));
{
JPanel connectTab = new JPanel();
connectTab.setLayout(new GridBagLayout());
- JLabel serverLabel = new JLabel();
- serverLabel.setText(MessageManager.getString("label.address"));
- serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
- serverLabel.setFont(LABEL_FONT);
- proxyServerTB.setFont(LABEL_FONT);
- proxyPortTB.setFont(LABEL_FONT);
- JLabel portLabel = new JLabel();
- portLabel.setFont(LABEL_FONT);
- portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
- portLabel.setText(MessageManager.getString("label.port"));
+
+ // Label for browser text box
JLabel browserLabel = new JLabel();
- browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
+ browserLabel.setFont(LABEL_FONT);
browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
browserLabel.setText(MessageManager
.getString("label.default_browser_unix"));
defaultBrowser.setFont(LABEL_FONT);
defaultBrowser.setText("");
- usagestats.setText(MessageManager
- .getString("label.send_usage_statistics"));
- usagestats.setFont(LABEL_FONT);
- usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
- usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
- questionnaire.setText(MessageManager
- .getString("label.check_for_questionnaires"));
- questionnaire.setFont(LABEL_FONT);
- questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
- questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
- versioncheck.setText(MessageManager
- .getString("label.check_for_latest_version"));
- versioncheck.setFont(LABEL_FONT);
- versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
- versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
+
+ defaultBrowser.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseClicked(MouseEvent e)
+ {
+ if (e.getClickCount() > 1)
+ {
+ defaultBrowser_mouseClicked(e);
+ }
+ }
+ });
+
+ JPanel proxyPanel = initConnTabProxyPanel();
+ initConnTabCheckboxes();
+
+ // Add default Browser text box
+ connectTab.add(browserLabel, new GridBagConstraints(0, 0, 1, 1, 0.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
+ new Insets(10, 0, 5, 5), 5, 1));
+ defaultBrowser.setFont(LABEL_FONT);
+ defaultBrowser.setText("");
+
+ connectTab.add(defaultBrowser, new GridBagConstraints(1, 0, 1, 1, 1.0,
+ 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+ new Insets(10, 0, 5, 10), 30, 1));
+
+ // Add proxy server panel
+ connectTab.add(proxyPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0,
+ GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+ new Insets(10, 0, 5, 12), 4, 10));
+
+ // Add usage stats, version check and questionnaire checkboxes
+ connectTab.add(usagestats, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 5, 5), 70, 1));
+ connectTab.add(questionnaire, new GridBagConstraints(1, 2, 1, 1, 1.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 5, 10), 70, 1));
+ connectTab.add(versioncheck, new GridBagConstraints(0, 3, 1, 1, 1.0,
+ 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
+ new Insets(0, 2, 5, 5), 70, 1));
+
+ // Add padding so the panel doesn't look ridiculous
+ JPanel spacePanel = new JPanel();
+ connectTab.add(spacePanel, new GridBagConstraints(0, 4, 1, 1, 1.0, 1.0,
+ GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0,
+ 0, 0, 5), 70, 1));
+
+ return connectTab;
+ }
+
+ /**
+ * Initialises the Links tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initLinksTab()
+ {
+ JPanel linkTab = new JPanel();
+ linkTab.setLayout(new GridBagLayout());
+
+ // Set up table for Url links
+ linkUrlTable.setFillsViewportHeight(true);
+ linkUrlTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
+ linkUrlTable.setAutoCreateRowSorter(true);
+ linkUrlTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+ // adjust row height so radio buttons actually fit
+ // don't do this in the renderer, it causes the awt thread to activate
+ // constantly
+ JRadioButton temp = new JRadioButton();
+ linkUrlTable.setRowHeight(temp.getMinimumSize().height);
+
+ // Table in scrollpane so that the table is given a scrollbar
+ JScrollPane linkScrollPane = new JScrollPane(linkUrlTable);
+ linkScrollPane.setBorder(null);
+
+ // Panel for links functionality
+ JPanel linkPanel = new JPanel(new GridBagLayout());
+ linkPanel.setBorder(new TitledBorder(MessageManager
+ .getString("label.url_linkfrom_sequence_id")));
+
+ // Put the Url links panel together
+
+ // Buttons go at top right, resizing only resizes the blank space vertically
+ JPanel buttonPanel = initLinkTabUrlButtons();
+ GridBagConstraints linkConstraints1 = new GridBagConstraints();
+ linkConstraints1.insets = new Insets(0, 0, 5, 0);
+ linkConstraints1.gridx = 0;
+ linkConstraints1.gridy = 0;
+ linkConstraints1.weightx = 1.0;
+ linkConstraints1.fill = GridBagConstraints.HORIZONTAL;
+ linkTab.add(buttonPanel, linkConstraints1);
+
+ // Links table goes at top left, resizing resizes the table
+ GridBagConstraints linkConstraints2 = new GridBagConstraints();
+ linkConstraints2.insets = new Insets(0, 0, 5, 5);
+ linkConstraints2.gridx = 0;
+ linkConstraints2.gridy = 1;
+ linkConstraints2.weightx = 1.0;
+ linkConstraints2.weighty = 1.0;
+ linkConstraints2.fill = GridBagConstraints.BOTH;
+ linkTab.add(linkScrollPane, linkConstraints2);
+
+ // Filter box and buttons goes at bottom left, resizing resizes the text box
+ JPanel filterPanel = initLinkTabFilterPanel();
+ GridBagConstraints linkConstraints3 = new GridBagConstraints();
+ linkConstraints3.insets = new Insets(0, 0, 0, 5);
+ linkConstraints3.gridx = 0;
+ linkConstraints3.gridy = 2;
+ linkConstraints3.weightx = 1.0;
+ linkConstraints3.fill = GridBagConstraints.HORIZONTAL;
+ linkTab.add(filterPanel, linkConstraints3);
+
+ return linkTab;
+ }
+
+ private JPanel initLinkTabFilterPanel()
+ {
+ // Filter textbox and reset button
+ JLabel filterLabel = new JLabel(
+ MessageManager.getString("label.filter"));
+ filterLabel.setFont(LABEL_FONT);
+ filterLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ filterLabel.setHorizontalTextPosition(SwingConstants.LEADING);
+
+ filterTB.setFont(LABEL_FONT);
+ filterTB.setText("");
+
+ doReset.setText(MessageManager.getString("action.showall"));
+ userOnly.setText(MessageManager.getString("action.customfilter"));
+
+ // Panel for filter functionality
+ JPanel filterPanel = new JPanel(new GridBagLayout());
+ filterPanel.setBorder(new TitledBorder("Filter"));
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.anchor = GridBagConstraints.WEST;
+
+ filterPanel.add(filterLabel, gbc);
+
+ GridBagConstraints gbc1 = new GridBagConstraints();
+ gbc1.gridx = 1;
+ gbc1.gridwidth = 2;
+ gbc1.fill = GridBagConstraints.HORIZONTAL;
+ gbc1.anchor = GridBagConstraints.WEST;
+ gbc1.weightx = 1.0;
+ filterPanel.add(filterTB, gbc1);
+
+ GridBagConstraints gbc2 = new GridBagConstraints();
+ gbc2.gridx = 3;
+ gbc2.fill = GridBagConstraints.NONE;
+ gbc2.anchor = GridBagConstraints.WEST;
+ filterPanel.add(doReset, gbc2);
+
+ GridBagConstraints gbc3 = new GridBagConstraints();
+ gbc3.gridx = 4;
+ gbc3.fill = GridBagConstraints.NONE;
+ gbc3.anchor = GridBagConstraints.WEST;
+ filterPanel.add(userOnly, gbc3);
+
+ return filterPanel;
+ }
+
+ private JPanel initLinkTabUrlButtons()
+ {
+ // Buttons for new / edit / delete Url links
JButton newLink = new JButton();
newLink.setText(MessageManager.getString("action.new"));
+
+ editLink.setText(MessageManager.getString("action.edit"));
+
+ deleteLink.setText(MessageManager.getString("action.delete"));
+
+ // no current selection, so initially disable delete/edit buttons
+ editLink.setEnabled(false);
+ deleteLink.setEnabled(false);
+
newLink.addActionListener(new java.awt.event.ActionListener()
{
@Override
newLink_actionPerformed(e);
}
});
- JButton editLink = new JButton();
+
editLink.setText(MessageManager.getString("action.edit"));
editLink.addActionListener(new java.awt.event.ActionListener()
{
editLink_actionPerformed(e);
}
});
- JButton deleteLink = new JButton();
+
deleteLink.setText(MessageManager.getString("action.delete"));
deleteLink.addActionListener(new java.awt.event.ActionListener()
{
}
});
- linkURLList.addListSelectionListener(new ListSelectionListener()
- {
- @Override
- public void valueChanged(ListSelectionEvent e)
- {
- int index = linkURLList.getSelectedIndex();
- linkNameList.setSelectedIndex(index);
- }
- });
+ JPanel buttonPanel = new JPanel(new GridBagLayout());
+ buttonPanel.setBorder(new TitledBorder("Edit links"));
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+ gbc.fill = GridBagConstraints.NONE;
+ buttonPanel.add(newLink, gbc);
+
+ GridBagConstraints gbc1 = new GridBagConstraints();
+ gbc1.gridx = 1;
+ gbc1.gridy = 0;
+ gbc1.fill = GridBagConstraints.NONE;
+ buttonPanel.add(editLink, gbc1);
+
+ GridBagConstraints gbc2 = new GridBagConstraints();
+ gbc2.gridx = 2;
+ gbc2.gridy = 0;
+ gbc2.fill = GridBagConstraints.NONE;
+ buttonPanel.add(deleteLink, gbc2);
+
+ GridBagConstraints gbc3 = new GridBagConstraints();
+ gbc3.gridx = 3;
+ gbc3.gridy = 0;
+ gbc3.fill = GridBagConstraints.HORIZONTAL;
+ gbc3.weightx = 1.0;
+ JPanel spacePanel = new JPanel();
+ spacePanel.setBorder(null);
+ buttonPanel.add(spacePanel, gbc3);
+
+ return buttonPanel;
+ }
- linkNameList.addListSelectionListener(new ListSelectionListener()
- {
- @Override
- public void valueChanged(ListSelectionEvent e)
- {
- int index = linkNameList.getSelectedIndex();
- linkURLList.setSelectedIndex(index);
- }
- });
+ /**
+ * Initialises the proxy server panel in the Connections tab
+ *
+ * @return the proxy server panel
+ */
+ private JPanel initConnTabProxyPanel()
+ {
+ // Label for server text box
+ serverLabel.setText(MessageManager.getString("label.address"));
+ serverLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ serverLabel.setFont(LABEL_FONT);
- 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(LABEL_FONT);
- linkNameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- BorderLayout borderLayout3 = new BorderLayout();
- JPanel linkPanel2 = new JPanel();
- linkPanel2.setLayout(borderLayout3);
- linkURLList.setFont(LABEL_FONT);
- linkURLList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ // Proxy server and port text boxes
+ proxyServerTB.setFont(LABEL_FONT);
+ proxyPortTB.setFont(LABEL_FONT);
- defaultBrowser.addMouseListener(new MouseAdapter()
- {
- @Override
- public void mouseClicked(MouseEvent e)
- {
- if (e.getClickCount() > 1)
- {
- defaultBrowser_mouseClicked(e);
- }
- }
- });
+ // Label for Port text box
+ portLabel.setFont(LABEL_FONT);
+ portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ portLabel.setText(MessageManager.getString("label.port"));
+
+ // Use proxy server checkbox
useProxy.setFont(LABEL_FONT);
useProxy.setHorizontalAlignment(SwingConstants.RIGHT);
useProxy.setHorizontalTextPosition(SwingConstants.LEADING);
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();
+
+ // Make proxy server panel
+ JPanel proxyPanel = 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,
+ proxyPanel.setBorder(titledBorder1);
+ proxyPanel.setLayout(new GridBagLayout());
+ proxyPanel.add(serverLabel, 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,
+ new Insets(0, 2, 2, 0), 5, 0));
+ proxyPanel.add(portLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
+ GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
+ 0, 2, 0), 11, 0));
+ proxyPanel.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,
+ proxyPanel.add(proxyPortTB, new GridBagConstraints(3, 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,
+ new Insets(0, 2, 2, 2), 54, 1));
+ proxyPanel.add(proxyServerTB, new GridBagConstraints(1, 1, 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;
+ new Insets(0, 2, 2, 0), 263, 1));
+
+ return proxyPanel;
+ }
+
+ /**
+ * Initialises the checkboxes in the Connections tab
+ */
+ private void initConnTabCheckboxes()
+ {
+ // Usage stats checkbox label
+ usagestats.setText(MessageManager
+ .getString("label.send_usage_statistics"));
+ usagestats.setFont(LABEL_FONT);
+ usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
+ usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
+
+ // Questionnaire checkbox label
+ questionnaire.setText(MessageManager
+ .getString("label.check_for_questionnaires"));
+ questionnaire.setFont(LABEL_FONT);
+ questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
+ questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
+
+ // Check for latest version checkbox label
+ versioncheck.setText(MessageManager
+ .getString("label.check_for_latest_version"));
+ versioncheck.setFont(LABEL_FONT);
+ versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
+ versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
}
/**
ypos += lineSpacing;
ypos += lineSpacing;
- PDBDocFieldPreferences docFieldPref = new PDBDocFieldPreferences(
- PreferenceSource.PREFERENCES);
+ FTSDataColumnPreferences docFieldPref = new FTSDataColumnPreferences(
+ PreferenceSource.PREFERENCES, PDBFTSRestClient.getInstance());
docFieldPref.setBounds(new Rectangle(10, ypos, 450, 120));
structureTab.add(docFieldPref);
identity.setHorizontalTextPosition(SwingConstants.LEFT);
identity.setSelected(true);
identity.setText(MessageManager.getString("label.consensus"));
+ showOccupancy.setFont(LABEL_FONT);
+ showOccupancy.setEnabled(false);
+ showOccupancy.setHorizontalAlignment(SwingConstants.RIGHT);
+ showOccupancy.setHorizontalTextPosition(SwingConstants.LEFT);
+ showOccupancy.setSelected(true);
+ showOccupancy.setText(MessageManager.getString("label.occupancy"));
+
JLabel showGroupbits = new JLabel();
showGroupbits.setFont(LABEL_FONT);
showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
.getString("label.database_references"));
annotations.setFont(LABEL_FONT);
annotations.setHorizontalAlignment(SwingConstants.RIGHT);
- annotations.setHorizontalTextPosition(SwingConstants.LEADING);
+ annotations.setHorizontalTextPosition(SwingConstants.LEFT);
annotations.setSelected(true);
annotations.setText(MessageManager.getString("label.show_annotations"));
- annotations.setBounds(new Rectangle(169, 12, 200, 23));
+ // annotations.setBounds(new Rectangle(169, 12, 200, 23));
annotations.addActionListener(new ActionListener()
{
@Override
startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
startupCheckbox.setSelected(true);
startupFileTextfield.setFont(LABEL_FONT);
- startupFileTextfield.setBounds(new Rectangle(173, 328, 330, 20));
+ startupFileTextfield.setBounds(new Rectangle(172, 310, 330, 20));
startupFileTextfield.addMouseListener(new MouseAdapter()
{
@Override
});
sortby.setFont(LABEL_FONT);
- sortby.setBounds(new Rectangle(172, 280, 155, 20));
+ sortby.setBounds(new Rectangle(172, 260, 155, 21));
JLabel sortLabel = new JLabel();
sortLabel.setFont(LABEL_FONT);
sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
sortLabel.setText(MessageManager.getString("label.sort_by"));
sortAnnBy.setFont(LABEL_FONT);
- sortAnnBy.setBounds(new Rectangle(172, 305, 110, 20));
+ sortAnnBy.setBounds(new Rectangle(172, 285, 110, 21));
JLabel sortAnnLabel = new JLabel();
sortAnnLabel.setFont(LABEL_FONT);
sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
sortAutocalc.setFont(LABEL_FONT);
- sortAutocalc.setBounds(new Rectangle(290, 305, 165, 20));
+ sortAutocalc.setBounds(new Rectangle(290, 285, 165, 21));
JPanel annsettingsPanel = new JPanel();
- annsettingsPanel.setBounds(new Rectangle(173, 34, 320, 75));
+ annsettingsPanel.setBounds(new Rectangle(173, 13, 320, 96));
annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
annsettingsPanel.setBorder(new EtchedBorder());
visualTab.add(annsettingsPanel);
Border jb = new EmptyBorder(1, 1, 4, 5);
+ annotations.setBorder(jb);
+ showOccupancy.setBorder(jb);
quality.setBorder(jb);
conservation.setBorder(jb);
identity.setBorder(jb);
showConsensLogo.setBorder(jb);
JPanel autoAnnotSettings = new JPanel();
- autoAnnotSettings.setLayout(new GridLayout(3, 3));
annsettingsPanel.add(autoAnnotSettings);
+ autoAnnotSettings.setLayout(new GridLayout(0, 2));
+ autoAnnotSettings.add(annotations);
autoAnnotSettings.add(quality);
+ // second row of autoannotation box
+ autoAnnotSettings = new JPanel();
+ annsettingsPanel.add(autoAnnotSettings);
+
+ autoAnnotSettings.setLayout(new GridLayout(0, 3));
autoAnnotSettings.add(conservation);
autoAnnotSettings.add(identity);
+ autoAnnotSettings.add(showOccupancy);
autoAnnotSettings.add(showGroupbits);
autoAnnotSettings.add(showGroupConservation);
autoAnnotSettings.add(showGroupConsensus);
autoAnnotSettings.add(showConsensbits);
autoAnnotSettings.add(showConsensHistogram);
autoAnnotSettings.add(showConsensLogo);
+
+
JPanel tooltipSettings = new JPanel();
tooltipSettings.setBorder(new TitledBorder(MessageManager
wrap.setHorizontalAlignment(SwingConstants.TRAILING);
wrap.setHorizontalTextPosition(SwingConstants.LEADING);
wrap.setText(MessageManager.getString("label.wrap_alignment"));
- hideIntrons.setFont(LABEL_FONT);
- hideIntrons.setHorizontalAlignment(SwingConstants.TRAILING);
- hideIntrons.setHorizontalTextPosition(SwingConstants.LEADING);
- hideIntrons.setText(MessageManager.getString("label.hide_introns"));
- hideIntrons.setToolTipText(MessageManager
- .getString("label.hide_introns_tip"));
rightAlign.setFont(LABEL_FONT);
rightAlign.setForeground(Color.black);
rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
.getString("label.open_overview"));
openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
- openoverv.setText(MessageManager.getString(("label.open_overview")));
+ openoverv.setText(MessageManager.getString("label.open_overview"));
JPanel jPanel2 = new JPanel();
- jPanel2.setBounds(new Rectangle(7, 17, 158, 330));
- jPanel2.setLayout(new GridLayout(15, 1));
+ jPanel2.setBounds(new Rectangle(7, 17, 158, 310));
+ jPanel2.setLayout(new GridLayout(14, 1));
jPanel2.add(fullScreen);
jPanel2.add(openoverv);
jPanel2.add(seqLimit);
jPanel2.add(scaleProteinToCdna);
jPanel2.add(gapLabel);
jPanel2.add(wrap);
- jPanel2.add(hideIntrons);
jPanel2.add(sortLabel);
jPanel2.add(sortAnnLabel);
jPanel2.add(startupCheckbox);
visualTab.add(jPanel2);
- visualTab.add(annotations);
visualTab.add(startupFileTextfield);
visualTab.add(sortby);
visualTab.add(sortAnnBy);
public void useProxy_actionPerformed()
{
- proxyServerTB.setEnabled(useProxy.isSelected());
- proxyPortTB.setEnabled(useProxy.isSelected());
+ boolean enabled = useProxy.isSelected();
+ portLabel.setEnabled(enabled);
+ serverLabel.setEnabled(enabled);
+ proxyServerTB.setEnabled(enabled);
+ proxyPortTB.setEnabled(enabled);
}
+ /**
+ * Customer renderer for JTable: supports column of radio buttons
+ */
+ public class RadioButtonRenderer extends JRadioButton implements
+ TableCellRenderer
+ {
+ public RadioButtonRenderer()
+ {
+ setHorizontalAlignment(CENTER);
+ setToolTipText(MessageManager.getString("label.urltooltip"));
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table,
+ Object value, boolean isSelected, boolean hasFocus, int row,
+ int column)
+ {
+ setSelected((boolean) value);
+
+ // set colours to match rest of table
+ if (isSelected)
+ {
+ setBackground(table.getSelectionBackground());
+ setForeground(table.getSelectionForeground());
+ }
+ else
+ {
+ setBackground(table.getBackground());
+ setForeground(table.getForeground());
+ }
+ return this;
+ }
+ }
+
+ /**
+ * Customer cell editor for JTable: supports column of radio buttons in
+ * conjunction with renderer
+ */
+ public class RadioButtonEditor extends AbstractCellEditor implements
+ TableCellEditor
+ {
+ private JRadioButton button = new JRadioButton();
+
+ public RadioButtonEditor()
+ {
+ button.setHorizontalAlignment(SwingConstants.CENTER);
+ this.button.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ fireEditingStopped();
+ }
+ });
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table,
+ Object value, boolean isSelected, int row, int column)
+ {
+ button.setSelected((boolean) value);
+ return button;
+ }
+
+ @Override
+ public Object getCellEditorValue()
+ {
+ return button.isSelected();
+ }
+
+ }
}