]> source.dussan.org Git - vaadin-framework.git/commitdiff
component implements sizeable and simple general terminal implementation
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 28 Jan 2008 10:22:16 +0000 (10:22 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 28 Jan 2008 10:22:16 +0000 (10:22 +0000)
svn changeset:3662/svn branch:trunk

60 files changed:
src/com/itmill/toolkit/demo/BrowserDemo.java
src/com/itmill/toolkit/demo/LayoutDemo.java
src/com/itmill/toolkit/demo/NativeWindowing.java
src/com/itmill/toolkit/demo/Parameters.java
src/com/itmill/toolkit/demo/TreeFilesystem.java
src/com/itmill/toolkit/demo/TreeFilesystemContainer.java
src/com/itmill/toolkit/demo/WindowedDemos.java
src/com/itmill/toolkit/demo/featurebrowser/EmbeddedBrowserExample.java
src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java
src/com/itmill/toolkit/demo/featurebrowser/TableExample.java
src/com/itmill/toolkit/demo/featurebrowser/TreeExample.java
src/com/itmill/toolkit/demo/reservation/ReservationApplication.java
src/com/itmill/toolkit/terminal/HasSize.java [deleted file]
src/com/itmill/toolkit/terminal/Size.java [deleted file]
src/com/itmill/toolkit/terminal/Sizeable.java
src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IExpandLayout.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IPanel.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ISplitPanel.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheet.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ITabsheetBase.java
src/com/itmill/toolkit/tests/BasicRandomTest.java
src/com/itmill/toolkit/tests/RandomLayoutStress.java
src/com/itmill/toolkit/tests/TableChangingDatasource.java
src/com/itmill/toolkit/tests/TestBench.java
src/com/itmill/toolkit/tests/TestComponentsAndLayouts.java
src/com/itmill/toolkit/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
src/com/itmill/toolkit/tests/TestForBasicApplicationLayout.java
src/com/itmill/toolkit/tests/TestForContainerFilterable.java
src/com/itmill/toolkit/tests/TestForExpandLayout.java
src/com/itmill/toolkit/tests/TestForExpandLayout2.java
src/com/itmill/toolkit/tests/TestForExpandLayout3.java
src/com/itmill/toolkit/tests/TestForNativeWindowing.java
src/com/itmill/toolkit/tests/TestForPreconfiguredComponents.java
src/com/itmill/toolkit/tests/TestForTablesInitialColumnWidthLogicRendering.java
src/com/itmill/toolkit/tests/TestForTrees.java
src/com/itmill/toolkit/tests/TestForUpload.java
src/com/itmill/toolkit/tests/featurebrowser/Feature.java
src/com/itmill/toolkit/tests/featurebrowser/FeatureEmbedded.java
src/com/itmill/toolkit/tests/featurebrowser/FeatureWindow.java
src/com/itmill/toolkit/tests/featurebrowser/PropertyPanel.java
src/com/itmill/toolkit/tests/magi/MagiTestApplication.java
src/com/itmill/toolkit/tests/testbench/TestBench.java
src/com/itmill/toolkit/tests/testbench/TestForBasicApplicationLayout.java
src/com/itmill/toolkit/tests/testbench/TestForContainerFilterable.java
src/com/itmill/toolkit/tests/testbench/TestForPreconfiguredComponents.java
src/com/itmill/toolkit/tests/testbench/TestForTrees.java
src/com/itmill/toolkit/ui/AbstractComponent.java
src/com/itmill/toolkit/ui/Component.java
src/com/itmill/toolkit/ui/CustomComponent.java
src/com/itmill/toolkit/ui/CustomLayout.java
src/com/itmill/toolkit/ui/Embedded.java
src/com/itmill/toolkit/ui/ExpandLayout.java
src/com/itmill/toolkit/ui/GridLayout.java
src/com/itmill/toolkit/ui/Panel.java
src/com/itmill/toolkit/ui/SplitPanel.java
src/com/itmill/toolkit/ui/TabSheet.java
src/com/itmill/toolkit/ui/Table.java

index e4b70b2bee7aff856ede9ac9c719381a9c8d5521..13d4bc5d0c005f97ff959e1d7758acff822cb6e0 100644 (file)
@@ -37,7 +37,7 @@ public class BrowserDemo extends com.itmill.toolkit.Application implements
         // possible.
         final ExpandLayout exl = new ExpandLayout();
         browser.setLayout(exl);
-        exl.getSize().setSizeFull();
+        exl.setSizeFull();
 
         // create the address combobox
         final Select select = new Select();
index 0704a22dcd7a34f802600705c3880a6af3cacc28..a3a671dffe3eb6aee20be4e4075252674cedeea9 100644 (file)
@@ -127,7 +127,7 @@ public class LayoutDemo extends com.itmill.toolkit.Application {
                                 + " Panel contains an layout where the actual contained components are added, "
                                 + "this layout may be switched on the fly.",
                         Label.CONTENT_XHTML));
-        panel.getSize().setWidth(222);
+        panel.setWidth(222);
         return panel;
     }
 
index 4d98203cdc41afee64ae55065921086e334bca49..7dadd7c4bb0aea0062810de62fd213d701258c3a 100644 (file)
@@ -29,11 +29,11 @@ public class NativeWindowing extends Application {
                         main.addWindow(w);
                         w.setPositionX(100);
                         w.setPositionY(100);
-                        w.getSize().setWidth(200);
-                        w.getSize().setHeight(200);
+                        w.setWidth(200);
+                        w.setHeight(200);
 
-                        w.getSize().setWidth(100);
-                        w.getSize().setHeight(400);
+                        w.setWidth(100);
+                        w.setHeight(400);
 
                         final Button closebutton = new Button("Close "
                                 + w.getCaption(), new Button.ClickListener() {
index 65e203c729a65e01dcc735aaacc15b5c2903e476..5c306b64615ad22660b737265ce659d187442c7e 100644 (file)
@@ -73,7 +73,7 @@ public class Parameters extends com.itmill.toolkit.Application implements
         params.addContainerProperty("Key", String.class, "");
         params.addContainerProperty("Value", String.class, "");
         final Panel panel2 = new Panel("Parameter Handler");
-        params.getSize().setSizeFull();
+        params.setSizeFull();
         panel2.setLayout(new ExpandLayout());
         panel2.getLayout().setMargin(true);
 
index 79f7c3624de7ec1f88caf78acf721e9e9f49dc93..7fa1f3a1f4f8c0636bfb4f3972cfdba1e5171297 100644 (file)
@@ -42,7 +42,7 @@ public class TreeFilesystem extends com.itmill.toolkit.Application implements
         // configure file structure panel
         main.addComponent(explorerPanel);
         explorerPanel.addComponent(tree);
-        explorerPanel.getSize().setHeight(400);
+        explorerPanel.setHeight(400);
 
         // "this" handles tree's expand event
         tree.addListener(this);
index 972af336b930efdf1238fe87e1c48719d36ea86f..efff2932f6d68f87d281cb9d504f3082d8799248 100644 (file)
@@ -9,7 +9,6 @@ import java.io.File;
 import com.itmill.toolkit.data.util.FilesystemContainer;
 import com.itmill.toolkit.data.util.FilesystemContainer.FileItem;
 import com.itmill.toolkit.demo.util.SampleDirectory;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.ui.ExpandLayout;
 import com.itmill.toolkit.ui.Field;
 import com.itmill.toolkit.ui.Label;
@@ -51,10 +50,10 @@ public class TreeFilesystemContainer extends com.itmill.toolkit.Application
         main.setMargin(true);
         main.setSpacing(true);
 
-        propertyPanel.getSize().setHeight(120);
+        propertyPanel.setHeight(120);
         main.addComponent(propertyPanel);
-        explorerPanel.getSize().setHeight(100);
-        explorerPanel.getSize().setHeightUnits(Size.UNITS_PERCENTAGE);
+        explorerPanel.setHeight(100);
+        explorerPanel.setHeightUnits(Panel.UNITS_PERCENTAGE);
         main.addComponent(explorerPanel);
         main.expand(explorerPanel);
 
index f0102ac110760e9ef73e1cd0e37147a1d4963c02..6ec59bf629aae336cacf2830c06cf11d9d599978 100644 (file)
@@ -45,8 +45,8 @@ public class WindowedDemos extends com.itmill.toolkit.Application {
 
         // Create menu window.
         final Window menu = new Window("Select demo");
-        menu.getSize().setWidth(200);
-        menu.getSize().setHeight(400);
+        menu.setWidth(200);
+        menu.setHeight(400);
         main.addWindow(menu); // add to layout
 
         // Create a menu button for each demo
@@ -75,8 +75,8 @@ public class WindowedDemos extends com.itmill.toolkit.Application {
         Window w = (Window) windows.get(demoName);
         if (w == null) {
             w = new Window(demoName);
-            w.getSize().setWidth(520);
-            w.getSize().setHeight(500);
+            w.setWidth(520);
+            w.setHeight(500);
             w.setPositionX(202);
             windows.put(demoName, w);
             getMainWindow().addWindow(w);
index d592be5b537a0eca686cc52bcbc6e3c11148b223..7391fc135ecdf4db9a4632a9562e30a591f0128a 100644 (file)
@@ -34,7 +34,7 @@ public class EmbeddedBrowserExample extends ExpandLayout implements
     }
 
     public EmbeddedBrowserExample(String[] urls) {
-        getSize().setSizeFull();
+        setSizeFull();
 
         // create the address combobox
         final Select select = new Select();
index c1989d597a26c0a4b52bc1b9cad45cc146832513..14f7ab0442e913aac84e64ea5327d32cad356105 100644 (file)
@@ -12,7 +12,6 @@ import com.itmill.toolkit.data.Property.ValueChangeEvent;
 import com.itmill.toolkit.data.util.HierarchicalContainer;
 import com.itmill.toolkit.data.util.IndexedContainer;
 import com.itmill.toolkit.terminal.ExternalResource;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.terminal.ThemeResource;
 import com.itmill.toolkit.ui.AbstractSelect;
 import com.itmill.toolkit.ui.Button;
@@ -118,7 +117,7 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements
 
         final SplitPanel split = new SplitPanel(
                 SplitPanel.ORIENTATION_HORIZONTAL);
-        split.setSplitPosition(200, Size.UNITS_PIXELS);
+        split.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
         main.setLayout(split);
 
         final HashMap sectionIds = new HashMap();
@@ -162,12 +161,12 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements
         split.addComponent(tree);
 
         final SplitPanel split2 = new SplitPanel();
-        split2.setSplitPosition(200, Size.UNITS_PIXELS);
+        split2.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
         split.addComponent(split2);
 
         table = new Table();
         table.setDebugId("FeatureBrowser: Main Table");
-        table.getSize().setSizeFull();
+        table.setSizeFull();
         table.setColumnReorderingAllowed(true);
         table.setColumnCollapsingAllowed(true);
         table.setSelectable(true);
@@ -203,7 +202,7 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements
                     return;
                 }
                 Window w = new Window(caption);
-                w.getSize().setWidth(640);
+                w.setWidth(640);
                 if (Layout.class.isAssignableFrom(component.getClass())) {
                     w.setLayout((Layout) component);
                 } else {
@@ -250,7 +249,7 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements
                 OrderedLayout.ALIGNMENT_TOP);
 
         ts = new TabSheet();
-        ts.getSize().setSizeFull();
+        ts.setSizeFull();
         ts.addTab(new Label(""), "Choose example", null);
         exp.addComponent(ts);
         exp.expand(ts);
index dc0c2254676754f194a451fbb836aa054fe09772..4b3e1b758e2251189e905118e49d03fb7fb2c66e 100644 (file)
@@ -58,7 +58,7 @@ public class TableExample extends CustomComponent implements Action.Handler,
         // "source" table with bells & whistlesenabled\r
         source = new Table("All creatures");\r
         source.setPageLength(7);\r
-        source.getSize().setWidth(550);\r
+        source.setWidth(550);\r
         source.setColumnCollapsingAllowed(true);\r
         source.setColumnReorderingAllowed(true);\r
         source.setSelectable(true);\r
@@ -102,7 +102,7 @@ public class TableExample extends CustomComponent implements Action.Handler,
         // "saved" table, minimalistic\r
         saved = new Table("Saved creatures");\r
         saved.setPageLength(5);\r
-        saved.getSize().setWidth(550);\r
+        saved.setWidth(550);\r
         saved.setSelectable(false);\r
         saved.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);\r
         saved.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);\r
index fb9f0a34ffc9ff17531d5f7ad95e2f17db6f2800..694c839fb46b7b7a61b84a597fefd7ada3732de4 100644 (file)
@@ -45,7 +45,7 @@ public class TreeExample extends CustomComponent implements Action.Handler,
         // Panel w/ Tree
         Panel p = new Panel("Select item");
         p.setStyleName(Panel.STYLE_LIGHT);
-        p.getSize().setWidth(250);
+        p.setWidth(250);
         // Description
         p.addComponent(new Label(desc));
         // Tree with a few items
index d53c7fd1d117fd53ee8d9261497efba2815eea90..58264f4da480e72368275164ad5839b5cd2ebe44 100644 (file)
@@ -176,8 +176,8 @@ public class ReservationApplication extends Application {
         allLayout.setMargin(true);\r
 \r
         allTable = new Table();\r
-        allTable.getSize().setHeight(300);\r
-        allTable.getSize().setWidth(700);\r
+        allTable.setHeight(300);\r
+        allTable.setWidth(700);\r
         allTable.setColumnCollapsingAllowed(true);\r
         allTable.setColumnReorderingAllowed(true);\r
         allLayout.addComponent(allTable);\r
diff --git a/src/com/itmill/toolkit/terminal/HasSize.java b/src/com/itmill/toolkit/terminal/HasSize.java
deleted file mode 100644 (file)
index d740924..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.itmill.toolkit.terminal;
-
-public interface HasSize {
-    
-    public Size getSize();
-
-}
diff --git a/src/com/itmill/toolkit/terminal/Size.java b/src/com/itmill/toolkit/terminal/Size.java
deleted file mode 100644 (file)
index c8af640..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-package com.itmill.toolkit.terminal;
-
-import com.itmill.toolkit.ui.Component;
-
-public class Size {
-
-    private Component component;
-    private int width;
-    private int height;
-    private int widthUnit;
-    private int heightUnit;
-
-    /**
-     * Unit code representing pixels.
-     */
-    public static final int UNITS_PIXELS = 0;
-
-    /**
-     * Unit code representing points (1/72nd of an inch).
-     */
-    public static final int UNITS_POINTS = 1;
-
-    /**
-     * Unit code representing picas (12 points).
-     */
-    public static final int UNITS_PICAS = 2;
-
-    /**
-     * Unit code representing the font-size of the relevant font.
-     */
-    public static final int UNITS_EM = 3;
-
-    /**
-     * Unit code representing the x-height of the relevant font.
-     */
-    public static final int UNITS_EX = 4;
-
-    /**
-     * Unit code representing millimeters.
-     */
-    public static final int UNITS_MM = 5;
-
-    /**
-     * Unit code representing centimeters.
-     */
-    public static final int UNITS_CM = 6;
-
-    /**
-     * Unit code representing inches.
-     */
-    public static final int UNITS_INCH = 7;
-
-    /**
-     * Unit code representing in percentage of the containing element defined by
-     * terminal.
-     */
-    public static final int UNITS_PERCENTAGE = 8;
-
-    /**
-     * Unit code representing in rows of text. This unit is only applicable to
-     * some components can it's meaning is specified by component
-     * implementation.
-     */
-    public static final int UNITS_ROWS = 9;
-
-    /**
-     * Textual representations of units symbols. Supported units and their
-     * symbols are:
-     * <ul>
-     * <li><code>UNITS_PIXELS</code>: "px"</li>
-     * <li><code>UNITS_POINTS</code>: "pt"</li>
-     * <li><code>UNITS_PICAS</code>: "pc"</li>
-     * <li><code>UNITS_EM</code>: "em"</li>
-     * <li><code>UNITS_EX</code>: "ex"</li>
-     * <li><code>UNITS_MM</code>: "mm"</li>
-     * <li><code>UNITS_CM</code>. "cm"</li>
-     * <li><code>UNITS_INCH</code>: "in"</li>
-     * <li><code>UNITS_PERCENTAGE</code>: "%"</li>
-     * <li><code>UNITS_ROWS</code>: "rows"</li>
-     * </ul>
-     * These can be used like <code>Size.UNIT_SYMBOLS[UNITS_PIXELS]</code>.
-     */
-    public static final String[] UNIT_SYMBOLS = { "px", "pt", "pc", "em", "ex",
-            "mm", "cm", "in", "%", "rows" };
-
-    public Size(Component c) {
-        component = c;
-        width = -1;
-        height = -1;
-        widthUnit = UNITS_PIXELS;
-        heightUnit = UNITS_PIXELS;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#getHeight()
-     */
-    public int getHeight() {
-        return height;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#getHeightUnits()
-     */
-    public int getHeightUnits() {
-        return heightUnit;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#getWidth()
-     */
-    public int getWidth() {
-        return width;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#getWidthUnits()
-     */
-    public int getWidthUnits() {
-        return widthUnit;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setHeight(int)
-     */
-    public void setHeight(int height) {
-        this.height = height;
-        component.requestRepaint();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setHeightUnits(int)
-     */
-    public void setHeightUnits(int unit) {
-        heightUnit = unit;
-        component.requestRepaint();
-    }
-
-    public void setHeight(int height, int unit) {
-        setHeight(height);
-        setHeightUnits(unit);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setSizeFull()
-     */
-    public void setSizeFull() {
-        height = 100;
-        width = 100;
-        heightUnit = UNITS_PERCENTAGE;
-        widthUnit = UNITS_PERCENTAGE;
-        component.requestRepaint();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setSizeUndefined()
-     */
-    public void setSizeUndefined() {
-        height = -1;
-        width = -1;
-        heightUnit = UNITS_PIXELS;
-        widthUnit = UNITS_PIXELS;
-        component.requestRepaint();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setWidth(int)
-     */
-    public void setWidth(int width) {
-        this.width = width;
-        component.requestRepaint();
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setWidthUnits(int)
-     */
-    public void setWidthUnits(int unit) {
-        widthUnit = unit;
-        component.requestRepaint();
-    }
-
-    public void setWidth(int width, int unit) {
-        setWidth(width);
-        setWidthUnits(unit);
-    }
-
-    public void paint(PaintTarget target) throws PaintException {
-        if (getHeight() >= 0) {
-            target.addAttribute("height", "" + getHeight()
-                    + UNIT_SYMBOLS[getHeightUnits()]);
-        }
-        if (getWidth() >= 0) {
-            target.addAttribute("width", "" + getWidth()
-                    + UNIT_SYMBOLS[getWidthUnits()]);
-        }
-    }
-
-}
\ No newline at end of file
index 8e17e9f2692d6c108a6f4e1d3065670d63acfaea..c5cb14acd216eb59a4d309075bc1391228d9b917 100644 (file)
@@ -12,7 +12,6 @@ package com.itmill.toolkit.terminal;
  * @version
  * @VERSION@
  * @since 3.0
- * @deprecated
  */
 public interface Sizeable {
 
@@ -69,6 +68,8 @@ public interface Sizeable {
      */
     public static final int UNITS_ROWS = 9;
 
+    public static final int SIZE_UNDEFINED = -1;
+
     /**
      * Textual representations of units symbols. Supported units and their
      * symbols are:
index 1c016d560a53dceee36fa7dd11ab7c25d7bc75fc..af03bf7a463a0e484d97685a8dde70680820344e 100755 (executable)
@@ -595,6 +595,8 @@ public class ApplicationConnection {
             }
         }
 
+        updateComponentSize(component, uidl);
+
         // Styles + disabled & readonly
         component.setStyleName(component.getStylePrimaryName());
 
@@ -628,6 +630,15 @@ public class ApplicationConnection {
         return false;
     }
 
+    private void updateComponentSize(Widget component, UIDL uidl) {
+        String w = uidl.hasAttribute("width") ? uidl
+                .getStringAttribute("width") : "";
+        component.setWidth(w);
+        String h = uidl.hasAttribute("height") ? uidl
+                .getStringAttribute("height") : "";
+        component.setHeight(h);
+    }
+
     /**
      * Get either existing or new Paintable for given UIDL.
      * 
index 97491aafdc0cb8e69ae0495deb46d3449eb6f7ba..1efdc41f90da34dc094007de7e216330770268e7 100644 (file)
@@ -4,7 +4,6 @@
 
 package com.itmill.toolkit.terminal.gwt.client.ui;
 
-import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.ui.HTML;
 import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;
 import com.itmill.toolkit.terminal.gwt.client.Paintable;
@@ -12,16 +11,13 @@ import com.itmill.toolkit.terminal.gwt.client.UIDL;
 
 public class IEmbedded extends HTML implements Paintable {
 
+    private String heigth;
+    private String width;
+
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
         if (client.updateComponent(this, uidl, true)) {
             return;
         }
-        final String w = uidl.hasAttribute("width") ? uidl
-                .getStringAttribute("width") : "100%";
-        final String h = uidl.hasAttribute("height") ? uidl
-                .getStringAttribute("height") : "100%";
-        DOM.setStyleAttribute(getElement(), "width", w);
-        DOM.setStyleAttribute(getElement(), "height", h);
 
         if (uidl.hasAttribute("type")) {
             final String type = uidl.getStringAttribute("type");
@@ -37,11 +33,11 @@ public class IEmbedded extends HTML implements Paintable {
         } else if (uidl.hasAttribute("mimetype")) {
             final String mime = uidl.getStringAttribute("mimetype");
             if (mime.equals("application/x-shockwave-flash")) {
-                setHTML("<object width=\"" + w + "\" height=\"" + h
+                setHTML("<object width=\"" + width + "\" height=\"" + heigth
                         + "\"><param name=\"movie\" value=\""
                         + getSrc(uidl, client) + "\"><embed src=\""
-                        + getSrc(uidl, client) + "\" width=\"" + w
-                        + "\" height=\"" + h + "\"></embed></object>");
+                        + getSrc(uidl, client) + "\" width=\"" + width
+                        + "\" height=\"" + heigth + "\"></embed></object>");
             } else {
                 ApplicationConnection.getConsole().log(
                         "Unknown Embedded mimetype '" + mime + "'");
@@ -63,4 +59,20 @@ public class IEmbedded extends HTML implements Paintable {
     private String getSrc(UIDL uidl, ApplicationConnection client) {
         return client.translateToolkitUri(uidl.getStringAttribute("src"));
     }
+
+    public void setWidth(String width) {
+        if (width == null || width.equals("")) {
+            width = "100%";
+        }
+        this.width = width;
+        super.setHeight(width);
+    }
+
+    public void setHeight(String height) {
+        if (height == null || height.equals("")) {
+            height = "100%";
+        }
+        heigth = height;
+        super.setHeight(height);
+    }
 }
index 3c4e6f54598dfa395be6df6267b28386a0186f3d..6977406230e834d89847b9103289d20629ef9f55 100644 (file)
@@ -327,16 +327,18 @@ public class IExpandLayout extends ComplexPanel implements
     }
 
     protected void handleMargins(UIDL uidl) {
-        final MarginInfo margins = new MarginInfo(uidl
-                .getIntAttribute("margins"));
-        setStyleName(marginElement,
-                CLASSNAME + "-" + StyleConstants.MARGIN_TOP, margins.hasTop());
-        setStyleName(marginElement, CLASSNAME + "-"
-                + StyleConstants.MARGIN_RIGHT, margins.hasRight());
-        setStyleName(marginElement, CLASSNAME + "-"
-                + StyleConstants.MARGIN_BOTTOM, margins.hasBottom());
-        setStyleName(marginElement, CLASSNAME + "-"
-                + StyleConstants.MARGIN_LEFT, margins.hasLeft());
+        if (uidl.hasAttribute("margins")) {
+            final MarginInfo margins = new MarginInfo(uidl
+                    .getIntAttribute("margins"));
+            setStyleName(marginElement, CLASSNAME + "-"
+                    + StyleConstants.MARGIN_TOP, margins.hasTop());
+            setStyleName(marginElement, CLASSNAME + "-"
+                    + StyleConstants.MARGIN_RIGHT, margins.hasRight());
+            setStyleName(marginElement, CLASSNAME + "-"
+                    + StyleConstants.MARGIN_BOTTOM, margins.hasBottom());
+            setStyleName(marginElement, CLASSNAME + "-"
+                    + StyleConstants.MARGIN_LEFT, margins.hasLeft());
+        }
     }
 
     public boolean hasChildComponent(Widget component) {
@@ -588,20 +590,14 @@ public class IExpandLayout extends ComplexPanel implements
 
         this.client = client;
 
+        // Modify layout margins
+        handleMargins(uidl);
+
         // Ensure correct implementation
         if (client.updateComponent(this, uidl, false)) {
             return;
         }
 
-        // Modify layout margins
-        handleMargins(uidl);
-
-        setWidth(uidl.hasAttribute("width") ? uidl.getStringAttribute("width")
-                : "");
-
-        setHeight(uidl.hasAttribute("height") ? uidl
-                .getStringAttribute("height") : "");
-
         hasComponentSpacing = uidl.getBooleanAttribute("spacing");
 
         final ArrayList uidlWidgets = new ArrayList();
index 4ae766c366290be87c3a7d96d4af9a81ea8795e8..8ec49570eef50d7d6baf3df2fb77be6bff7e95a4 100644 (file)
@@ -82,7 +82,7 @@ public class IPanel extends SimplePanel implements Paintable,
                 .getStringVariable("width") : null;
         height = uidl.hasVariable("height") ? uidl.getStringVariable("height")
                 : null;
-        setWidth(w != null ? w : "");
+        super.setWidth(w != null ? w : "");
 
         // Restore default stylenames
         DOM
@@ -279,4 +279,18 @@ public class IPanel extends SimplePanel implements Paintable,
         }
     }
 
+    /**
+     * Panal handles dimensions by itself
+     */
+    public void setHeight(String height) {
+        // NOP
+    }
+
+    /**
+     * Panal handles dimensions by itself
+     */
+    public void setWidth(String width) {
+        // NOP
+    }
+
 }
index e54df0059487f0ec23229b7fc2d55652716fa51f..b144e6c8bef068ac2c18a80cb97aa001f44a940b 100644 (file)
@@ -514,7 +514,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
         if (height == null) {
             bodyContainer.setHeight((tBody.getRowHeight() * pageLength) + "px");
         } else {
-            setHeight(height);
+            mySetHeight(height);
             iLayout();
         }
 
@@ -523,15 +523,15 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
             w += getScrollbarWidth();
             bodyContainer.setWidth(w + "px");
             tHead.setWidth(w + "px");
-            setWidth(w + "px");
+            super.setWidth(w + "px");
         } else {
             if (width.indexOf("px") > 0) {
                 bodyContainer.setWidth(width);
                 tHead.setWidth(width);
-                setWidth(width);
+                super.setWidth(width);
             } else if (width.indexOf("%") > 0) {
                 if (!width.equals("100%")) {
-                    setWidth(width);
+                    super.setWidth(width);
                 }
                 // contained blocks are relative to parents
                 bodyContainer.setWidth("100%");
@@ -618,7 +618,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
                  * which is what users usually want. So recalculate pixels via
                  * setHeight.
                  */
-                setHeight(height);
+                mySetHeight(height);
             }
 
             int contentH = (DOM.getElementPropertyInt(getElement(),
@@ -2007,7 +2007,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
         return panel.remove(w);
     }
 
-    public void setHeight(String height) {
+    public void mySetHeight(String height) {
         // workaround very common 100% height problem - extract borders
         if (height.equals("100%")) {
             final int borders = getBorderSpace();
@@ -2039,4 +2039,12 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
                 - DOM.getElementPropertyInt(el, "clientHeight");
     }
 
+    public void setWidth(String width) {
+        // NOP size handled internally
+    }
+
+    public void setHeight(String height) {
+        // NOP size handled internally
+    }
+
 }
index ddad482c674687f634b6e208f3c3bc3b2e5bf212..1fc864c1ff9d74e6fc07f7fdbf8e69747fa840d3 100644 (file)
@@ -115,14 +115,11 @@ public class ISplitPanel extends ComplexPanel implements Paintable,
             return;
         }
 
-        setWidth(uidl.getStringAttribute("width"));
-        setHeight(uidl.getStringAttribute("height"));
-
         setSplitPosition(uidl.getStringAttribute("position"));
 
-        final Paintable newFirstChild = (Paintable) client.getPaintable(uidl
+        final Paintable newFirstChild = client.getPaintable(uidl
                 .getChildUIDL(0));
-        final Paintable newSecondChild = (Paintable) client.getPaintable(uidl
+        final Paintable newSecondChild = client.getPaintable(uidl
                 .getChildUIDL(1));
         if (firstChild != newFirstChild) {
             if (firstChild != null) {
index 4a939789814b42b777ff0193deee2f6ec8dbacd3..7724bd0e030b086fd7c5159b8cdb6477b136d21b 100644 (file)
@@ -225,6 +225,8 @@ public class ITabsheet extends ITabsheetBase implements
 
             // Set proper values for content element
             DOM.setStyleAttribute(contentNode, "height", newHeight + "px");
+            tp.setHeight("100%");
+
             DOM.setStyleAttribute(contentNode, "overflow", "auto");
 
             // Restore content to normal flow
index 61f957da3fb5e7e1642eaa0bcde953abe28b7001..a045358b2c0ccb8e3b98669eca4d4c824323aff1 100644 (file)
@@ -36,18 +36,6 @@ abstract class ITabsheetBase extends FlowPanel implements Paintable {
         id = uidl.getId();
         disabled = uidl.hasAttribute("disabled");
 
-        // Adjust width and height
-        if (uidl.hasAttribute("height")) {
-            setHeight(uidl.getStringAttribute("height"));
-        } else {
-            setHeight("");
-        }
-        if (uidl.hasAttribute("width")) {
-            setWidth(uidl.getStringAttribute("width"));
-        } else {
-            setWidth("");
-        }
-
         // Render content
         final UIDL tabs = uidl.getChildUIDL(0);
         if (keepCurrentTabs(uidl)) {
index acc9beab7d7c10c6362134a4c8c13c96905dff93..8eac73444869d2fb636d0aa2285195db8ab6b8e6 100644 (file)
@@ -127,7 +127,7 @@ public class BasicRandomTest extends com.itmill.toolkit.Application implements
         final OrderedLayout setupLayout = new OrderedLayout(
                 OrderedLayout.ORIENTATION_HORIZONTAL);
         final Panel statusPanel = new Panel("Status");
-        statusPanel.getSize().setWidth(200);
+        statusPanel.setWidth(200);
         setupLayout.addComponent(statusPanel);
         statusPanel.addComponent(statusLabel);
         setupLayout.addComponent(randomSeedValue);
@@ -383,7 +383,7 @@ public class BasicRandomTest extends com.itmill.toolkit.Application implements
                         tabCaption, null);
             }
             ts.setSelectedTab((ComponentContainer) tabs.get(selectedTab));
-            result = (ComponentContainer) ts;
+            result = ts;
             break;
         }
 
index 6b66f39c5d23d5c6ccacde4368811d824e37a0c4..5925fb69ec5ecd6d526e9bc05694890534e1ffff 100644 (file)
@@ -154,7 +154,7 @@ public class RandomLayoutStress extends com.itmill.toolkit.Application {
                                     + "extremities and may have a caption to clarify the nature of the contained components' purpose."
                                     + " Panel contains an layout where the actual contained components are added, "
                                     + "this layout may be switched on the fly."));
-            ((Panel) result).getSize().setWidth(250);
+            ((Panel) result).setWidth(250);
             break;
         case 6:
             // Datefield
index cbcd60e7e338215bda539ce0ad365d6ff7140937..0956a832e035549d3f7aecc5349744e33c64c1ad 100644 (file)
@@ -26,8 +26,8 @@ public class TableChangingDatasource extends CustomComponent implements
 \r
         t = new Table();\r
 \r
-        t.getSize().setWidth(500);\r
-        t.getSize().setHeight(300);\r
+        t.setWidth(500);\r
+        t.setHeight(300);\r
 \r
         ta[0] = TestForTablesInitialColumnWidthLogicRendering\r
                 .getTestTable(3, 0);\r
index 92575cda82277475e04d8e67a94954651e60fb64..c2e15b3b561adbebf5ddfeb516b8d4e4a4a9e492 100644 (file)
@@ -15,7 +15,6 @@ import java.util.List;
 import com.itmill.toolkit.Application;
 import com.itmill.toolkit.data.Property;
 import com.itmill.toolkit.data.util.HierarchicalContainer;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.ui.Component;
 import com.itmill.toolkit.ui.CustomComponent;
 import com.itmill.toolkit.ui.ExpandLayout;
@@ -108,11 +107,12 @@ public class TestBench extends com.itmill.toolkit.Application implements
 
         menu.addListener(this);
         menu.setImmediate(true);
+        menu.setNullSelectionAllowed(false);
 
         mainLayout.addComponent(menu);
 
         bodyLayout.addStyleName("light");
-        bodyLayout.getSize().setHeight(100, Size.UNITS_PERCENTAGE);
+        bodyLayout.setHeight(100, Component.UNITS_PERCENTAGE);
         bodyLayout.setLayout(new ExpandLayout());
 
         mainLayout.addComponent(bodyLayout);
index 62beab9aeede9ce17900497b727308565a4f9731..98fcff5e2a4f011dbebbd6ecb4142b63c6869cf0 100644 (file)
@@ -17,7 +17,6 @@ import com.itmill.toolkit.event.Action;
 import com.itmill.toolkit.terminal.ClassResource;
 import com.itmill.toolkit.terminal.ErrorMessage;
 import com.itmill.toolkit.terminal.ExternalResource;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.terminal.UserError;
 import com.itmill.toolkit.ui.AbstractComponent;
 import com.itmill.toolkit.ui.Button;
@@ -141,7 +140,7 @@ public class TestComponentsAndLayouts extends Application implements Listener,
                             "<hr /><h1>Components inside ExpandLayout (height 250px)</h3>",
                             Label.CONTENT_XHTML));
             final ExpandLayout el = new ExpandLayout();
-            el.getSize().setHeight(250, Size.UNITS_PIXELS);
+            el.setHeight(250, Component.UNITS_PIXELS);
             populateLayout(el);
             target.addComponent(el);
         }
@@ -163,7 +162,7 @@ public class TestComponentsAndLayouts extends Application implements Listener,
                             "<hr /><h1>Components inside vertical SplitPanel (splitpanel is under 250height ExpandLayout)</h3>",
                             Label.CONTENT_XHTML));
             final ExpandLayout sp1l = new ExpandLayout();
-            sp1l.getSize().setHeight(250, Size.UNITS_PIXELS);
+            sp1l.setHeight(250, ExpandLayout.UNITS_PIXELS);
             final SplitPanel sp1 = new SplitPanel(
                     SplitPanel.ORIENTATION_VERTICAL);
             sp1l.addComponent(sp1);
@@ -183,7 +182,7 @@ public class TestComponentsAndLayouts extends Application implements Listener,
                             "<hr /><h1>Components inside horizontal SplitPanel (splitpanel is under 250px height ExpandLayout)</h3>",
                             Label.CONTENT_XHTML));
             final ExpandLayout sp2l = new ExpandLayout();
-            sp2l.getSize().setHeight(250, Size.UNITS_PIXELS);
+            sp2l.setHeight(250, SplitPanel.UNITS_PIXELS);
             final SplitPanel sp2 = new SplitPanel(
                     SplitPanel.ORIENTATION_HORIZONTAL);
             sp2l.addComponent(sp2);
index 5890cef0529dccd9ef845ed367739d98c8670cc3..e8692f124127e4b7a66fc9852602a895e0ae517b 100644 (file)
@@ -39,7 +39,7 @@ public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends
 
         final Table t = TestForTablesInitialColumnWidthLogicRendering
                 .getTestTable(4, 100);
-        t.getSize().setSizeFull();
+        t.setSizeFull();
         topRight.addComponent(t);
         topRight.expand(t);
 
index b2f90d22123c2461dbeaf633e05f573711cad51b..d497d96df006d6925282b2dc6402037c37266146 100644 (file)
@@ -6,7 +6,6 @@ package com.itmill.toolkit.tests;
 \r
 import java.util.Locale;\r
 \r
-import com.itmill.toolkit.terminal.Size;\r
 import com.itmill.toolkit.ui.Button;\r
 import com.itmill.toolkit.ui.CustomComponent;\r
 import com.itmill.toolkit.ui.DateField;\r
@@ -31,7 +30,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         click = new Button("Set height -1", new ClickListener() {\r
 \r
             public void buttonClick(ClickEvent event) {\r
-                tab.getSize().setHeight(-1);\r
+                tab.setHeight(-1);\r
             }\r
 \r
         });\r
@@ -39,22 +38,22 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         click2 = new Button("Set height 100%", new ClickListener() {\r
 \r
             public void buttonClick(ClickEvent event) {\r
-                tab.getSize().setHeight(100, Size.UNITS_PERCENTAGE);\r
+                tab.setHeight(100, TabSheet.UNITS_PERCENTAGE);\r
             }\r
 \r
         });\r
 \r
         final SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);\r
-        sp.setSplitPosition(290, Size.UNITS_PIXELS);\r
+        sp.setSplitPosition(290, SplitPanel.UNITS_PIXELS);\r
 \r
         final SplitPanel sp2 = new SplitPanel(SplitPanel.ORIENTATION_VERTICAL);\r
-        sp2.setSplitPosition(255, Size.UNITS_PIXELS);\r
+        sp2.setSplitPosition(255, SplitPanel.UNITS_PIXELS);\r
 \r
         final Panel p = new Panel("Accordion Panel");\r
-        p.getSize().setSizeFull();\r
+        p.setSizeFull();\r
 \r
         tab = new TabSheet();\r
-        tab.getSize().setSizeFull();\r
+        tab.setSizeFull();\r
 \r
         final Panel report = new Panel("Monthly Program Runs",\r
                 new ExpandLayout());\r
@@ -70,7 +69,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         report.addComponent(cal);\r
         ((ExpandLayout) report.getLayout()).expand(controls);\r
         report.addStyleName(Panel.STYLE_LIGHT);\r
-        report.getSize().setHeight(100, Size.UNITS_PERCENTAGE);\r
+        report.setHeight(100, SplitPanel.UNITS_PERCENTAGE);\r
 \r
         sp2.setFirstComponent(report);\r
 \r
@@ -82,7 +81,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         table.setColumnCollapsingAllowed(true);\r
         table.setColumnReorderingAllowed(true);\r
         table.setSortDisabled(false);\r
-        table.getSize().setSizeFull();\r
+        table.setSizeFull();\r
         table.addStyleName("table-inline");\r
         sp2.setSecondComponent(table);\r
 \r
index 844168f9410bccee36b2944da62ec7db2c0485fb..05ca867979f226f6785edd6ce358919a4ce02699 100644 (file)
@@ -5,7 +5,6 @@
 package com.itmill.toolkit.tests;
 
 import com.itmill.toolkit.data.util.IndexedContainer;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.ui.Button;
 import com.itmill.toolkit.ui.CustomComponent;
 import com.itmill.toolkit.ui.Label;
@@ -42,7 +41,7 @@ public class TestForContainerFilterable extends CustomComponent {
         // Init filtering view
         final Panel filterPanel = new Panel("Filter", new OrderedLayout(
                 OrderedLayout.ORIENTATION_HORIZONTAL));
-        filterPanel.getSize().setWidth(100, Size.UNITS_PERCENTAGE);
+        filterPanel.setWidth(100, Panel.UNITS_PERCENTAGE);
         lo.addComponent(filterPanel);
         filterPanel.addComponent(fooFilter);
         filterPanel.addComponent(barFilter);
@@ -56,7 +55,7 @@ public class TestForContainerFilterable extends CustomComponent {
         // Table
         lo.addComponent(t);
         t.setPageLength(12);
-        t.getSize().setWidth(100, Size.UNITS_PERCENTAGE);
+        t.setWidth(100, Table.UNITS_PERCENTAGE);
         t.setContainerDataSource(ic);
 
         // Handler
index c3bb09a4ae5e8b8ff6dac153fe24f8f945645246..c077390b2ae09e4aeb1f62d3c89349dde60cc132 100644 (file)
@@ -4,7 +4,6 @@
 \r
 package com.itmill.toolkit.tests;\r
 \r
-import com.itmill.toolkit.terminal.Size;\r
 import com.itmill.toolkit.ui.CustomComponent;\r
 import com.itmill.toolkit.ui.DateField;\r
 import com.itmill.toolkit.ui.ExpandLayout;\r
@@ -36,7 +35,7 @@ public class TestForExpandLayout extends CustomComponent {
                 el.addComponent(l);\r
             }\r
             if (i > 0) {\r
-                el.getSize().setHeight(1, Size.UNITS_EM);\r
+                el.setHeight(1, ExpandLayout.UNITS_EM);\r
             }\r
             main.addComponent(el);\r
         }\r
index fa668139b26624c2c1bde60bed7c76bd114c9ce1..f929729a72ef4b8d388347982c3d05e67b4b8a85 100644 (file)
@@ -4,7 +4,6 @@
 \r
 package com.itmill.toolkit.tests;\r
 \r
-import com.itmill.toolkit.terminal.Size;\r
 import com.itmill.toolkit.ui.Button;\r
 import com.itmill.toolkit.ui.CustomComponent;\r
 import com.itmill.toolkit.ui.ExpandLayout;\r
@@ -28,8 +27,8 @@ public class TestForExpandLayout2 extends CustomComponent {
         main = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL);\r
 \r
         Panel left = new Panel("Left column");\r
-        left.getSize().setHeight(100, Size.UNITS_PERCENTAGE);\r
-        left.getSize().setWidth(150);\r
+        left.setHeight(100, Panel.UNITS_PERCENTAGE);\r
+        left.setWidth(150);\r
         main.addComponent(left);\r
 \r
         ExpandLayout center = new ExpandLayout();\r
@@ -37,11 +36,11 @@ public class TestForExpandLayout2 extends CustomComponent {
         Panel mainContent = new Panel();\r
         center.addComponent(mainContent);\r
         center.expand(mainContent);\r
-        mainContent.getSize().setSizeFull();\r
+        mainContent.setSizeFull();\r
 \r
         ExpandLayout buttons = new ExpandLayout(\r
                 ExpandLayout.ORIENTATION_HORIZONTAL);\r
-        buttons.getSize().setHeight(30, Size.UNITS_PIXELS);\r
+        buttons.setHeight(30, ExpandLayout.UNITS_PIXELS);\r
         Button b1 = new Button("Save");\r
         Button b2 = new Button("Cancel");\r
         Button b3 = new Button("Logout");\r
@@ -56,8 +55,8 @@ public class TestForExpandLayout2 extends CustomComponent {
         main.expand(center);\r
 \r
         Panel right = new Panel("Right column");\r
-        right.getSize().setHeight(100, Size.UNITS_PERCENTAGE);\r
-        right.getSize().setWidth(200);\r
+        right.setHeight(100, Panel.UNITS_PERCENTAGE);\r
+        right.setWidth(200);\r
 \r
         main.addComponent(right);\r
 \r
index 08c4bb0c98fb2e0357010ee0c84a6001dbcb5fa4..c23ca34373bf6309b5994438079466bf40d68215 100644 (file)
@@ -4,7 +4,6 @@
 \r
 package com.itmill.toolkit.tests;\r
 \r
-import com.itmill.toolkit.terminal.Size;\r
 import com.itmill.toolkit.ui.Button;\r
 import com.itmill.toolkit.ui.CustomComponent;\r
 import com.itmill.toolkit.ui.DateField;\r
@@ -56,7 +55,7 @@ public class TestForExpandLayout3 extends CustomComponent {
         el.expand(b);\r
         el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_HORIZONTAL_CENTER,\r
                 ExpandLayout.ALIGNMENT_VERTICAL_CENTER);\r
-        el.getSize().setHeight(60, Size.UNITS_PIXELS);\r
+        el.setHeight(60, ExpandLayout.UNITS_PIXELS);\r
         el.setMargin(true);\r
         main.addComponent(el);\r
 \r
@@ -71,7 +70,7 @@ public class TestForExpandLayout3 extends CustomComponent {
         el.expand(b);\r
         el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT,\r
                 ExpandLayout.ALIGNMENT_BOTTOM);\r
-        el.getSize().setHeight(100, Size.UNITS_PIXELS);\r
+        el.setHeight(100, ExpandLayout.UNITS_PIXELS);\r
         el.setSpacing(true);\r
 \r
         main.addComponent(el);\r
index dd872fc0da933d581cd0add5bea92713146972d7..5e7216101b801763401ec7f3a2030dab5952a634 100644 (file)
@@ -29,11 +29,11 @@ public class TestForNativeWindowing extends Application {
                         main.addWindow(w);
                         w.setPositionX(100);
                         w.setPositionY(100);
-                        w.getSize().setWidth(200);
-                        w.getSize().setHeight(200);
+                        w.setWidth(200);
+                        w.setHeight(200);
 
-                        w.getSize().setWidth(100);
-                        w.getSize().setHeight(400);
+                        w.setWidth(100);
+                        w.setHeight(400);
 
                         final Button closebutton = new Button("Close "
                                 + w.getCaption(), new Button.ClickListener() {
index 0bff19a18b87983d81f3073dd88f5d1019b42f78..47c435ad82a9aa8eb111d42b8ae023d2ccc4db9a 100644 (file)
@@ -154,8 +154,8 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
         ol2.addComponent(commit);
         status.addComponent(ol2);
 
-        status.getSize().setHeight(300);
-        status.getSize().setWidth(400);
+        status.setHeight(300);
+        status.setWidth(400);
 
         ol.addComponent(status);
 
index 6abe000224695782f1ddc42414380eeb9ff5d4c8..8a235ff22689b20243966e601ef740a6da6ceafa 100644 (file)
@@ -6,12 +6,12 @@ package com.itmill.toolkit.tests;
 
 import java.util.Vector;
 
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.ui.Button;
 import com.itmill.toolkit.ui.CustomComponent;
 import com.itmill.toolkit.ui.Label;
 import com.itmill.toolkit.ui.OrderedLayout;
 import com.itmill.toolkit.ui.Table;
+import com.itmill.toolkit.ui.Button.ClickEvent;
 
 /**
  * 
@@ -57,18 +57,18 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
         t = getTestTable(3, 40);
         t
                 .setCaption("Table with some columns and wide explicit width. (Ought to widen columns to use all space)");
-        t.getSize().setWidth(1000);
+        t.setWidth(1000);
         main.addComponent(t);
 
         t = getTestTable(12, 4);
         t.setCaption("Table with  some rows and lot of columns, width == 100%");
-        t.getSize().setWidth(100, Size.UNITS_PERCENTAGE);
+        t.setWidth(100, Table.UNITS_PERCENTAGE);
         main.addComponent(t);
 
         t = getTestTable(12, 100);
         t
                 .setCaption("Table with  lot of rows and lot of columns, width == 50%");
-        t.getSize().setWidth(50, Size.UNITS_PERCENTAGE);
+        t.setWidth(50, Table.UNITS_PERCENTAGE);
         main.addComponent(t);
 
         t = getTestTable(5, 100);
@@ -78,7 +78,7 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
         t = getTestTable(4, 4);
         t.setCaption("Table with some rows and width = 200px");
 
-        t.getSize().setWidth(200);
+        t.setWidth(200);
         main.addComponent(t);
 
         final Button b = new Button("refresh view", this, "createNewView");
@@ -92,11 +92,19 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
         for (int i = 0; i < cols; i++) {
             t.addContainerProperty(testString[i], String.class, "");
         }
+        t.addContainerProperty("button", Button.class, null);
         for (int i = 0; i < rows; i++) {
             final Vector content = new Vector();
             for (int j = 0; j < cols; j++) {
                 content.add(rndString());
             }
+            content.add(new Button("b", new Button.ClickListener() {
+
+                public void buttonClick(ClickEvent event) {
+                    System.out.println("b click");
+
+                }
+            }));
             t.addItem(content.toArray(), "" + i);
         }
         return t;
index 30658f8ffa564694ec4f3948541088ca205453d6..fd7624fce4d872a72d79e3e0b521adc93204cbd3 100644 (file)
@@ -134,8 +134,8 @@ public class TestForTrees extends CustomComponent implements Handler {
         });
         status.addComponent(clear);
 
-        status.getSize().setHeight(300);
-        status.getSize().setWidth(400);
+        status.setHeight(300);
+        status.setWidth(400);
 
         ol.addComponent(status);
 
index 0d8cbb52a25ea7ffc99caa628ae314c5027e2940..aa89b3c64932f7a3f620cff486b4ccfadb852342 100644 (file)
@@ -246,8 +246,6 @@ public class TestForUpload extends CustomComponent implements
 
         private File file;
 
-        private FileInputStream stream;
-
         public TmpFileBuffer() {
             final String tempFileName = "upload_tmpfile_"
                     + System.currentTimeMillis();
index a6f62c6d1bf9fd9740e531bb73be1e6b757295b8..80b85a52987710bb3563e84fabf050997ed3ee59 100644 (file)
@@ -78,7 +78,7 @@ public abstract class Feature extends CustomComponent {
 
         ts = new TabSheet();
 
-        ts.getSize().setSizeFull();
+        ts.setSizeFull();
 
         // Description tab
         final String title = getTitle();
index 0cf915a0fe356137a54db30335ebb51eb1fd29ed..380131a653900c6c319fff49343895ac41eb1ca8 100644 (file)
@@ -5,7 +5,6 @@
 package com.itmill.toolkit.tests.featurebrowser;
 
 import com.itmill.toolkit.terminal.ClassResource;
-import com.itmill.toolkit.terminal.Sizeable;
 import com.itmill.toolkit.ui.Component;
 import com.itmill.toolkit.ui.Embedded;
 import com.itmill.toolkit.ui.Form;
@@ -40,11 +39,11 @@ public class FeatureEmbedded extends Feature {
                 new Integer(Embedded.TYPE_IMAGE),
                 new Integer(Embedded.TYPE_OBJECT) }, new Object[] { "Image",
                 "Object" });
-        final Object[] units = new Object[Sizeable.UNIT_SYMBOLS.length];
-        final Object[] symbols = new Object[Sizeable.UNIT_SYMBOLS.length];
+        final Object[] units = new Object[Embedded.UNIT_SYMBOLS.length];
+        final Object[] symbols = new Object[Embedded.UNIT_SYMBOLS.length];
         for (int i = 0; i < units.length; i++) {
             units[i] = new Integer(i);
-            symbols[i] = Sizeable.UNIT_SYMBOLS[i];
+            symbols[i] = Embedded.UNIT_SYMBOLS[i];
         }
         ap.replaceWithSelect("heightUnits", units, symbols);
         ap.replaceWithSelect("widthUnits", units, symbols);
index 1aaacf329ef3ce8542227c6575374c92997ca236..7e357e0e003e5dbcfe55f219962654fb3bebedd2 100644 (file)
@@ -35,8 +35,8 @@ public class FeatureWindow extends Feature implements Window.CloseListener {
 
         demoWindow = new Window("Feature Test Window");
         demoWindow.addListener(this);
-        demoWindow.getSize().setWidth(400);
-        demoWindow.getSize().setHeight(200);
+        demoWindow.setWidth(400);
+        demoWindow.setHeight(200);
         demoWindow.setTheme("default");
 
         layoutUpper.addComponent(addButton);
index 1ce835b80d2836778ec1f72fa57bf5051d6944b7..9faefae1809085058021142bbcc0c249df1da1b9 100644 (file)
@@ -67,7 +67,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener,
         setCaption("Properties");
         addComponent(formsLayout);
 
-        getSize().setSizeFull();
+        setSizeFull();
 
         // Target object
         this.objectToConfigure = objectToConfigure;
@@ -103,7 +103,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener,
                 Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER });
         allProperties.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID);
         allProperties.setPageLength(0);
-        allProperties.getSize().setSizeFull();
+        allProperties.setSizeFull();
         updatePropertyList();
 
     }
index 6780c7d1c2f2e330eeb18718ab352308da99c619..3217143b1c56952156fa5cc1623319ce2f2fa209 100644 (file)
@@ -15,7 +15,7 @@ import com.itmill.toolkit.data.validator.StringLengthValidator;
 import com.itmill.toolkit.terminal.ClassResource;
 import com.itmill.toolkit.terminal.DownloadStream;
 import com.itmill.toolkit.terminal.ExternalResource;
-import com.itmill.toolkit.terminal.Size;
+import com.itmill.toolkit.terminal.Sizeable;
 import com.itmill.toolkit.terminal.StreamResource;
 import com.itmill.toolkit.terminal.UserError;
 import com.itmill.toolkit.ui.AbstractSelect;
@@ -63,8 +63,9 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
     public DownloadStream handleURI(URL context, String relativeUri) {
         // Let default implementation handle requests for
         // application resources.
-        if (relativeUri.startsWith("APP"))
+        if (relativeUri.startsWith("APP")) {
             return super.handleURI(context, relativeUri);
+        }
 
         String example;
         String param = null;
@@ -229,14 +230,18 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
 
     void example_Tree(Window main, String param) {
         final Object[][] planets = new Object[][] {
-            new Object[] {"Mercury"},
-            new Object[] {"Venus"},
-            new Object[] {"Earth", "The Moon"},
-            new Object[] {"Mars", "Phobos", "Deimos"},
-            new Object[] {"Jupiter", "Io", "Europa", "Ganymedes", "Callisto"},
-            new Object[] {"Saturn", "Titan", "Tethys", "Dione", "Rhea", "Iapetus"},
-            new Object[] {"Uranus", "Miranda", "Ariel", "Umbriel", "Titania", "Oberon"},
-            new Object[] {"Neptune", "Triton", "Proteus", "Nereid", "Larissa"}};
+                new Object[] { "Mercury" },
+                new Object[] { "Venus" },
+                new Object[] { "Earth", "The Moon" },
+                new Object[] { "Mars", "Phobos", "Deimos" },
+                new Object[] { "Jupiter", "Io", "Europa", "Ganymedes",
+                        "Callisto" },
+                new Object[] { "Saturn", "Titan", "Tethys", "Dione", "Rhea",
+                        "Iapetus" },
+                new Object[] { "Uranus", "Miranda", "Ariel", "Umbriel",
+                        "Titania", "Oberon" },
+                new Object[] { "Neptune", "Triton", "Proteus", "Nereid",
+                        "Larissa" } };
 
         final Tree tree = new Tree("The Planets and Major Moons");
 
@@ -366,23 +371,25 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
     void example_UserError(final Window main, String param) {
         if (param != null) {
             if (param.equals("form")) {
-         
+
                 final FormLayout layout = new FormLayout();
                 main.addComponent(layout);
-        
+
                 final TextField textfield = new TextField("Enter name");
                 layout.addComponent(textfield);
                 textfield.setComponentError(null);
 
                 final Button button = new Button("Click me!");
                 layout.addComponent(button);
-        
+
                 button.addListener(new Button.ClickListener() {
                     public void buttonClick(ClickEvent event) {
-                        if (((String)textfield.getValue()).length() == 0)
-                            textfield.setComponentError(new UserError("Must not be empty"));
-                        else // Clear the error
+                        if (((String) textfield.getValue()).length() == 0) {
+                            textfield.setComponentError(new UserError(
+                                    "Must not be empty"));
+                        } else {
                             textfield.setComponentError(null);
+                        }
                     }
                 });
             }
@@ -393,18 +400,20 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
 
             final Button button = new Button("Click me!");
             main.addComponent(button);
-    
+
             button.addListener(new Button.ClickListener() {
                 public void buttonClick(ClickEvent event) {
-                    if (((String)textfield.getValue()).length() == 0)
-                        textfield.setComponentError(new UserError("Must not be empty"));
-                    else // Clear the error
+                    if (((String) textfield.getValue()).length() == 0) {
+                        textfield.setComponentError(new UserError(
+                                "Must not be empty"));
+                    } else {
                         textfield.setComponentError(null);
+                    }
                 }
             });
         }
     }
-    
+
     void example_DateField(Window main, String param) {
         /* Create a DateField with the calendar style. */
         final DateField date = new DateField("Here is a calendar field");
@@ -502,13 +511,13 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
     void example_Panel(Window main, String param) {
         // Create a panel with a caption.
         final Panel panel = new Panel("Contact Information");
-        
+
         // Create a layout inside the panel
         final OrderedLayout form = new FormLayout();
-           
+
         // Set the layout as the root layout of the panel
         panel.setLayout(form);
-        
+
         // Add some components
         form.addComponent(new TextField("Name"));
         form.addComponent(new TextField("Email"));
@@ -557,8 +566,8 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
             main.setLayout(layout);
             layout.addStyleName("example-alignment");
 
-            layout.getSize().setWidth(400, Size.UNITS_PIXELS);
-            layout.getSize().setHeight(400, Size.UNITS_PIXELS);
+            layout.setWidth(400, Sizeable.UNITS_PIXELS);
+            layout.setHeight(400, Sizeable.UNITS_PIXELS);
 
             /* Define cells and their layouts to create. */
             /*
@@ -636,7 +645,7 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
             layout.expand(table);
 
             /* Set it to use all available area. */
-            table.getSize().setSizeFull();
+            table.setSizeFull();
 
             /* Add some component below the expanding one. */
             final Button button2 = new Button("Ok");
@@ -675,7 +684,8 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
         image.addStyleName("omaimage");
         main.addComponent(image);
 
-        final EmbeddedButton button = new EmbeddedButton(new ClassResource("smiley.jpg", this));
+        final EmbeddedButton button = new EmbeddedButton(new ClassResource(
+                "smiley.jpg", this));
         main.addComponent(button);
     }
 
@@ -694,10 +704,11 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
 
                 /* Add link to the second window in the main window. */
                 main.addComponent(new Label("Second window: <a href='"
-                                            + mywindow.getURL() + "'>middle-click to open</a>",
-                                  Label.CONTENT_XHTML));
-                main.addComponent(new Label("The second window can be accessed through URL: "
-                                            + mywindow.getURL()));
+                        + mywindow.getURL() + "'>middle-click to open</a>",
+                        Label.CONTENT_XHTML));
+                main.addComponent(new Label(
+                        "The second window can be accessed through URL: "
+                                + mywindow.getURL()));
             }
             return;
         }
@@ -712,8 +723,8 @@ public class MagiTestApplication extends com.itmill.toolkit.Application {
         mywindow.addComponent(okbutton);
 
         /* Set window size. */
-        mywindow.getSize().setHeight(200);
-        mywindow.getSize().setWidth(400);
+        mywindow.setHeight(200);
+        mywindow.setWidth(400);
 
         /* Set window position. */
         mywindow.setPositionX(200);
index fc18e8efb84cb6bc04c42c40f6ba6a4d8ada4959..9393eba5b86d87d7c314fb6e10d18115694e0ca3 100644 (file)
@@ -15,7 +15,6 @@ import java.util.List;
 import com.itmill.toolkit.Application;
 import com.itmill.toolkit.data.Property;
 import com.itmill.toolkit.data.util.HierarchicalContainer;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.ui.Component;
 import com.itmill.toolkit.ui.CustomComponent;
 import com.itmill.toolkit.ui.ExpandLayout;
@@ -108,7 +107,7 @@ public class TestBench extends com.itmill.toolkit.Application implements
         mainLayout.addComponent(menu);
 
         bodyLayout.addStyleName("light");
-        bodyLayout.getSize().setHeight(100, Size.UNITS_PERCENTAGE);
+        bodyLayout.setHeight(100, Component.UNITS_PERCENTAGE);
         bodyLayout.setLayout(new ExpandLayout());
 
         mainLayout.addComponent(bodyLayout);
index cd41e345e983330caed9dc931f1763cd8aed5936..eab315506f634f73243975bbd61320103355daff 100644 (file)
@@ -9,8 +9,8 @@ import java.util.Locale;
 \r
 import com.itmill.toolkit.data.util.QueryContainer;\r
 import com.itmill.toolkit.demo.util.SampleDatabase;\r
-import com.itmill.toolkit.terminal.Size;\r
 import com.itmill.toolkit.ui.Button;\r
+import com.itmill.toolkit.ui.Component;\r
 import com.itmill.toolkit.ui.CustomComponent;\r
 import com.itmill.toolkit.ui.DateField;\r
 import com.itmill.toolkit.ui.ExpandLayout;\r
@@ -37,7 +37,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         click = new Button("Set height -1", new ClickListener() {\r
 \r
             public void buttonClick(ClickEvent event) {\r
-                tab.getSize().setHeight(-1);\r
+                tab.setHeight(-1);\r
             }\r
 \r
         });\r
@@ -45,22 +45,22 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         click2 = new Button("Set height 100%", new ClickListener() {\r
 \r
             public void buttonClick(ClickEvent event) {\r
-                tab.getSize().setHeight(100, Size.UNITS_PERCENTAGE);\r
+                tab.setHeight(100, TabSheet.UNITS_PERCENTAGE);\r
             }\r
 \r
         });\r
 \r
         final SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);\r
-        sp.setSplitPosition(290, Size.UNITS_PIXELS);\r
+        sp.setSplitPosition(290, Component.UNITS_PIXELS);\r
 \r
         final SplitPanel sp2 = new SplitPanel(SplitPanel.ORIENTATION_VERTICAL);\r
-        sp2.setSplitPosition(255, Size.UNITS_PIXELS);\r
+        sp2.setSplitPosition(255, Component.UNITS_PIXELS);\r
 \r
         final Panel p = new Panel("Accordion Panel");\r
-        p.getSize().setSizeFull();\r
+        p.setSizeFull();\r
 \r
         tab = new TabSheet();\r
-        tab.getSize().setSizeFull();\r
+        tab.setSizeFull();\r
 \r
         final Panel report = new Panel("Monthly Program Runs",\r
                 new ExpandLayout());\r
@@ -76,7 +76,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         report.addComponent(cal);\r
         ((ExpandLayout) report.getLayout()).expand(controls);\r
         report.addStyleName(Panel.STYLE_LIGHT);\r
-        report.getSize().setHeight(100, Size.UNITS_PERCENTAGE);\r
+        report.setHeight(100, Component.UNITS_PERCENTAGE);\r
 \r
         sp2.setFirstComponent(report);\r
 \r
@@ -100,7 +100,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         table.setColumnCollapsingAllowed(true);\r
         table.setColumnReorderingAllowed(true);\r
         table.setSortDisabled(false);\r
-        table.getSize().setSizeFull();\r
+        table.setSizeFull();\r
         table.addStyleName("table-inline");\r
         sp2.setSecondComponent(table);\r
 \r
index 705d4881dcb0ef4de2d5c8f71a563a967a6d8526..b507fcb44635c55e52c82fcce8adcb9499f73664 100644 (file)
@@ -5,8 +5,8 @@
 package com.itmill.toolkit.tests.testbench;
 
 import com.itmill.toolkit.data.util.IndexedContainer;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.ui.Button;
+import com.itmill.toolkit.ui.Component;
 import com.itmill.toolkit.ui.CustomComponent;
 import com.itmill.toolkit.ui.Label;
 import com.itmill.toolkit.ui.OrderedLayout;
@@ -42,7 +42,7 @@ public class TestForContainerFilterable extends CustomComponent {
         // Init filtering view
         final Panel filterPanel = new Panel("Filter", new OrderedLayout(
                 OrderedLayout.ORIENTATION_HORIZONTAL));
-        filterPanel.getSize().setWidth(100, Size.UNITS_PERCENTAGE);
+        filterPanel.setWidth(100, Component.UNITS_PERCENTAGE);
         lo.addComponent(filterPanel);
         filterPanel.addComponent(firstFilter);
         filterPanel.addComponent(secondFilter);
@@ -56,7 +56,7 @@ public class TestForContainerFilterable extends CustomComponent {
         // Table
         lo.addComponent(t);
         t.setPageLength(12);
-        t.getSize().setWidth(100, Size.UNITS_PERCENTAGE);
+        t.setWidth(100, Component.UNITS_PERCENTAGE);
         t.setContainerDataSource(ic);
 
         // Handler
index 144640460a350ac2f30a8bae2c923f765c904022..7ab15d7360fea9d4d473c35c8d32ac96edfdf90c 100644 (file)
@@ -154,8 +154,8 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
         ol2.addComponent(commit);
         status.addComponent(ol2);
 
-        status.getSize().setHeight(300);
-        status.getSize().setWidth(400);
+        status.setHeight(300);
+        status.setWidth(400);
 
         ol.addComponent(status);
 
index 1ea7ee2da85cb030c1cfd388909d7dd3d8259685..71884144dbfed5d1333ce3b53d60d67ebda6bae3 100644 (file)
@@ -134,8 +134,8 @@ public class TestForTrees extends CustomComponent implements Handler {
         });
         status.addComponent(clear);
 
-        status.getSize().setHeight(300);
-        status.getSize().setWidth(400);
+        status.setHeight(300);
+        status.setWidth(400);
 
         ol.addComponent(status);
 
index 90099eecc75d77225b51ef320419acc60f33df91..137e48a0c2be0c44690abba5f87917dcb5596d17 100644 (file)
@@ -115,6 +115,13 @@ public abstract class AbstractComponent implements Component, MethodEventSource
 
     private String testingId;
 
+    /* Sizeable fields */
+
+    private int width = SIZE_UNDEFINED;
+    private int height = SIZE_UNDEFINED;
+    private int widthUnit = UNITS_PIXELS;
+    private int heightUnit = UNITS_PIXELS;
+
     /* Constructor ***************************************************** */
 
     /**
@@ -576,6 +583,15 @@ public abstract class AbstractComponent implements Component, MethodEventSource
 
             // Paint the contents of the component
 
+            if (getHeight() >= 0) {
+                target.addAttribute("height", "" + getHeight()
+                        + UNIT_SYMBOLS[getHeightUnits()]);
+            }
+            if (getWidth() >= 0) {
+                target.addAttribute("width", "" + getWidth()
+                        + UNIT_SYMBOLS[getWidthUnits()]);
+            }
+
             if (styles != null && styles.size() > 0) {
                 target.addAttribute("style", getStyle());
             }
@@ -979,4 +995,118 @@ public abstract class AbstractComponent implements Component, MethodEventSource
     public Object getData() {
         return applicationData;
     }
+
+    /* Sizeable and other size related methods */
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#getHeight()
+     */
+    public int getHeight() {
+        return height;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#getHeightUnits()
+     */
+    public int getHeightUnits() {
+        return heightUnit;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#getWidth()
+     */
+    public int getWidth() {
+        return width;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#getWidthUnits()
+     */
+    public int getWidthUnits() {
+        return widthUnit;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#setHeight(int)
+     */
+    public void setHeight(int height) {
+        this.height = height;
+        requestRepaint();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#setHeightUnits(int)
+     */
+    public void setHeightUnits(int unit) {
+        heightUnit = unit;
+        requestRepaint();
+    }
+
+    public void setHeight(int height, int unit) {
+        setHeight(height);
+        setHeightUnits(unit);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#setSizeFull()
+     */
+    public void setSizeFull() {
+        height = 100;
+        width = 100;
+        heightUnit = UNITS_PERCENTAGE;
+        widthUnit = UNITS_PERCENTAGE;
+        requestRepaint();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#setSizeUndefined()
+     */
+    public void setSizeUndefined() {
+        height = -1;
+        width = -1;
+        heightUnit = UNITS_PIXELS;
+        widthUnit = UNITS_PIXELS;
+        requestRepaint();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#setWidth(int)
+     */
+    public void setWidth(int width) {
+        this.width = width;
+        requestRepaint();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see com.itmill.toolkit.terminal.Sizeable#setWidthUnits(int)
+     */
+    public void setWidthUnits(int unit) {
+        widthUnit = unit;
+        requestRepaint();
+    }
+
+    public void setWidth(int width, int unit) {
+        setWidth(width);
+        setWidthUnits(unit);
+    }
 }
\ No newline at end of file
index a0cfe3338f8d81f182cbe2b07a942b6dad3f1ac2..032f45c283074ec76b32b11fa17fbe0c040d2278 100644 (file)
@@ -13,6 +13,7 @@ import com.itmill.toolkit.Application;
 import com.itmill.toolkit.terminal.ErrorMessage;
 import com.itmill.toolkit.terminal.Paintable;
 import com.itmill.toolkit.terminal.Resource;
+import com.itmill.toolkit.terminal.Sizeable;
 import com.itmill.toolkit.terminal.VariableOwner;
 
 /**
@@ -24,7 +25,7 @@ import com.itmill.toolkit.terminal.VariableOwner;
  * @VERSION@
  * @since 3.0
  */
-public interface Component extends Paintable, VariableOwner {
+public interface Component extends Paintable, VariableOwner, Sizeable {
 
     /**
      * Gets style for component. Multiple styles are joined with spaces.
index 2deec9aedd49c23f9946a7a9f068ba330c987e0a..27c99f2f5c204b3a07eb47ee9e2cc1f7605dd2b0 100644 (file)
@@ -507,4 +507,56 @@ public class CustomComponent implements Component {
         return testingId;
     }
 
+    // TODO bridge sizeable methods to composition root and documentate
+
+    public int getHeight() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getHeightUnits() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getWidth() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getWidthUnits() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public void setHeight(int height) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void setHeightUnits(int units) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void setSizeFull() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void setSizeUndefined() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void setWidth(int width) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void setWidthUnits(int units) {
+        // TODO Auto-generated method stub
+
+    }
+
 }
index 4fff2c9e10024338a2bb504b7ccd48dc6008848a..2b4ea0d481037b62b8888ba175823c542562e224 100644 (file)
@@ -7,10 +7,8 @@ package com.itmill.toolkit.ui;
 import java.util.HashMap;
 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.Size;
 
 /**
  * <p>
@@ -39,7 +37,7 @@ import com.itmill.toolkit.terminal.Size;
  * @VERSION@
  * @since 3.0
  */
-public class CustomLayout extends AbstractLayout implements HasSize {
+public class CustomLayout extends AbstractLayout {
 
     /**
      * Custom layout slots containing the components.
@@ -48,14 +46,11 @@ public class CustomLayout extends AbstractLayout implements HasSize {
 
     private String templateName;
 
-    private Size size;
-
     /**
      * Constructor for custom layout with given template name.
      */
     public CustomLayout(String template) {
         templateName = template;
-        size = new Size(this);
     }
 
     /**
@@ -157,9 +152,6 @@ public class CustomLayout extends AbstractLayout implements HasSize {
     public void paintContent(PaintTarget target) throws PaintException {
         super.paintContent(target);
 
-        // Size
-        size.paint(target);
-
         target.addAttribute("template", templateName);
         // Adds all items in all the locations
         for (final Iterator i = slots.keySet().iterator(); i.hasNext();) {
@@ -260,8 +252,4 @@ public class CustomLayout extends AbstractLayout implements HasSize {
                 "CustomLayout does not support margins.");
     }
 
-    public Size getSize() {
-        return size;
-    }
-
 }
index cc47ab10f3f1fb3726e15f35a97143b30eb4ab74..92736e18da1f65c808c48b4f87b7f538d5fb367d 100644 (file)
@@ -7,11 +7,9 @@ package com.itmill.toolkit.ui;
 import java.util.Hashtable;
 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.Resource;
-import com.itmill.toolkit.terminal.Size;
 
 /**
  * Component for embedding external objects.
@@ -21,7 +19,7 @@ import com.itmill.toolkit.terminal.Size;
  * @VERSION@
  * @since 3.0
  */
-public class Embedded extends AbstractComponent implements HasSize {
+public class Embedded extends AbstractComponent {
 
     /**
      * General object type.
@@ -71,8 +69,6 @@ public class Embedded extends AbstractComponent implements HasSize {
 
     private String archive = null;
 
-    private Size size = new Size(this);
-
     /**
      * Creates a new empty Embedded object.
      */
@@ -116,8 +112,6 @@ public class Embedded extends AbstractComponent implements HasSize {
      */
     public void paintContent(PaintTarget target) throws PaintException {
 
-        size.paint(target);
-
         switch (type) {
         case TYPE_IMAGE:
             target.addAttribute("type", "image");
@@ -417,66 +411,4 @@ public class Embedded extends AbstractComponent implements HasSize {
         }
     }
 
-    public Size getSize() {
-        return size;
-    }
-
-    /* Compatibility methods for previous Sizeable interface */
-
-    /**
-     * @deprecated use Size object instead (getSize().setWidth()).
-     */
-    public void setWidth(int width) {
-        size.setWidth(width);
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().setWidthUnits()).
-     */
-    public void setWidthUnits(int unit) {
-        size.setWidthUnits(unit);
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().setHeight()).
-     */
-    public void setHeight(int height) {
-        size.setHeight(height);
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().setHeightUnits()).
-     */
-    public void setHeightUnits(int unit) {
-        size.setHeightUnits(unit);
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().getWidth()).
-     */
-    public int getWidth() {
-        return size.getWidth();
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().getWidthUnits()).
-     */
-    public int getWidthUnits() {
-        return size.getWidthUnits();
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().getHeight()).
-     */
-    public int getHeight() {
-        return size.getHeight();
-    }
-
-    /**
-     * @deprecated use Size object instead (getSize().getHeightUnits()).
-     */
-    public int getHeightUnits() {
-        return size.getHeightUnits();
-    }
-
 }
index 100fac872c33ede45d04a3435dc28ea78452916b..79cc69c1f187ea15a15475e421a9c96bb432b55c 100644 (file)
@@ -6,10 +6,8 @@ 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.Size;
 
 /**
  * TODO finish documentation
@@ -26,14 +24,12 @@ import com.itmill.toolkit.terminal.Size;
  * other components don't use. Or just provide expanded container.
  * 
  */
-public class ExpandLayout extends OrderedLayout implements HasSize {
+public class ExpandLayout extends OrderedLayout {
 
     private Component expanded;
-    private Size size;
 
     public ExpandLayout() {
-        size = new Size(this);
-        size.setSizeFull();
+        setSizeFull();
     }
 
     public ExpandLayout(int orientation) {
@@ -64,9 +60,6 @@ public class ExpandLayout extends OrderedLayout implements HasSize {
             target.addAttribute("spacing", true);
         }
 
-        // Size
-        size.paint(target);
-
         // Adds the attributes: orientation
         // note that the default values (b/vertival) are omitted
         if (getOrientation() == ORIENTATION_HORIZONTAL) {
@@ -133,8 +126,4 @@ public class ExpandLayout extends OrderedLayout implements HasSize {
         }
     }
 
-    public Size getSize() {
-        return size;
-    }
-
 }
index 990ba634e218f4034ea643cb2f6fa94e6a3fa39f..532560fdfaa4f8a283088e5acca4a8a637445158 100644 (file)
@@ -10,10 +10,8 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Map;
 
-import com.itmill.toolkit.terminal.HasSize;
 import com.itmill.toolkit.terminal.PaintException;
 import com.itmill.toolkit.terminal.PaintTarget;
-import com.itmill.toolkit.terminal.Size;
 import com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo;
 
 /**
@@ -36,7 +34,7 @@ import com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo;
  * @VERSION@
  * @since 3.0
  */
-public class GridLayout extends AbstractLayout implements HasSize {
+public class GridLayout extends AbstractLayout {
 
     /**
      * Initial grid columns.
@@ -111,11 +109,6 @@ public class GridLayout extends AbstractLayout implements HasSize {
      */
     private boolean spacing = false;
 
-    /**
-     * Sizing object.
-     */
-    private Size size;
-
     /**
      * Constructor for grid of given size (number of cells). Note that grid's
      * final size depends on the items that are added into the grid. Grid grows
@@ -129,7 +122,6 @@ public class GridLayout extends AbstractLayout implements HasSize {
     public GridLayout(int columns, int rows) {
         setColumns(columns);
         setRows(rows);
-        size = new Size(this);
     }
 
     /**
@@ -393,9 +385,6 @@ public class GridLayout extends AbstractLayout implements HasSize {
 
         super.paintContent(target);
 
-        // Size
-        size.paint(target);
-
         // TODO refactor attribute names in future release.
         target.addAttribute("h", rows);
         target.addAttribute("w", cols);
@@ -1026,8 +1015,4 @@ public class GridLayout extends AbstractLayout implements HasSize {
         spacing = enabled;
     }
 
-    public Size getSize() {
-        return size;
-    }
-
 }
index 22f87ac220391a954d6d2a3b074b2ee3a03face4..a155759761fbca9c5d4c809b508df6c11c64ef8b 100644 (file)
@@ -11,12 +11,10 @@ import java.util.Map;
 import com.itmill.toolkit.event.Action;
 import com.itmill.toolkit.event.ShortcutAction;
 import com.itmill.toolkit.event.Action.Handler;
-import com.itmill.toolkit.terminal.HasSize;
 import com.itmill.toolkit.terminal.KeyMapper;
 import com.itmill.toolkit.terminal.PaintException;
 import com.itmill.toolkit.terminal.PaintTarget;
 import com.itmill.toolkit.terminal.Scrollable;
-import com.itmill.toolkit.terminal.Size;
 
 /**
  * Panel - a simple single component container.
@@ -26,15 +24,13 @@ import com.itmill.toolkit.terminal.Size;
  * @VERSION@
  * @since 3.0
  */
-public class Panel extends AbstractComponentContainer implements HasSize,
-        Scrollable, ComponentContainer.ComponentAttachListener,
+public class Panel extends AbstractComponentContainer implements Scrollable,
+        ComponentContainer.ComponentAttachListener,
         ComponentContainer.ComponentDetachListener, Action.Container {
 
     public static final String STYLE_LIGHT = "light";
 
     public static final String STYLE_EMPHASIZE = "emphasize";
-    
-    private Size size;
 
     /**
      * Layout of the panel.
@@ -67,7 +63,6 @@ public class Panel extends AbstractComponentContainer implements HasSize,
      */
     public Panel() {
         setLayout(null);
-        size = new Size(this);
     }
 
     /**
@@ -78,7 +73,6 @@ public class Panel extends AbstractComponentContainer implements HasSize,
      */
     public Panel(Layout layout) {
         setLayout(layout);
-        size = new Size(this);
     }
 
     /**
@@ -102,7 +96,6 @@ public class Panel extends AbstractComponentContainer implements HasSize,
     public Panel(String caption, Layout layout) {
         this(layout);
         setCaption(caption);
-        size = new Size(this);
     }
 
     /**
@@ -169,13 +162,13 @@ public class Panel extends AbstractComponentContainer implements HasSize,
         layout.paint(target);
 
         // Add size info as variables
-        if (size.getHeight() > -1) {
-            target.addVariable(this, "height", size.getHeight()
-                    + Size.UNIT_SYMBOLS[size.getHeightUnits()]);
+        if (getHeight() > -1) {
+            target.addVariable(this, "height", getHeight()
+                    + UNIT_SYMBOLS[getHeightUnits()]);
         }
-        if (size.getWidth() > -1) {
-            target.addVariable(this, "width", size.getWidth()
-                    + Size.UNIT_SYMBOLS[size.getWidthUnits()]);
+        if (getWidth() > -1) {
+            target.addVariable(this, "width", getWidth()
+                    + UNIT_SYMBOLS[getWidthUnits()]);
         }
 
         if (isScrollable()) {
@@ -282,16 +275,16 @@ public class Panel extends AbstractComponentContainer implements HasSize,
         // Get new size
         final Integer newWidth = (Integer) variables.get("width");
         final Integer newHeight = (Integer) variables.get("height");
-        if (newWidth != null && newWidth.intValue() != size.getWidth()) {
-            size.setWidth(newWidth.intValue());
+        if (newWidth != null && newWidth.intValue() != getWidth()) {
+            setWidth(newWidth.intValue());
             // ensure units, as we are reading pixels
-            size.setWidthUnits(Size.UNITS_PIXELS);
+            setWidthUnits(UNITS_PIXELS);
 
         }
-        if (newHeight != null && newHeight.intValue() != size.getHeight()) {
-            size.setHeight(newHeight.intValue());
+        if (newHeight != null && newHeight.intValue() != getHeight()) {
+            setHeight(newHeight.intValue());
             // ensure units, as we are reading pixels
-            size.setHeightUnits(Size.UNITS_PIXELS);
+            setHeightUnits(UNITS_PIXELS);
         }
 
         // Scrolling
@@ -462,68 +455,4 @@ public class Panel extends AbstractComponentContainer implements HasSize,
             requestRepaint();
         }
     }
-
-    public Size getSize() {
-        return size;
-    }
-    
-    
-    /* Compatibility methods */
-    
-    /**
-     * @deprecated use Size object instead (getSize().setWidth()).
-     */
-    public void setWidth(int width) {
-        size.setWidth(width);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().setWidthUnits()).
-     */
-    public void setWidthUnits(int unit) {
-        size.setWidthUnits(unit);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().setHeight()).
-     */
-    public void setHeight(int height) {
-        size.setHeight(height);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().setHeightUnits()).
-     */
-    public void setHeightUnits(int unit) {
-        size.setHeightUnits(unit);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getWidth()).
-     */
-    public int getWidth() {
-        return size.getWidth();
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getWidthUnits()).
-     */
-    public int getWidthUnits() {
-        return size.getWidthUnits();
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getHeight()).
-     */
-    public int getHeight() {
-        return size.getHeight();
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getHeightUnits()).
-     */
-    public int getHeightUnits() {
-        return size.getHeightUnits();
-    }
-
 }
index 2ec748f3e105f802d7339ccb116769eb4d4ea789..dd4c96c4b942e90e580e56a9673f91c3ce1a6ff0 100644 (file)
@@ -6,10 +6,8 @@ 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.Size;
 
 /**
  * SplitPanel.
@@ -22,7 +20,7 @@ import com.itmill.toolkit.terminal.Size;
  * @VERSION@
  * @since 5.0
  */
-public class SplitPanel extends AbstractLayout implements HasSize {
+public class SplitPanel extends AbstractLayout {
 
     /* Predefined orientations ***************************************** */
 
@@ -47,9 +45,7 @@ public class SplitPanel extends AbstractLayout implements HasSize {
 
     private int pos = 50;
 
-    private int posUnit = Size.UNITS_PERCENTAGE;
-
-    private Size size;
+    private int posUnit = UNITS_PERCENTAGE;
 
     /**
      * Creates a new split panel. The orientation of the panels is
@@ -57,8 +53,7 @@ public class SplitPanel extends AbstractLayout implements HasSize {
      */
     public SplitPanel() {
         orientation = ORIENTATION_VERTICAL;
-        size = new Size(this);
-        size.setSizeFull();
+        setSizeFull();
     }
 
     /**
@@ -198,9 +193,7 @@ public class SplitPanel extends AbstractLayout implements HasSize {
     public void paintContent(PaintTarget target) throws PaintException {
         super.paintContent(target);
 
-        size.paint(target);
-
-        final String position = pos + Size.UNIT_SYMBOLS[posUnit];
+        final String position = pos + UNIT_SYMBOLS[posUnit];
 
         target.addAttribute("position", position);
 
@@ -260,7 +253,7 @@ public class SplitPanel extends AbstractLayout implements HasSize {
      *                the new size of the first region in persentage
      */
     public void setSplitPosition(int pos) {
-        setSplitPosition(pos, Size.UNITS_PERCENTAGE);
+        setSplitPosition(pos, UNITS_PERCENTAGE);
     }
 
     /**
@@ -269,16 +262,11 @@ public class SplitPanel extends AbstractLayout implements HasSize {
      * @param pos
      *                size of the first region
      * @param unit
-     *                the unit (from {@link Size}) in which the size is
-     *                given.
+     *                the unit (from {@link Size}) in which the size is given.
      */
     public void setSplitPosition(int pos, int unit) {
         this.pos = pos;
         posUnit = unit;
     }
 
-    public Size getSize() {
-        return size;
-    }
-
 }
index 4780a8702d0ee18132f1e6958d4afc1336174201..7f26853d37d922bd12a638b44464ac4570d0c2e1 100644 (file)
@@ -10,12 +10,10 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Map;
 
-import com.itmill.toolkit.terminal.HasSize;
 import com.itmill.toolkit.terminal.KeyMapper;
 import com.itmill.toolkit.terminal.PaintException;
 import com.itmill.toolkit.terminal.PaintTarget;
 import com.itmill.toolkit.terminal.Resource;
-import com.itmill.toolkit.terminal.Size;
 
 /**
  * Tabsheet component.
@@ -25,7 +23,7 @@ import com.itmill.toolkit.terminal.Size;
  * @VERSION@
  * @since 3.0
  */
-public class TabSheet extends AbstractComponentContainer implements HasSize {
+public class TabSheet extends AbstractComponentContainer {
 
     /**
      * Linked list of component tabs.
@@ -54,15 +52,12 @@ public class TabSheet extends AbstractComponentContainer implements HasSize {
      */
     private boolean tabsHidden;
 
-    private Size size;
-
     /**
      * Constructs a new Tabsheet. Tabsheet is immediate by default.
      */
     public TabSheet() {
         super();
         setImmediate(true);
-        size = new Size(this);
     }
 
     /**
@@ -177,9 +172,6 @@ public class TabSheet extends AbstractComponentContainer implements HasSize {
      */
     public void paintContent(PaintTarget target) throws PaintException {
 
-        // Size
-        size.paint(target);
-
         if (areTabsHidden()) {
             target.addAttribute("hidetabs", true);
         }
@@ -482,8 +474,4 @@ public class TabSheet extends AbstractComponentContainer implements HasSize {
         fireEvent(new SelectedTabChangeEvent(this));
     }
 
-    public Size getSize() {
-        return size;
-    }
-
 }
index 5dbadf6d9c371a9acf17c62b115d91f9154169fc..9de28bbb17544b495c082c472d31bb9d498cec77 100644 (file)
@@ -21,12 +21,10 @@ import com.itmill.toolkit.data.Property;
 import com.itmill.toolkit.data.util.ContainerOrderedWrapper;
 import com.itmill.toolkit.data.util.IndexedContainer;
 import com.itmill.toolkit.event.Action;
-import com.itmill.toolkit.terminal.HasSize;
 import com.itmill.toolkit.terminal.KeyMapper;
 import com.itmill.toolkit.terminal.PaintException;
 import com.itmill.toolkit.terminal.PaintTarget;
 import com.itmill.toolkit.terminal.Resource;
-import com.itmill.toolkit.terminal.Size;
 
 /**
  * <code>TableComponent</code> is used for representing data or components in
@@ -38,7 +36,7 @@ import com.itmill.toolkit.terminal.Size;
  * @since 3.0
  */
 public class Table extends AbstractSelect implements Action.Container,
-        Container.Ordered, Container.Sortable, HasSize {
+        Container.Ordered, Container.Sortable {
 
     private static final int CELL_KEY = 0;
 
@@ -50,8 +48,6 @@ public class Table extends AbstractSelect implements Action.Container,
 
     private static final int CELL_FIRSTCOL = 4;
 
-    private Size size;
-
     /**
      * Left column alignment. <b>This is the default behaviour. </b>
      */
@@ -291,7 +287,6 @@ public class Table extends AbstractSelect implements Action.Container,
      */
     public Table() {
         setRowHeaderMode(ROW_HEADER_MODE_HIDDEN);
-        size = new Size(this);
     }
 
     /**
@@ -1405,9 +1400,6 @@ public class Table extends AbstractSelect implements Action.Container,
             target.addAttribute("tabindex", getTabIndex());
         }
 
-        // Size
-        size.paint(target);
-
         // Initialize temps
         final Object[] colids = getVisibleColumns();
         final int cols = colids.length;
@@ -2428,66 +2420,4 @@ public class Table extends AbstractSelect implements Action.Container,
         }
     }
 
-    public Size getSize() {
-        return size;
-    }
-    
-    /* Compatibility methods */
-    
-    /**
-     * @deprecated use Size object instead (getSize().setWidth()).
-     */
-    public void setWidth(int width) {
-        size.setWidth(width);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().setWidthUnits()).
-     */
-    public void setWidthUnits(int unit) {
-        size.setWidthUnits(unit);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().setHeight()).
-     */
-    public void setHeight(int height) {
-        size.setHeight(height);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().setHeightUnits()).
-     */
-    public void setHeightUnits(int unit) {
-        size.setHeightUnits(unit);
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getWidth()).
-     */
-    public int getWidth() {
-        return size.getWidth();
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getWidthUnits()).
-     */
-    public int getWidthUnits() {
-        return size.getWidthUnits();
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getHeight()).
-     */
-    public int getHeight() {
-        return size.getHeight();
-    }
-    
-    /**
-     * @deprecated use Size object instead (getSize().getHeightUnits()).
-     */
-    public int getHeightUnits() {
-        return size.getHeightUnits();
-    }
-
 }
\ No newline at end of file