diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2010-05-19 12:35:06 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2010-05-19 12:35:06 +0000 |
commit | 79fc6377d2df1616b10a780b2f7886928cd18663 (patch) | |
tree | 03a8406e109ae49d785696e6b0b62d261f5ef939 | |
parent | cea1358018fc4c51cbbf1fbe3b66a013874ecb27 (diff) | |
download | vaadin-framework-79fc6377d2df1616b10a780b2f7886928cd18663.tar.gz vaadin-framework-79fc6377d2df1616b10a780b2f7886928cd18663.zip |
Fix for #4479
svn changeset:13258/svn branch:6.3
-rw-r--r-- | src/com/vaadin/ui/AbsoluteLayout.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java index b2f0f5539f..c3d6168426 100644 --- a/src/com/vaadin/ui/AbsoluteLayout.java +++ b/src/com/vaadin/ui/AbsoluteLayout.java @@ -83,10 +83,10 @@ public class AbsoluteLayout extends AbstractLayout { public class ComponentPosition implements Serializable { private int zIndex = -1; - private float topValue = -1; - private float rightValue = -1; - private float bottomValue = -1; - private float leftValue = -1; + private Float topValue = null; + private Float rightValue = null; + private Float bottomValue = null; + private Float leftValue = null; private int topUnits; private int rightUnits; @@ -119,7 +119,7 @@ public class AbsoluteLayout extends AbstractLayout { } else { value = ""; } - String unit = value.replaceAll("[0-9\\.]+", ""); + String unit = value.replaceAll("[0-9\\.\\-]+", ""); if (!unit.equals("")) { value = value.substring(0, value.indexOf(unit)).trim(); } @@ -154,16 +154,16 @@ public class AbsoluteLayout extends AbstractLayout { public String getCSSString() { String s = ""; - if (topValue >= 0) { + if (topValue != null) { s += "top:" + topValue + UNIT_SYMBOLS[topUnits] + ";"; } - if (rightValue >= 0) { + if (rightValue != null) { s += "right:" + rightValue + UNIT_SYMBOLS[rightUnits] + ";"; } - if (bottomValue >= 0) { + if (bottomValue != null) { s += "bottom:" + bottomValue + UNIT_SYMBOLS[bottomUnits] + ";"; } - if (leftValue >= 0) { + if (leftValue != null) { s += "left:" + leftValue + UNIT_SYMBOLS[leftUnits] + ";"; } if (zIndex >= 0) { @@ -212,14 +212,14 @@ public class AbsoluteLayout extends AbstractLayout { } public float getTopValue() { - return topValue; + return topValue == null ? 0 : rightValue.floatValue(); } /** * @return the rightValue */ public float getRightValue() { - return rightValue; + return rightValue == null ? 0 : rightValue.floatValue(); } /** @@ -236,7 +236,7 @@ public class AbsoluteLayout extends AbstractLayout { * @return the bottomValue */ public float getBottomValue() { - return bottomValue; + return bottomValue == null ? 0 : bottomValue.floatValue(); } /** @@ -253,7 +253,7 @@ public class AbsoluteLayout extends AbstractLayout { * @return the leftValue */ public float getLeftValue() { - return leftValue; + return leftValue == null ? 0 : leftValue.floatValue(); } /** |