From 5b126eb259ecff2dce5c024066ced2528d87d39a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 5 Jul 2018 14:38:42 +0100 Subject: [PATCH] JAL-2808 JAL-3026 deleted all commented out tab code from the dialog Omitted dialog refactoring from JAL-3058 --- src/jalview/gui/FeatureSettings.java | 16 ++--- src/jalview/gui/FeatureTypeSettings.java | 97 +++++++++++++----------------- 2 files changed, 51 insertions(+), 62 deletions(-) diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 78c1cac..1358c8f 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -1665,14 +1665,17 @@ public class FeatureSettings extends JPanel { // bring up graduated chooser. chooser = new FeatureTypeSettings(me.fr, type); - chooser.setRequestFocusEnabled(true); - chooser.requestFocus(); + /** + * @j2sNative + */ + { + chooser.setRequestFocusEnabled(true); + chooser.requestFocus(); + } chooser.addActionListener(this); - chooser.showTab(true); + // Make the renderer reappear. + fireEditingStopped(); } - // Make the renderer reappear. - fireEditingStopped(); - } else { @@ -1794,7 +1797,6 @@ public class FeatureSettings extends JPanel chooser.getWidth(), chooser.getHeight()); chooser.validate(); } - chooser.showTab(false); fireEditingStopped(); } else if (e.getSource() instanceof Component) diff --git a/src/jalview/gui/FeatureTypeSettings.java b/src/jalview/gui/FeatureTypeSettings.java index 01ef48c..c572798 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -62,7 +62,6 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JSlider; -import javax.swing.JTabbedPane; import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.border.LineBorder; @@ -107,7 +106,8 @@ public class FeatureTypeSettings extends JalviewDialog /* * FeatureRenderer holds colour scheme and filters for feature types */ - private final FeatureRenderer fr; // todo refactor to allow interface type here + private final FeatureRenderer fr; // todo refactor to allow interface type + // here /* * the view panel to update when settings change @@ -155,7 +155,12 @@ public class FeatureTypeSettings extends JalviewDialog private JRadioButton graduatedColour = new JRadioButton(); - private JPanel singleColour = new JPanel(); + /** + * colours and filters are shown in tabbed view or single content pane + */ + JPanel coloursPanel, filtersPanel; + + JPanel singleColour = new JPanel(); private JPanel minColour = new JPanel(); @@ -201,9 +206,6 @@ public class FeatureTypeSettings extends JalviewDialog private JPanel chooseFiltersPanel; - // for alternative 2 tabs layout (Colour, Filters) -// private JTabbedPane tabbedPane; - /** * Constructor * @@ -401,8 +403,6 @@ public class FeatureTypeSettings extends JalviewDialog private void initialise() { this.setLayout(new BorderLayout()); -// tabbedPane = new JTabbedPane(); -// this.add(tabbedPane, BorderLayout.CENTER); /* * an ActionListener that applies colour changes @@ -420,16 +420,12 @@ public class FeatureTypeSettings extends JalviewDialog * first panel/tab: colour options */ JPanel coloursPanel = initialiseColoursPanel(); -// tabbedPane.addTab(MessageManager.getString("action.colour"), -// coloursPanel); this.add(coloursPanel, BorderLayout.NORTH); /* * second panel/tab: filter options */ JPanel filtersPanel = initialiseFiltersPanel(); -// tabbedPane.addTab(MessageManager.getString("label.filters"), -// filtersPanel); this.add(filtersPanel, BorderLayout.CENTER); JPanel okCancelPanel = initialiseOkCancelPanel(); @@ -765,7 +761,7 @@ public class FeatureTypeSettings extends JalviewDialog } }); - + singleColour.setFont(JvSwingUtils.getLabelFont()); singleColour.setBorder(BorderFactory.createLineBorder(Color.black)); singleColour.setPreferredSize(new Dimension(40, 20)); @@ -852,9 +848,9 @@ public class FeatureTypeSettings extends JalviewDialog } /** - * Constructs and sets the selected colour options as the colour for the feature - * type, and repaints the alignment, and optionally the Overview and/or - * structure viewer if open + * Constructs and sets the selected colour options as the colour for the + * feature type, and repaints the alignment, and optionally the Overview + * and/or structure viewer if open * * @param updateStructsAndOverview */ @@ -1068,8 +1064,8 @@ public class FeatureTypeSettings extends JalviewDialog /** * Converts the slider value to its absolute value by dividing by the - * scaleFactor. Rounding errors are squashed by forcing min/max of slider range - * to the actual min/max of feature score range + * scaleFactor. Rounding errors are squashed by forcing min/max of slider + * range to the actual min/max of feature score range * * @return */ @@ -1092,11 +1088,11 @@ public class FeatureTypeSettings extends JalviewDialog } /** - * A helper method to build the drop-down choice of attributes for a feature. If - * 'withRange' is true, then Score, and any attributes with a min-max range, are - * added. If 'withText' is true, Label and any known attributes are added. This - * allows 'categorical numerical' attributes e.g. codon position to be coloured - * by text. + * A helper method to build the drop-down choice of attributes for a feature. + * If 'withRange' is true, then Score, and any attributes with a min-max + * range, are added. If 'withText' is true, Label and any known attributes are + * added. This allows 'categorical numerical' attributes e.g. codon position + * to be coloured by text. *

* Where metadata is available with a description for an attribute, that is * added as a tooltip. @@ -1284,7 +1280,8 @@ public class FeatureTypeSettings extends JalviewDialog /** * A helper method that constructs a row (panel) with one filter condition: *