001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * Group.java
028: *
029: */
030:
031: package it.businesslogic.ireport;
032:
033: public class Group {
034: private SubDataset parent;
035: private String name;
036: private String groupExpression = "";
037: private boolean isStartNewColumn = false;
038: private boolean isStartNewPage = false;
039: private boolean isResetPageNumber = false;
040: private boolean isReprintHeaderOnEachPage = false;
041: private int minHeightToStartNewPage = 0;
042:
043: private Band groupHeader = null;
044: private Band groupFooter = null;
045:
046: public Group(SubDataset parent, String name) {
047: this (parent, name, 0, 0);
048: }
049:
050: public Group(SubDataset parent, String name, int headerHeight,
051: int footerHeight) {
052: this .parent = parent;
053: this .name = name;
054: if (parent instanceof Report) {
055: groupFooter = new Band((Report) parent, name + "Footer",
056: headerHeight);
057: groupFooter.setGroup(this );
058: groupFooter.setGroupFooter(true);
059: groupHeader = new Band((Report) parent, name + "Header",
060: footerHeight);
061: groupHeader.setGroup(this );
062: groupHeader.setGroupHeader(true);
063: }
064: }
065:
066: /** Getter for property groupExpression.
067: * @return Value of property groupExpression.
068: *
069: */
070: public java.lang.String getGroupExpression() {
071: return groupExpression;
072: }
073:
074: /** Setter for property groupExpression.
075: * @param groupExpression New value of property groupExpression.
076: *
077: */
078: public void setGroupExpression(java.lang.String groupExpression) {
079: this .groupExpression = groupExpression;
080: }
081:
082: /** Getter for property groupFooter.
083: * @return Value of property groupFooter.
084: *
085: */
086: public it.businesslogic.ireport.Band getGroupFooter() {
087: return groupFooter;
088: }
089:
090: /** Setter for property groupFooter.
091: * @param groupFooter New value of property groupFooter.
092: *
093: */
094: public void setGroupFooter(it.businesslogic.ireport.Band groupFooter) {
095: this .groupFooter = groupFooter;
096: }
097:
098: /** Getter for property groupHeader.
099: * @return Value of property groupHeader.
100: *
101: */
102: public it.businesslogic.ireport.Band getGroupHeader() {
103: return groupHeader;
104: }
105:
106: /** Setter for property groupHeader.
107: * @param groupHeader New value of property groupHeader.
108: *
109: */
110: public void setGroupHeader(it.businesslogic.ireport.Band groupHeader) {
111: this .groupHeader = groupHeader;
112: }
113:
114: /** Getter for property isReprintHeaderOnEachPage.
115: * @return Value of property isReprintHeaderOnEachPage.
116: *
117: */
118: public boolean isIsReprintHeaderOnEachPage() {
119: return isReprintHeaderOnEachPage;
120: }
121:
122: /** Setter for property isReprintHeaderOnEachPage.
123: * @param isReprintHeaderOnEachPage New value of property isReprintHeaderOnEachPage.
124: *
125: */
126: public void setIsReprintHeaderOnEachPage(
127: boolean isReprintHeaderOnEachPage) {
128: this .isReprintHeaderOnEachPage = isReprintHeaderOnEachPage;
129: }
130:
131: /** Getter for property isResetPageNumber.
132: * @return Value of property isResetPageNumber.
133: *
134: */
135: public boolean isIsResetPageNumber() {
136: return isResetPageNumber;
137: }
138:
139: /** Setter for property isResetPageNumber.
140: * @param isResetPageNumber New value of property isResetPageNumber.
141: *
142: */
143: public void setIsResetPageNumber(boolean isResetPageNumber) {
144: this .isResetPageNumber = isResetPageNumber;
145: }
146:
147: /** Getter for property isStartNewColumn.
148: * @return Value of property isStartNewColumn.
149: *
150: */
151: public boolean isIsStartNewColumn() {
152: return isStartNewColumn;
153: }
154:
155: /** Setter for property isStartNewColumn.
156: * @param isStartNewColumn New value of property isStartNewColumn.
157: *
158: */
159: public void setIsStartNewColumn(boolean isStartNewColumn) {
160: this .isStartNewColumn = isStartNewColumn;
161: }
162:
163: /** Getter for property isStartNewPage.
164: * @return Value of property isStartNewPage.
165: *
166: */
167: public boolean isIsStartNewPage() {
168: return isStartNewPage;
169: }
170:
171: /** Setter for property isStartNewPage.
172: * @param isStartNewPage New value of property isStartNewPage.
173: *
174: */
175: public void setIsStartNewPage(boolean isStartNewPage) {
176: this .isStartNewPage = isStartNewPage;
177: }
178:
179: /** Getter for property minHeightToStartNewPage.
180: * @return Value of property minHeightToStartNewPage.
181: *
182: */
183: public int getMinHeightToStartNewPage() {
184: return minHeightToStartNewPage;
185: }
186:
187: /** Setter for property minHeightToStartNewPage.
188: * @param minHeightToStartNewPage New value of property minHeightToStartNewPage.
189: *
190: */
191: public void setMinHeightToStartNewPage(int minHeightToStartNewPage) {
192: this .minHeightToStartNewPage = minHeightToStartNewPage;
193: }
194:
195: /** Getter for property name.
196: * @return Value of property name.
197: *
198: */
199: public java.lang.String getName() {
200: return name;
201: }
202:
203: /** Setter for property name.
204: * @param name New value of property name.
205: *
206: */
207: public void setName(java.lang.String name) {
208: this .name = name;
209: }
210:
211: /** Getter for property parent.
212: * @return Value of property parent.
213: *
214: */
215: public it.businesslogic.ireport.SubDataset getParent() {
216: return parent;
217: }
218:
219: public String toString() {
220: return this.getName();
221: }
222: }
|