001: /*
002: * MyGWT Widget Library
003: * Copyright(c) 2007, MyGWT.
004: * licensing@mygwt.net
005: *
006: * http://mygwt.net/license
007: */
008: package net.mygwt.ui.client.widget.layout;
009:
010: /**
011: * Layout data for <code>TableLayout</code>.
012: */
013: public class TableLayoutData {
014:
015: /**
016: * Left horizontal alignment.
017: */
018: public static final String ALIGN_LEFT = "left";
019:
020: /**
021: * Center horizontal alignment.
022: */
023: public static final String ALIGN_CENTER = "center";
024:
025: /**
026: * Right horizontal alignment.
027: */
028: public static final String ALIGN_RIGHT = "right";
029:
030: /**
031: * Left vertical alignment.
032: */
033: public static final String ALIGN_TOP = "top";
034:
035: /**
036: * Center vertical alignment.
037: */
038: public static final String ALIGN_MIDDLE = "middle";
039:
040: /**
041: * Right vertical alignment.
042: */
043: public static final String ALIGN_BOTTOM = "bottom";
044:
045: int colspan = 1;
046: int padding;
047: int margin;
048: String style;
049: String align;
050: String valign;
051: String width;
052: String height;
053:
054: /**
055: * Creates a new table layout instance.
056: */
057: public TableLayoutData() {
058:
059: }
060:
061: /**
062: * Creates a new table layout instance with the given colspan.
063: *
064: * @param colspan the colspan
065: */
066: public TableLayoutData(int colspan) {
067: this .colspan = colspan;
068: }
069:
070: /**
071: * Returns the cell's alignment.
072: *
073: * @return the alignment
074: */
075: public String getAlign() {
076: return align;
077: }
078:
079: /**
080: * Returns the number of columns
081: *
082: * @return the col span
083: */
084: public int getColspan() {
085: return colspan;
086: }
087:
088: /**
089: * Returns the cell's height.
090: *
091: * @return the cell height
092: */
093: public String getHeight() {
094: return height;
095: }
096:
097: /**
098: * Sets the cell's margin.
099: *
100: * @return the margin
101: */
102: public int getMargin() {
103: return margin;
104: }
105:
106: /**
107: * Returns the cell's padding.
108: *
109: * @return the padding
110: */
111: public int getPadding() {
112: return padding;
113: }
114:
115: /**
116: * Returns the cell's style.
117: *
118: * @return the cell style
119: */
120: public String getStyle() {
121: return style;
122: }
123:
124: /**
125: * Returns the cell's vertical alignment.
126: *
127: * @return the vertical aligment
128: */
129: public String getValign() {
130: return valign;
131: }
132:
133: /**
134: * Returns the cell's width.
135: *
136: * @return the cell's width
137: */
138: public String getWidth() {
139: return width;
140: }
141:
142: /**
143: * Sets the cell's horiztonal alignment.
144: *
145: * @param align the alignment
146: */
147: public void setAlign(String align) {
148: this .align = align;
149: }
150:
151: /**
152: * Sets the number of columns to span. Default value is 1.
153: *
154: * @param colspan the col span
155: */
156: public void setColspan(int colspan) {
157: this .colspan = colspan;
158: }
159:
160: /**
161: * Sets the cell's height.
162: *
163: * @param height the cell height
164: */
165: public void setHeight(String height) {
166: this .height = height;
167: }
168:
169: /**
170: * Returns the cell's margin. Default value is 0.
171: *
172: * @param margin the margin
173: */
174: public void setMargin(int margin) {
175: this .margin = margin;
176: }
177:
178: /**
179: * Sets the cell's padding. Default value is 0.
180: *
181: * @param padding the cell padding
182: */
183: public void setPadding(int padding) {
184: this .padding = padding;
185: }
186:
187: /**
188: * Sets the cell's style.
189: *
190: * @param style the style
191: */
192: public void setStyle(String style) {
193: this .style = style;
194: }
195:
196: /**
197: * Sets the cell's vertical alignment.
198: *
199: * @param valign the vertical alignment
200: */
201: public void setVAlign(String valign) {
202: this .valign = valign;
203: }
204:
205: /**
206: * Sets the cell's width.
207: *
208: * @param width the width
209: */
210: public void setWidth(String width) {
211: this.width = width;
212: }
213:
214: }
|