01: /*
02: * This file is part of the Echo Web Application Framework (hereinafter "Echo").
03: * Copyright (C) 2002-2005 NextApp, Inc.
04: *
05: * Version: MPL 1.1/GPL 2.0/LGPL 2.1
06: *
07: * The contents of this file are subject to the Mozilla Public License Version
08: * 1.1 (the "License"); you may not use this file except in compliance with
09: * the License. You may obtain a copy of the License at
10: * http://www.mozilla.org/MPL/
11: *
12: * Software distributed under the License is distributed on an "AS IS" basis,
13: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14: * for the specific language governing rights and limitations under the
15: * License.
16: *
17: * Alternatively, the contents of this file may be used under the terms of
18: * either the GNU General Public License Version 2 or later (the "GPL"), or
19: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
20: * in which case the provisions of the GPL or the LGPL are applicable instead
21: * of those above. If you wish to allow use of your version of this file only
22: * under the terms of either the GPL or the LGPL, and not to allow others to
23: * use your version of this file under the terms of the MPL, indicate your
24: * decision by deleting the provisions above and replace them with the notice
25: * and other provisions required by the GPL or the LGPL. If you do not delete
26: * the provisions above, a recipient may use your version of this file under
27: * the terms of any one of the MPL, the GPL or the LGPL.
28: */
29:
30: package nextapp.echo2.app.layout;
31:
32: /**
33: * A <code>LayoutData</code> object used to describe how a
34: * <code>Component</code> is rendered within a <code>Grid</code>.
35: */
36: public class GridLayoutData extends CellLayoutData {
37:
38: /**
39: * A constant value for column and row spans indicating that a cell should
40: * fill all remaining cells.
41: * <p>
42: * <strong>WARNING</strong>: This value may ONLY be used for spans in the
43: * direction of the layout of the <code>Grid</code>, i.e., it may only be
44: * used for column-spans if the orientation is horizontal, and it may only
45: * be used for row-spans if the orientation is vertical.
46: */
47: public static final int SPAN_FILL = -1;
48:
49: private int columnSpan = 1;
50: private int rowSpan = 1;
51:
52: /**
53: * Returns the column span of the cell.
54: *
55: * @return the column span
56: */
57: public int getColumnSpan() {
58: return columnSpan;
59: }
60:
61: /**
62: * Returns the row span of the cell.
63: *
64: * @return the row span
65: */
66: public int getRowSpan() {
67: return rowSpan;
68: }
69:
70: /**
71: * Sets the column span of the cell.
72: *
73: * @param newValue the new column span
74: */
75: public void setColumnSpan(int newValue) {
76: columnSpan = newValue;
77: }
78:
79: /**
80: * Sets the row span of the cell.
81: *
82: * @param newValue the new row span
83: */
84: public void setRowSpan(int newValue) {
85: rowSpan = newValue;
86: }
87: }
|