From: gmungoc Date: Mon, 18 Feb 2019 09:19:14 +0000 (+0000) Subject: JAL-3187 reset ViewStyle on Cancel in FeatureSettings X-Git-Tag: Release_2_11_1_0~61 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c6066cc80c98e75fd124209521845a0d8ac8b0b0;p=jalview.git JAL-3187 reset ViewStyle on Cancel in FeatureSettings --- diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 9dbeb8a..47c0cc5 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -23,6 +23,7 @@ package jalview.gui; import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.api.FeatureSettingsControllerI; +import jalview.api.ViewStyleI; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; import jalview.datamodel.features.FeatureMatcherI; @@ -35,6 +36,7 @@ import jalview.schemes.FeatureColour; import jalview.util.MessageManager; import jalview.util.Platform; import jalview.viewmodel.seqfeatures.FeatureRendererModel.FeatureSettingsBean; +import jalview.viewmodel.styles.ViewStyle; import jalview.xml.binding.jalview.JalviewUserColours; import jalview.xml.binding.jalview.JalviewUserColours.Colour; import jalview.xml.binding.jalview.JalviewUserColours.Filter; @@ -140,6 +142,8 @@ public class FeatureSettings extends JPanel private float originalTransparency; + private ViewStyleI originalViewStyle; + private Map originalFilters; final JInternalFrame frame; @@ -197,6 +201,7 @@ public class FeatureSettings extends JPanel transparency.setMaximum(100 - originalTransparencyAsPercent); originalFilters = new HashMap<>(fr.getFeatureFilters()); // shallow copy + originalViewStyle = new ViewStyle(af.viewport.getViewStyle()); try { @@ -1207,6 +1212,7 @@ public class FeatureSettings extends JPanel fr.setTransparency(originalTransparency); fr.setFeatureFilters(originalFilters); updateFeatureRenderer(originalData); + af.getViewport().setViewStyle(originalViewStyle); close(); } }); diff --git a/src/jalview/viewmodel/styles/ViewStyle.java b/src/jalview/viewmodel/styles/ViewStyle.java index 7fa1e39..91f2f0c 100644 --- a/src/jalview/viewmodel/styles/ViewStyle.java +++ b/src/jalview/viewmodel/styles/ViewStyle.java @@ -214,6 +214,7 @@ public class ViewStyle implements ViewStyleI setShowSequenceFeaturesHeight(vs.isShowSequenceFeaturesHeight()); setShowSequenceFeatures(vs.isShowSequenceFeatures()); setShowComplementFeatures(vs.isShowComplementFeatures()); + setShowComplementFeaturesOnTop(vs.isShowComplementFeaturesOnTop()); setShowText(vs.getShowText()); setShowUnconserved(vs.getShowUnconserved()); setTextColour(vs.getTextColour()); @@ -277,6 +278,8 @@ public class ViewStyle implements ViewStyleI .isShowSequenceFeaturesHeight() && isShowSequenceFeatures() == vs.isShowSequenceFeatures() && isShowComplementFeatures() == vs.isShowComplementFeatures() + && isShowComplementFeaturesOnTop() == vs + .isShowComplementFeaturesOnTop() && getShowText() == vs.getShowText() && getShowUnconserved() == vs.getShowUnconserved() && getThreshold() == vs.getThreshold()