JAL-2808 JAL-3032 drop tabbed layout for Colours and Filters
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Jul 2018 13:27:44 +0000 (14:27 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 19 Sep 2018 11:11:54 +0000 (12:11 +0100)
src/jalview/gui/FeatureTypeSettings.java

index e13f6ee..01ef48c 100644 (file)
@@ -199,13 +199,11 @@ public class FeatureTypeSettings extends JalviewDialog
    */
   private List<FeatureMatcherI> filters;
 
-  // set white normally, black to debug layout
-  private Color debugBorderColour = Color.white;
-
   private JPanel chooseFiltersPanel;
 
-  private JTabbedPane tabbedPane;
-
+  // for alternative 2 tabs layout (Colour, Filters)
+//  private JTabbedPane tabbedPane;
+  
   /**
    * Constructor
    * 
@@ -256,7 +254,7 @@ public class FeatureTypeSettings extends JalviewDialog
     String title = MessageManager
             .formatMessage("label.display_settings_for", new String[]
             { theType });
-    initDialogFrame(this, true, blocking, title, 600, 360);
+    initDialogFrame(this, true, blocking, title, 500, 500);
 
     waitForInput();
   }
@@ -403,8 +401,8 @@ public class FeatureTypeSettings extends JalviewDialog
   private void initialise()
   {
     this.setLayout(new BorderLayout());
-    tabbedPane = new JTabbedPane();
-    this.add(tabbedPane, BorderLayout.CENTER);
+//    tabbedPane = new JTabbedPane();
+//    this.add(tabbedPane, BorderLayout.CENTER);
 
     /*
      * an ActionListener that applies colour changes
@@ -419,18 +417,20 @@ public class FeatureTypeSettings extends JalviewDialog
     };
 
     /*
-     * first tab: colour options
+     * first panel/tab: colour options
      */
     JPanel coloursPanel = initialiseColoursPanel();
-    tabbedPane.addTab(MessageManager.getString("action.colour"),
-            coloursPanel);
+//    tabbedPane.addTab(MessageManager.getString("action.colour"),
+//            coloursPanel);
+    this.add(coloursPanel, BorderLayout.NORTH);
 
     /*
-     * second tab: filter options
+     * second panel/tab: filter options
      */
     JPanel filtersPanel = initialiseFiltersPanel();
-    tabbedPane.addTab(MessageManager.getString("label.filters"),
-            filtersPanel);
+//    tabbedPane.addTab(MessageManager.getString("label.filters"),
+//            filtersPanel);
+    this.add(filtersPanel, BorderLayout.CENTER);
 
     JPanel okCancelPanel = initialiseOkCancelPanel();
 
@@ -736,15 +736,18 @@ public class FeatureTypeSettings extends JalviewDialog
   private JPanel initialiseColoursPanel()
   {
     JPanel colourByPanel = new JPanel();
+    colourByPanel.setBackground(Color.white);
     colourByPanel.setLayout(new BoxLayout(colourByPanel, BoxLayout.Y_AXIS));
+    JvSwingUtils.createTitledBorder(colourByPanel,
+            MessageManager.getString("action.colour"), true);
 
     /*
      * simple colour radio button and colour picker
      */
     JPanel simpleColourPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
     simpleColourPanel.setBackground(Color.white);
-    JvSwingUtils.createTitledBorder(simpleColourPanel,
-            MessageManager.getString("label.simple"), true);
+//    JvSwingUtils.createTitledBorder(simpleColourPanel,
+//            MessageManager.getString("label.simple"), true);
     colourByPanel.add(simpleColourPanel);
 
     simpleColour = new JRadioButton(
@@ -1188,7 +1191,6 @@ public class FeatureTypeSettings extends JalviewDialog
   {
     JPanel andOrPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
     andOrPanel.setBackground(Color.white);
-    andOrPanel.setBorder(BorderFactory.createLineBorder(debugBorderColour));
     andFilters = new JRadioButton(MessageManager.getString("label.and"));
     orFilters = new JRadioButton(MessageManager.getString("label.or"));
     ActionListener actionListener = new ActionListener()
@@ -1271,7 +1273,6 @@ public class FeatureTypeSettings extends JalviewDialog
     for (FeatureMatcherI filter : filters)
     {
       JPanel row = addFilter(filter, attNames, filterIndex);
-      row.setBorder(BorderFactory.createLineBorder(debugBorderColour));
       chooseFiltersPanel.add(row);
       filterIndex++;
     }
@@ -1712,7 +1713,7 @@ public class FeatureTypeSettings extends JalviewDialog
   public void showTab(boolean coloursTab)
   {
     setVisible(true);
-    tabbedPane.setSelectedIndex(coloursTab ? 0 : 1);
+//   tabbedPane.setSelectedIndex(coloursTab ? 0 : 1);
   }
 
   /**