diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/ui/AbstractLayoutState.java | 9 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/MarginInfo.java (renamed from shared/src/com/vaadin/shared/ui/VMarginInfo.java) | 17 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java | 9 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java | 10 |
4 files changed, 29 insertions, 16 deletions
diff --git a/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java b/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java index 675d11d0b7..4fc865626c 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java @@ -18,14 +18,5 @@ package com.vaadin.shared.ui; import com.vaadin.shared.ComponentState; public class AbstractLayoutState extends ComponentState { - private int marginsBitmask; - - public int getMarginsBitmask() { - return marginsBitmask; - } - - public void setMarginsBitmask(int marginsBitmask) { - this.marginsBitmask = marginsBitmask; - } }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/VMarginInfo.java b/shared/src/com/vaadin/shared/ui/MarginInfo.java index 9e9e0a4bb4..21e52f258a 100644 --- a/shared/src/com/vaadin/shared/ui/VMarginInfo.java +++ b/shared/src/com/vaadin/shared/ui/MarginInfo.java @@ -18,8 +18,7 @@ package com.vaadin.shared.ui; import java.io.Serializable; -@SuppressWarnings("serial") -public class VMarginInfo implements Serializable { +public class MarginInfo implements Serializable { private static final int TOP = 1; private static final int RIGHT = 2; @@ -28,11 +27,15 @@ public class VMarginInfo implements Serializable { private int bitMask; - public VMarginInfo(int bitMask) { + public MarginInfo(boolean enabled) { + this(enabled, enabled, enabled, enabled); + } + + public MarginInfo(int bitMask) { this.bitMask = bitMask; } - public VMarginInfo(boolean top, boolean right, boolean bottom, boolean left) { + public MarginInfo(boolean top, boolean right, boolean bottom, boolean left) { setMargins(top, right, bottom, left); } @@ -44,7 +47,7 @@ public class VMarginInfo implements Serializable { bitMask += left ? LEFT : 0; } - public void setMargins(VMarginInfo marginInfo) { + public void setMargins(MarginInfo marginInfo) { bitMask = marginInfo.bitMask; } @@ -78,11 +81,11 @@ public class VMarginInfo implements Serializable { @Override public boolean equals(Object obj) { - if (!(obj instanceof VMarginInfo)) { + if (!(obj instanceof MarginInfo)) { return false; } - return ((VMarginInfo) obj).bitMask == bitMask; + return ((MarginInfo) obj).bitMask == bitMask; } @Override diff --git a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java index d2e685d8cb..381a6a7f85 100644 --- a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java @@ -21,6 +21,7 @@ public class GridLayoutState extends AbstractLayoutState { private boolean spacing = false; private int rows = 0; private int columns = 0; + private int marginsBitmask = 0; public boolean isSpacing() { return spacing; @@ -30,6 +31,14 @@ public class GridLayoutState extends AbstractLayoutState { this.spacing = spacing; } + public int getMarginsBitmask() { + return marginsBitmask; + } + + public void setMarginsBitmask(int marginsBitmask) { + this.marginsBitmask = marginsBitmask; + } + public int getRows() { return rows; } diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java index 235c9eab13..3fa2ad771c 100644 --- a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java @@ -27,6 +27,8 @@ public class AbstractOrderedLayoutState extends AbstractLayoutState { public HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>(); + private int marginsBitmask = 0; + public static class ChildComponentData implements Serializable { private int alignmentBitmask = AlignmentInfo.TOP_LEFT.getBitMask(); private float expandRatio = 0.0f; @@ -65,4 +67,12 @@ public class AbstractOrderedLayoutState extends AbstractLayoutState { this.spacing = spacing; } + public int getMarginsBitmask() { + return marginsBitmask; + } + + public void setMarginsBitmask(int marginsBitmask) { + this.marginsBitmask = marginsBitmask; + } + }
\ No newline at end of file |