From: Jim Procter Date: Mon, 2 Feb 2015 17:41:46 +0000 (+0000) Subject: JAL-1640 getters and setters for viewStyleI - note the caller needs to trigger view... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e4adc95647e64afd7af0d95a1f08348414b93030;p=jalview.git JAL-1640 getters and setters for viewStyleI - note the caller needs to trigger view repaints themselves after setting the ViewStyleI for a view --- 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); + } }