From 107c1b84d493af79c3735745143fd9dd7740fc6f Mon Sep 17 00:00:00 2001 From: patrik Date: Tue, 17 May 2016 09:17:54 +0300 Subject: Deprecate public bitmask methods in MarginInfo (#17565) These methods are superceded by a copy constructor. getBitMask() and the bitmask constructor are used in a few places around the framework, and need to be refactored out - the MarginInfo class is already serializable and can be used in lieu of the raw bitmask in the states of these objects. Change-Id: I39a6c25f03f3a2666c057ede99e8df54f5c57958 --- shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'shared') diff --git a/shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java b/shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java index c66d1f0a11..0af3b7351f 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java +++ b/shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java @@ -49,7 +49,9 @@ public class MarginInfo implements Serializable { * * @param bitMask * bits to set + * @deprecated use other constructors instead of this one */ + @Deprecated public MarginInfo(int bitMask) { this.bitMask = bitMask; } @@ -85,6 +87,16 @@ public class MarginInfo implements Serializable { this(vertical, horizontal, vertical, horizontal); } + /** + * Creates a MarginInfo with the same values as another MarginInfo object. + * + * @param other + * another MarginInfo object + */ + public MarginInfo(MarginInfo other) { + setMargins(other); + } + /** * Enables or disables margins on all edges simultaneously. * @@ -172,9 +184,12 @@ public class MarginInfo implements Serializable { /** * Returns the current bit mask that make up the margin settings. + *

+ * This method is for internal use by the framework. * * @return an integer bit mask */ + @Deprecated public int getBitMask() { return bitMask; } -- cgit v1.2.3