Browse Source

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
tags/7.7.0.alpha3
patrik 8 years ago
parent
commit
107c1b84d4
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java

+ 15
- 0
shared/src/main/java/com/vaadin/shared/ui/MarginInfo.java View File

@@ -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.
* <p>
* This method is for internal use by the framework.
*
* @return an integer bit mask
*/
@Deprecated
public int getBitMask() {
return bitMask;
}

Loading…
Cancel
Save