01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08:
09: package com.gwtext.client.core;
10:
11: import com.google.gwt.core.client.JavaScriptObject;
12: import com.gwtext.client.util.JavaScriptObjectHelper;
13:
14: /**
15: * This class represents the size of an element.
16: *
17: * @see ExtElement#getSize()
18: */
19: public class Size {
20:
21: private float height;
22: private float width;
23:
24: public Size() {
25: }
26:
27: /**
28: * Create a new instance.
29: *
30: * @param width element width
31: * @param height element height
32: */
33: public Size(int width, int height) {
34: this .width = width;
35: this .height = height;
36: }
37:
38: private static Size instance(JavaScriptObject jsObj) {
39: return new Size(JavaScriptObjectHelper.getAttributeAsInt(jsObj,
40: "width"), JavaScriptObjectHelper.getAttributeAsInt(
41: jsObj, "height"));
42: }
43:
44: /**
45: * @return the height
46: */
47: public float getHeight() {
48: return height;
49: }
50:
51: /**
52: * @param height the height
53: */
54: public void setHeight(float height) {
55: this .height = height;
56: }
57:
58: /**
59: * @return the width
60: */
61: public float getWidth() {
62: return width;
63: }
64:
65: /**
66: * @param width the width
67: */
68: public void setWidth(float width) {
69: this.width = width;
70: }
71: }
|