aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/ExpandLayout.java
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni.koivuviita@itmill.com>2007-12-13 10:11:49 +0000
committerJouni Koivuviita <jouni.koivuviita@itmill.com>2007-12-13 10:11:49 +0000
commitc4dbcb707ce15346c1c6e297eaa2e42bbe186d8c (patch)
tree88f7e72df4492c5c3ada45dd1d4368459ab1d300 /src/com/itmill/toolkit/ui/ExpandLayout.java
parentf5f2e1116704d9019c99e17691889f70621e6b4c (diff)
downloadvaadin-framework-c4dbcb707ce15346c1c6e297eaa2e42bbe186d8c.tar.gz
vaadin-framework-c4dbcb707ce15346c1c6e297eaa2e42bbe186d8c.zip
Major layout API changes: Sizeable is now deprecated. Use HasSize-interface instead in combination with Size object (see ExpandLayout.java for example). OrderedLayout is no longer sizable. Table and Panel implement compatibility methods to proxy old size calls to the new Size object.
svn changeset:3228/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/ExpandLayout.java')
-rw-r--r--src/com/itmill/toolkit/ui/ExpandLayout.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/com/itmill/toolkit/ui/ExpandLayout.java b/src/com/itmill/toolkit/ui/ExpandLayout.java
index dab5ee2cf1..100fac872c 100644
--- a/src/com/itmill/toolkit/ui/ExpandLayout.java
+++ b/src/com/itmill/toolkit/ui/ExpandLayout.java
@@ -6,9 +6,10 @@ package com.itmill.toolkit.ui;
import java.util.Iterator;
+import com.itmill.toolkit.terminal.HasSize;
import com.itmill.toolkit.terminal.PaintException;
import com.itmill.toolkit.terminal.PaintTarget;
-import com.itmill.toolkit.terminal.Sizeable;
+import com.itmill.toolkit.terminal.Size;
/**
* TODO finish documentation
@@ -25,12 +26,14 @@ import com.itmill.toolkit.terminal.Sizeable;
* other components don't use. Or just provide expanded container.
*
*/
-public class ExpandLayout extends OrderedLayout {
+public class ExpandLayout extends OrderedLayout implements HasSize {
private Component expanded;
+ private Size size;
public ExpandLayout() {
- setSizeFull();
+ size = new Size(this);
+ size.setSizeFull();
}
public ExpandLayout(int orientation) {
@@ -62,14 +65,7 @@ public class ExpandLayout extends OrderedLayout {
}
// Size
- if (getHeight() >= 0) {
- target.addAttribute("height", "" + getHeight()
- + Sizeable.UNIT_SYMBOLS[getHeightUnits()]);
- }
- if (getWidth() >= 0) {
- target.addAttribute("width", "" + getWidth()
- + Sizeable.UNIT_SYMBOLS[getWidthUnits()]);
- }
+ size.paint(target);
// Adds the attributes: orientation
// note that the default values (b/vertival) are omitted
@@ -137,4 +133,8 @@ public class ExpandLayout extends OrderedLayout {
}
}
+ public Size getSize() {
+ return size;
+ }
+
}