X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGPreferences.java;h=90053f5ff39370b7ac49a04ab5d5cb87f8d6bc0a;hb=refs%2Fheads%2Freleases%2FRelease_2_10_0_Branch;hp=4f4afb0037ee32febb6ea67dbfd198b6dd6e454c;hpb=2526066acdc3faf3a178e50672c78e428287e9ef;p=jalview.git diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 4f4afb0..90053f5 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -20,9 +20,11 @@ */ 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; @@ -44,6 +46,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; import javax.swing.DefaultListCellRenderer; import javax.swing.JButton; import javax.swing.JCheckBox; @@ -52,6 +55,7 @@ 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.JTextField; @@ -76,8 +80,8 @@ public class GPreferences extends JPanel { private static final Font LABEL_FONT = JvSwingUtils.getLabelFont(); - private static final Font LABEL_FONT_ITALIC = JvSwingUtils - .getLabelFont(false, true); + private static final Font LABEL_FONT_ITALIC = JvSwingUtils.getLabelFont( + false, true); /* * Visual tab components @@ -156,6 +160,11 @@ public class GPreferences extends JPanel protected JTextField chimeraPath = new JTextField(); + protected ButtonGroup mappingMethod = new ButtonGroup(); + + protected JRadioButton siftsMapping = new JRadioButton(); + + protected JRadioButton nwMapping = new JRadioButton(); /* * Colours tab components @@ -192,7 +201,7 @@ public class GPreferences extends JPanel /* * Output tab components */ - protected JComboBox epsRendering = new JComboBox(); + protected JComboBox epsRendering = new JComboBox(); protected JLabel userIdWidthlabel = new JLabel(); @@ -276,16 +285,17 @@ public class GPreferences extends JPanel tabbedPane.add(initConnectionsTab(), MessageManager.getString("label.connections")); - tabbedPane.add(initOutputTab(), MessageManager.getString("label.output")); + tabbedPane.add(initOutputTab(), + MessageManager.getString("label.output")); - tabbedPane.add(initEditingTab(), MessageManager.getString("label.editing")); + tabbedPane.add(initEditingTab(), + MessageManager.getString("label.editing")); /* * See DasSourceBrowser for the real work of configuring this tab. */ dasTab.setLayout(new BorderLayout()); - tabbedPane - .add(dasTab, MessageManager.getString("label.das_settings")); + tabbedPane.add(dasTab, MessageManager.getString("label.das_settings")); /* * See WsPreferences for the real work of configuring this tab. @@ -402,8 +412,9 @@ public class GPreferences extends JPanel autoIdWidth.setFont(LABEL_FONT); autoIdWidth.setText(MessageManager .getString("label.automatically_set_id_width")); - autoIdWidth - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.adjusts_width_generated_eps_png"))); + autoIdWidth.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager + .getString("label.adjusts_width_generated_eps_png"))); autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23)); autoIdWidth.addActionListener(new ActionListener() { @@ -418,9 +429,11 @@ public class GPreferences extends JPanel userIdWidthlabel.setText(MessageManager .getString("label.figure_id_column_width")); userIdWidth - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column"))); + .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager + .getString("label.manually_specify_width_left_column"))); userIdWidthlabel - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column"))); + .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager + .getString("label.manually_specify_width_left_column"))); userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23)); userIdWidth.setFont(JvSwingUtils.getTextAreaFont()); userIdWidth.setText(""); @@ -506,6 +519,7 @@ public class GPreferences extends JPanel newLink.setText(MessageManager.getString("action.new")); newLink.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { newLink_actionPerformed(e); @@ -515,6 +529,7 @@ public class GPreferences extends JPanel editLink.setText(MessageManager.getString("action.edit")); editLink.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { editLink_actionPerformed(e); @@ -524,6 +539,7 @@ public class GPreferences extends JPanel deleteLink.setText(MessageManager.getString("action.delete")); deleteLink.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(ActionEvent e) { deleteLink_actionPerformed(e); @@ -532,6 +548,7 @@ public class GPreferences extends JPanel linkURLList.addListSelectionListener(new ListSelectionListener() { + @Override public void valueChanged(ListSelectionEvent e) { int index = linkURLList.getSelectedIndex(); @@ -541,6 +558,7 @@ public class GPreferences extends JPanel linkNameList.addListSelectionListener(new ListSelectionListener() { + @Override public void valueChanged(ListSelectionEvent e) { int index = linkNameList.getSelectedIndex(); @@ -568,6 +586,7 @@ public class GPreferences extends JPanel defaultBrowser.addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 1) @@ -582,6 +601,7 @@ public class GPreferences extends JPanel useProxy.setText(MessageManager.getString("label.use_proxy_server")); useProxy.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { useProxy_actionPerformed(); @@ -650,6 +670,7 @@ public class GPreferences extends JPanel ok.setText(MessageManager.getString("action.ok")); ok.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { ok_actionPerformed(e); @@ -659,6 +680,7 @@ public class GPreferences extends JPanel cancel.setText(MessageManager.getString("action.cancel")); cancel.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { cancel_actionPerformed(e); @@ -690,6 +712,7 @@ public class GPreferences extends JPanel minColour.setPreferredSize(new Dimension(40, 20)); minColour.addMouseListener(new MouseAdapter() { + @Override public void mousePressed(MouseEvent e) { minColour_actionPerformed(minColour); @@ -704,6 +727,7 @@ public class GPreferences extends JPanel maxColour.setPreferredSize(new Dimension(40, 20)); maxColour.addMouseListener(new MouseAdapter() { + @Override public void mousePressed(MouseEvent e) { maxColour_actionPerformed(maxColour); @@ -727,8 +751,7 @@ public class GPreferences extends JPanel nucColourLabel.setFont(LABEL_FONT); nucColourLabel.setHorizontalAlignment(SwingConstants.LEFT); nucColourLabel.setText(MessageManager - .getString("label.nuc_alignment_colour") - + " "); + .getString("label.nuc_alignment_colour") + " "); JvSwingUtils.addtoLayout(coloursTab, MessageManager .getString("label.default_colour_scheme_for_alignment"), nucColourLabel, nucColour); @@ -762,10 +785,11 @@ public class GPreferences extends JPanel final int width = 400; final int height = 22; final int lineSpacing = 25; - int ypos = 30; + int ypos = 15; structFromPdb.setFont(LABEL_FONT); - structFromPdb.setText(MessageManager.getString("label.struct_from_pdb")); + structFromPdb + .setText(MessageManager.getString("label.struct_from_pdb")); structFromPdb.setBounds(new Rectangle(5, ypos, width, height)); structFromPdb.addActionListener(new ActionListener() { @@ -856,22 +880,35 @@ public class GPreferences extends JPanel structureTab.add(chimeraPath); ypos += lineSpacing; - // scrl_pdbDocFieldConfig.setPreferredSize(new Dimension(450, 100)); - // scrl_pdbDocFieldConfig - // .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - // scrl_pdbDocFieldConfig.setBounds(); - PDBDocFieldPreferences docFieldPref = new PDBDocFieldPreferences( - PreferenceSource.PREFERENCES); - docFieldPref.setBounds(new Rectangle(10, ypos + 5, 450, 120)); - structureTab.add(docFieldPref); - - + nwMapping.setFont(LABEL_FONT); + nwMapping.setText(MessageManager.getString("label.nw_mapping")); + siftsMapping.setFont(LABEL_FONT); + siftsMapping.setText(MessageManager.getString("label.sifts_mapping")); + mappingMethod.add(nwMapping); + mappingMethod.add(siftsMapping); + JPanel mappingPanel = new JPanel(); + mappingPanel.setFont(LABEL_FONT); + TitledBorder mmTitledBorder = new TitledBorder( + MessageManager.getString("label.mapping_method")); + mmTitledBorder.setTitleFont(LABEL_FONT); + mappingPanel.setBorder(mmTitledBorder); + mappingPanel.setBounds(new Rectangle(10, ypos, 452, 45)); + // GridLayout mappingLayout = new GridLayout(); + mappingPanel.setLayout(new GridLayout()); + mappingPanel.add(nwMapping); + mappingPanel.add(siftsMapping); + structureTab.add(mappingPanel); + ypos += lineSpacing; + ypos += lineSpacing; + FTSDataColumnPreferences docFieldPref = new FTSDataColumnPreferences( + PreferenceSource.PREFERENCES, PDBFTSRestClient.getInstance()); + docFieldPref.setBounds(new Rectangle(10, ypos, 450, 120)); + structureTab.add(docFieldPref); return structureTab; } - /** * Action on choosing a structure viewer from combobox options. * @@ -1019,6 +1056,7 @@ public class GPreferences extends JPanel annotations.setBounds(new Rectangle(169, 12, 200, 23)); annotations.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { annotations_actionPerformed(e); @@ -1026,6 +1064,7 @@ public class GPreferences extends JPanel }); identity.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { annotations_actionPerformed(e); @@ -1033,6 +1072,7 @@ public class GPreferences extends JPanel }); showGroupConsensus.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { annotations_actionPerformed(e); @@ -1046,6 +1086,7 @@ public class GPreferences extends JPanel .getString("action.show_unconserved")); showUnconserved.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { showunconserved_actionPerformed(e); @@ -1113,6 +1154,7 @@ public class GPreferences extends JPanel startupFileTextfield.setBounds(new Rectangle(172, 310, 330, 20)); startupFileTextfield.addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 1) @@ -1121,7 +1163,7 @@ public class GPreferences extends JPanel } } }); - + sortby.setFont(LABEL_FONT); sortby.setBounds(new Rectangle(172, 260, 155, 21)); JLabel sortLabel = new JLabel(); @@ -1194,7 +1236,7 @@ public class GPreferences extends JPanel .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, 310)); jPanel2.setLayout(new GridLayout(14, 1));