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: package com.gwtext.client.core;
09:
10: import com.google.gwt.core.client.JavaScriptObject;
11: import com.gwtext.client.util.JavaScriptObjectHelper;
12:
13: /**
14: * This class represents an Elements Region.
15: *
16: * @see com.gwtext.client.core.ExtElement#setRegion(Region, boolean)
17: */
18: public class Region {
19:
20: private int top;
21: private int left;
22: private int right;
23: private int bottom;
24:
25: public Region(int top, int left, int right, int bottom) {
26: this .top = top;
27: this .left = left;
28: this .right = right;
29: this .bottom = bottom;
30: }
31:
32: public static Region instance(JavaScriptObject jsObj) {
33: return new Region(JavaScriptObjectHelper.getAttributeAsInt(
34: jsObj, "top"), JavaScriptObjectHelper
35: .getAttributeAsInt(jsObj, "left"),
36: JavaScriptObjectHelper
37: .getAttributeAsInt(jsObj, "right"),
38: JavaScriptObjectHelper.getAttributeAsInt(jsObj,
39: "bottom"));
40: }
41:
42: public int getTop() {
43: return top;
44: }
45:
46: public int getLeft() {
47: return left;
48: }
49:
50: public int getRight() {
51: return right;
52: }
53:
54: public int getBottom() {
55: return bottom;
56: }
57: }
|