From e0149433de2baae3f8c8f52460810d71ba5dd8df 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 --- src/jalview/gui/FeatureSettings.java | 15 +++-- src/jalview/gui/FeatureTypeSettings.java | 103 +++++++++++++----------------- 2 files changed, 55 insertions(+), 63 deletions(-) diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 884f1d7..e1fa575 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -1672,13 +1672,17 @@ public class FeatureSettings extends JPanel * variable colour and filters dialog */ 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 { @@ -1790,7 +1794,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 5ee483f..8ea966a 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -105,7 +105,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 @@ -153,6 +154,11 @@ public class FeatureTypeSettings extends JalviewDialog JRadioButton graduatedColour = new JRadioButton(); + /** + * colours and filters are shown in tabbed view or single content pane + */ + JPanel coloursPanel, filtersPanel; + JPanel singleColour = new JPanel(); JPanel minColour = new JPanel(); @@ -199,9 +205,6 @@ public class FeatureTypeSettings extends JalviewDialog private JPanel chooseFiltersPanel; - // for alternative 2 tabs layout (Colour, Filters) -// private JTabbedPane tabbedPane; - /** * Constructor * @@ -399,8 +402,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 @@ -418,16 +419,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(); @@ -762,7 +759,7 @@ public class FeatureTypeSettings extends JalviewDialog } } }); - + singleColour.setFont(JvSwingUtils.getLabelFont()); singleColour.setBorder(BorderFactory.createLineBorder(Color.black)); singleColour.setPreferredSize(new Dimension(40, 20)); @@ -857,14 +854,15 @@ public class FeatureTypeSettings extends JalviewDialog colourChanged(true); } }; - JalviewColourChooser.showColourChooser(this, MessageManager.getString(key), - colourPanel.getBackground(), listener); + JalviewColourChooser.showColourChooser(this, + MessageManager.getString(key), colourPanel.getBackground(), + listener); } /** - * 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 */ @@ -1078,8 +1076,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 */ @@ -1102,11 +1100,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. @@ -1299,7 +1297,8 @@ public class FeatureTypeSettings extends JalviewDialog /** * A helper method that constructs a row (panel) with one filter condition: *