From e4adc95647e64afd7af0d95a1f08348414b93030 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 2 Feb 2015 17:41:46 +0000 Subject: [PATCH] JAL-1640 getters and setters for viewStyleI - note the caller needs to trigger view repaints themselves after setting the ViewStyleI for a view --- src/jalview/api/AlignViewportI.java | 12 ++++++++++++ src/jalview/viewmodel/AlignmentViewport.java | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index 2dea15e..5d3f89d 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -354,4 +354,16 @@ public interface AlignViewportI boolean hasHiddenRows(); + /** + * + * @return a copy of this view's current display settings + */ + public ViewStyleI getViewStyle(); + + /** + * update the view's display settings with the given style set + * + * @param settingsForView + */ + public void setViewStyle(ViewStyleI settingsForView); } diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index e8f1303..5e17e68 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -2082,4 +2082,15 @@ public abstract class AlignmentViewport implements AlignViewportI, viewStyle.setTextColour2(textColour2); } + @Override + public ViewStyleI getViewStyle() + { + return new ViewStyle(viewStyle); + } + + @Override + public void setViewStyle(ViewStyleI settingsForView) + { + viewStyle = new ViewStyle(settingsForView); + } } -- 1.7.10.2