From df10ae12c29d190873460d6795b2a9ad7a9fc96e Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 5 Jul 2018 14:27:44 +0100 Subject: [PATCH] JAL-2808 JAL-3032 drop tabbed layout for Colours and Filters --- src/jalview/gui/FeatureTypeSettings.java | 39 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/jalview/gui/FeatureTypeSettings.java b/src/jalview/gui/FeatureTypeSettings.java index 5169dfb..5ee483f 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -197,13 +197,11 @@ public class FeatureTypeSettings extends JalviewDialog */ List 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 * @@ -254,7 +252,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(); } @@ -401,8 +399,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 @@ -417,18 +415,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(); @@ -734,15 +734,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( @@ -1198,7 +1201,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() @@ -1286,7 +1288,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++; } @@ -1727,7 +1728,7 @@ public class FeatureTypeSettings extends JalviewDialog public void showTab(boolean coloursTab) { setVisible(true); - tabbedPane.setSelectedIndex(coloursTab ? 0 : 1); +// tabbedPane.setSelectedIndex(coloursTab ? 0 : 1); } /** -- 1.7.10.2