merge of SIFTs Branch
[jalview.git] / src / jalview / jbgui / GPreferences.java
index b12355a..b5c1804 100755 (executable)
@@ -44,6 +44,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 +53,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;
@@ -156,6 +158,12 @@ 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
    */
@@ -509,6 +517,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);
@@ -518,6 +527,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);
@@ -527,6 +537,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);
@@ -535,6 +546,7 @@ public class GPreferences extends JPanel
 
     linkURLList.addListSelectionListener(new ListSelectionListener()
     {
+      @Override
       public void valueChanged(ListSelectionEvent e)
       {
         int index = linkURLList.getSelectedIndex();
@@ -544,6 +556,7 @@ public class GPreferences extends JPanel
 
     linkNameList.addListSelectionListener(new ListSelectionListener()
     {
+      @Override
       public void valueChanged(ListSelectionEvent e)
       {
         int index = linkNameList.getSelectedIndex();
@@ -571,6 +584,7 @@ public class GPreferences extends JPanel
 
     defaultBrowser.addMouseListener(new MouseAdapter()
     {
+      @Override
       public void mouseClicked(MouseEvent e)
       {
         if (e.getClickCount() > 1)
@@ -585,6 +599,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();
@@ -653,6 +668,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);
@@ -662,6 +678,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);
@@ -693,6 +710,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);
@@ -707,6 +725,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);
@@ -764,7 +783,7 @@ 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
@@ -859,13 +878,30 @@ 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();
+    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;
     PDBDocFieldPreferences docFieldPref = new PDBDocFieldPreferences(
             PreferenceSource.PREFERENCES);
-    docFieldPref.setBounds(new Rectangle(10, ypos + 5, 450, 120));
+    docFieldPref.setBounds(new Rectangle(10, ypos, 450, 120));
     structureTab.add(docFieldPref);
 
     return structureTab;
@@ -1018,6 +1054,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);
@@ -1025,6 +1062,7 @@ public class GPreferences extends JPanel
     });
     identity.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         annotations_actionPerformed(e);
@@ -1032,6 +1070,7 @@ public class GPreferences extends JPanel
     });
     showGroupConsensus.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         annotations_actionPerformed(e);
@@ -1045,6 +1084,7 @@ public class GPreferences extends JPanel
             .getString("action.show_unconserved"));
     showUnconserved.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         showunconserved_actionPerformed(e);
@@ -1112,6 +1152,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)