001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui;
032:
033: public class UnTableCellSpan {
034:
035: private int pem_RowIndex = -1;
036:
037: private int pem_RowSpan = 1;
038:
039: private int pem_ColumnIndex = -1;
040:
041: private int pem_ColumnSpan = 1;
042:
043: /**
044: * Creates a key values for map lookup
045: */
046: public String pcmf_getKey() {
047: return (pcmf_getKey(this .pem_RowIndex, this .pem_ColumnIndex));
048: }
049:
050: public static String pcmf_getKey(int xRow, int xCol) {
051: StringBuffer l_buf = new StringBuffer(Integer.toString(xRow));
052: l_buf.append(':');
053: l_buf.append(Integer.toString(xCol));
054:
055: return (l_buf.toString());
056: }
057:
058: /*
059: * (non-Javadoc)
060: *
061: * @see java.lang.Object#toString()
062: */
063: public String toString() {
064: return "Row=" + pem_RowIndex + ", Column=" + pem_ColumnIndex
065: + " span=" + pem_RowSpan + " rows, " + pem_ColumnSpan
066: + " columns";
067: }
068:
069: /**
070: * Default Constructor.
071: */
072: public UnTableCellSpan() {
073: super ();
074: }
075:
076: /**
077: * Constructor with defining span values.
078: *
079: * @param xrow
080: * @param xcolumn
081: * @param xrowSpan
082: * @param xcolumnSpan
083: */
084: public UnTableCellSpan(int xrow, int xcolumn, int xrowSpan,
085: int xcolumnSpan) {
086: super ();
087: this .pem_RowIndex = xrow;
088: this .pem_ColumnIndex = xcolumn;
089: this .pem_RowSpan = xrowSpan > 1 ? xrowSpan : 1;
090: this .pem_ColumnSpan = xcolumnSpan > 1 ? xcolumnSpan : 1;
091: }
092:
093: /**
094: * @return Returns the pem_ColumnIndex.
095: */
096: public int pcmf_getColumnIndex() {
097: return pem_ColumnIndex;
098: }
099:
100: /**
101: * @param pem_ColumnIndex The pem_ColumnIndex to set.
102: */
103: public void pcmf_setColumnIndex(int pem_ColumnIndex) {
104: this .pem_ColumnIndex = pem_ColumnIndex;
105: }
106:
107: /**
108: * @return Returns the pem_ColumnSpan.
109: */
110: public int pcmf_getColumnSpan() {
111: return pem_ColumnSpan;
112: }
113:
114: /**
115: * @param pem_ColumnSpan The pem_ColumnSpan to set.
116: */
117: public void pcmf_setColumnSpan(int pem_ColumnSpan) {
118: this .pem_ColumnSpan = pem_ColumnSpan;
119: }
120:
121: /**
122: * @return Returns the pem_RowIndex.
123: */
124: public int pcmf_getRowIndex() {
125: return pem_RowIndex;
126: }
127:
128: /**
129: * @param pem_RowIndex The pem_RowIndex to set.
130: */
131: public void pcmf_setRowIndex(int pem_RowIndex) {
132: this .pem_RowIndex = pem_RowIndex;
133: }
134:
135: /**
136: * @return Returns the pem_RowSpan.
137: */
138: public int pcmf_getRowSpan() {
139: return pem_RowSpan;
140: }
141:
142: /**
143: * @param pem_RowSpan The pem_RowSpan to set.
144: */
145: public void pcmf_setRowSpan(int pem_RowSpan) {
146: this .pem_RowSpan = pem_RowSpan;
147: }
148:
149: public String pcmf_Key() {
150: return pcmf_getRowIndex() + "," + pcmf_getColumnIndex();
151: }
152: }
|