001: /*
002: * Copyright 2005 jWic group (http://www.jwic.de)
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: *
016: * de.jwic.controls.layout.GridData
017: * Created on 05.06.2005
018: * $Id: TableData.java,v 1.2 2006/08/14 09:35:00 lordsam Exp $
019: */
020: package de.jwic.controls.layout;
021:
022: import java.io.Serializable;
023:
024: /**
025: * The TableData class is intended to hold specific layoutdata
026: * of a single control. <p>
027: *
028: * The TableData is used in the TableLayoutContainer to layout the
029: * controls. At the moment simple layoutinfos like align, width,
030: * height etc. are possible. <br>
031: *
032: * @author Ronny Pfretzschner
033: * @author Florian Lippisch
034: */
035: public class TableData implements Serializable {
036:
037: private static final long serialVersionUID = 1L;
038:
039: public final static String ALIGN_TOP = "top";
040: public final static String ALIGN_BOTTOM = "bottom";
041:
042: public final static String ALIGN_LEFT = "left";
043: public final static String ALIGN_RIGHT = "right";
044: public final static String ALIGN_CENTER = "center";
045:
046: private String width = "";
047: private String height = "";
048: private String align = ""; // default
049: private String vAlign = ""; // default
050: private String sCSSClass = "";
051:
052: private int colSpan = 1;
053: private int rowSpan = 1;
054:
055: /**
056: * Default Constructor.
057: *
058: */
059: public TableData() {
060:
061: }
062:
063: /**
064: * Construct a new TableData with a specified alignment, row- and colspan.
065: * @param align
066: * @param colSpan
067: * @param rowSpan
068: */
069: public TableData(String align, int colSpan, int rowSpan) {
070: this .align = align;
071: if (colSpan < 1)
072: colSpan = 1;
073: if (rowSpan < 1)
074: rowSpan = 1;
075:
076: this .colSpan = colSpan;
077: this .rowSpan = rowSpan;
078: }
079:
080: /**
081: * Construct a new TableData with a specified alignment, row- and colspan.
082: * @param align
083: * @param colSpan
084: * @param rowSpan
085: */
086: public TableData(String align, String valign, int colSpan,
087: int rowSpan) {
088: this .align = align;
089: this .vAlign = valign;
090: if (colSpan < 1)
091: colSpan = 1;
092: if (rowSpan < 1)
093: rowSpan = 1;
094:
095: this .colSpan = colSpan;
096: this .rowSpan = rowSpan;
097: }
098:
099: /**
100: * @return Returns the align.
101: */
102: public String getAlign() {
103: return align;
104: }
105:
106: /**
107: * @param align The align to set.
108: */
109: public void setAlign(String align) {
110: this .align = align;
111: }
112:
113: /**
114: * If the property grabVerticalSize is set true,
115: * this returns 100%.
116: *
117: * @return Returns the height.
118: */
119: public String getHeight() {
120: return height;
121: }
122:
123: /**
124: * @param height The height to set.
125: */
126: public void setHeight(String height) {
127: this .height = height;
128: }
129:
130: /**
131: * If the property grabHorizontalSize is set true,
132: * this returns 100%.
133: *
134: * @return Returns the width.
135: */
136: public String getWidth() {
137: return width;
138: }
139:
140: /**
141: * @param width The width to set.
142: */
143: public void setWidth(String width) {
144: this .width = width;
145: }
146:
147: /**
148: * @return Returns the colSpan.
149: */
150: public int getColSpan() {
151: return colSpan;
152: }
153:
154: /**
155: * @param colSpan The colSpan to set.
156: */
157: public void setColSpan(int colSpan) {
158: this .colSpan = colSpan;
159: }
160:
161: /**
162: * @return Returns the rowSpan.
163: */
164: public int getRowSpan() {
165: return rowSpan;
166: }
167:
168: /**
169: * @param rowSpan The rowSpan to set.
170: */
171: public void setRowSpan(int rowSpan) {
172: this .rowSpan = rowSpan;
173: }
174:
175: /**
176: * @return Returns the vAlign.
177: */
178: public String getVAlign() {
179: return vAlign;
180: }
181:
182: /**
183: * @param align The vAlign to set.
184: */
185: public void setVAlign(String align) {
186: vAlign = align;
187: }
188:
189: /**
190: * @return Returns the sCSSClass.
191: */
192: public String getCSSClass() {
193: return sCSSClass;
194: }
195:
196: /**
197: * @param class1 The sCSSClass to set.
198: */
199: public void setCSSClass(String cssClass) {
200: sCSSClass = cssClass;
201: }
202: }
|