X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureTypeSettings.java;h=b3e6917354fecc9e87ddde3122f72d2edebff219;hb=ccc53e88e3260886f5d3bdacc619c0f374be9b8f;hp=aaf81acf6071091a7479141bb0f69b809a2668ca;hpb=a1984b1c8c273ed33c7ce9283039f4027dcae2de;p=jalview.git diff --git a/src/jalview/gui/FeatureTypeSettings.java b/src/jalview/gui/FeatureTypeSettings.java index aaf81ac..b3e6917 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -23,7 +23,7 @@ package jalview.gui; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; import jalview.api.FeatureColourI; -import jalview.bin.Cache; +import jalview.bin.Console; import jalview.datamodel.GraphLine; import jalview.datamodel.features.FeatureAttributes; import jalview.datamodel.features.FeatureAttributes.Datatype; @@ -155,7 +155,7 @@ public class FeatureTypeSettings extends JalviewDialog JRadioButton graduatedColour = new JRadioButton(); JPanel coloursPanel; - + JPanel filtersPanel; JPanel singleColour = new JPanel(); @@ -204,22 +204,27 @@ public class FeatureTypeSettings extends JalviewDialog private JPanel chooseFiltersPanel; + public boolean originalDisplay; + /** * Constructor * * @param frender * @param theType + * @param last + * - visibility of feature prior to adjustment */ - public FeatureTypeSettings(FeatureRenderer frender, String theType) + public FeatureTypeSettings(FeatureRenderer frender, String theType, + boolean last) { this.fr = frender; this.featureType = theType; ap = fr.ap; originalFilter = fr.getFeatureFilter(theType); originalColour = fr.getFeatureColours().get(theType); - + originalDisplay = last; adjusting = true; - + try { initialise(); @@ -228,15 +233,15 @@ public class FeatureTypeSettings extends JalviewDialog ex.printStackTrace(); return; } - + updateColoursPanel(); - + updateFiltersPanel(); - + adjusting = false; - + colourChanged(false); - + String title = MessageManager .formatMessage("label.display_settings_for", new String[] { theType }); @@ -245,8 +250,8 @@ public class FeatureTypeSettings extends JalviewDialog } /** - * Configures the widgets on the Colours panel according to the current feature - * colour scheme + * Configures the widgets on the Colours panel according to the current + * feature colour scheme */ private void updateColoursPanel() { @@ -537,7 +542,8 @@ public class FeatureTypeSettings extends JalviewDialog { if (minColour.isEnabled()) { - String ttl = MessageManager.getString("label.select_colour_minimum_value"); + String ttl = MessageManager + .getString("label.select_colour_minimum_value"); showColourChooser(minColour, ttl); } } @@ -554,7 +560,8 @@ public class FeatureTypeSettings extends JalviewDialog { if (maxColour.isEnabled()) { - String ttl = MessageManager.getString("label.select_colour_maximum_value"); + String ttl = MessageManager + .getString("label.select_colour_maximum_value"); showColourChooser(maxColour, ttl); } } @@ -762,8 +769,8 @@ public class FeatureTypeSettings extends JalviewDialog // } // else // { - singleColour.setBackground(originalColour.getColour()); - singleColour.setForeground(originalColour.getColour()); + singleColour.setBackground(originalColour.getColour()); + singleColour.setForeground(originalColour.getColour()); // } singleColour.addMouseListener(new MouseAdapter() { @@ -772,7 +779,8 @@ public class FeatureTypeSettings extends JalviewDialog { if (simpleColour.isSelected()) { - String ttl = MessageManager.formatMessage("label.select_colour_for", featureType); + String ttl = MessageManager + .formatMessage("label.select_colour_for", featureType); showColourChooser(singleColour, ttl); } } @@ -857,8 +865,8 @@ public class FeatureTypeSettings extends JalviewDialog colourChanged(true); } }; - JalviewColourChooser.showColourChooser(this, title, - colourPanel.getBackground(), listener); + JalviewColourChooser.showColourChooser(this, title, + colourPanel.getBackground(), listener); } /** @@ -1029,6 +1037,10 @@ public class FeatureTypeSettings extends JalviewDialog { fr.setColour(featureType, originalColour); fr.setFeatureFilter(featureType, originalFilter); + if (!originalDisplay) + { + fr.getFeaturesDisplayed().setHidden(featureType); + } refreshDisplay(true); } @@ -1045,7 +1057,7 @@ public class FeatureTypeSettings extends JalviewDialog */ adjusting = true; float f = Float.parseFloat(thresholdValue.getText()); - f = Float.max(f, this.min); + f = Float.max(f, this.min); f = Float.min(f, this.max); setThresholdValueText(f); slider.setSliderValue(f); @@ -1061,7 +1073,8 @@ public class FeatureTypeSettings extends JalviewDialog } /** - * Sets the text field for threshold value, rounded to four significant figures + * Sets the text field for threshold value, rounded to four significant + * figures * * @param f */ @@ -1092,7 +1105,7 @@ public class FeatureTypeSettings extends JalviewDialog { if (featureSettings != null) { - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION ISSUE: overwriting action listener for FeatureColourChooser"); } featureSettings = listener; @@ -1160,7 +1173,7 @@ public class FeatureTypeSettings extends JalviewDialog List displayAttsObjects = new ArrayList<>(displayAtts); JComboBox attCombo = JvSwingUtils .buildComboWithTooltips(displayAttsObjects, tooltips); - + return attCombo; } @@ -1696,7 +1709,7 @@ public class FeatureTypeSettings extends JalviewDialog attName = (String) attCombo.getSelectedItem(); } catch (Exception e) { - Cache.error("Problem casting Combo box entry to String"); + Console.error("Problem casting Combo box entry to String"); attName = attCombo.getSelectedItem().toString(); } Condition cond = (Condition) condCombo.getSelectedItem();