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: * Band.java
028: *
029: * Created on 12 febbraio 2003, 20.26
030: *
031: */
032:
033: package it.businesslogic.ireport;
034:
035: public class Band {
036:
037: private Report parent;
038: private String name = "";
039: private String printWhenExpression = "";
040: private int height = 0;
041: private boolean splitAllowed = true;
042:
043: private boolean groupHeader = false;
044:
045: public boolean isGroupHeader() {
046: return groupHeader;
047: }
048:
049: public void setGroupHeader(boolean groupHeader) {
050: this .groupHeader = groupHeader;
051: }
052:
053: public boolean isGroupFooter() {
054: return groupFooter;
055: }
056:
057: public void setGroupFooter(boolean groupFooter) {
058: this .groupFooter = groupFooter;
059: }
060:
061: public Group getGroup() {
062: return group;
063: }
064:
065: public void setGroup(Group group) {
066: this .group = group;
067: }
068:
069: private boolean groupFooter = false;
070: private Group group = null;
071:
072: /**
073: * Creates a new Band object.
074: *
075: * @param parent DOCUMENT ME!
076: * @param name DOCUMENT ME!
077: * @param height DOCUMENT ME!
078: */
079: public Band(Report parent, String name, int height) {
080: this .parent = parent;
081: this .name = name;
082: this .height = height;
083: this .splitAllowed = true;
084: }
085:
086: /**
087: * DOCUMENT ME!
088: *
089: * @return DOCUMENT ME!
090: */
091: public String toString() {
092:
093: return this .name;
094: }
095:
096: /**
097: * DOCUMENT ME!
098: *
099: * @return DOCUMENT ME!
100: */
101: public int getBandYLocation() {
102:
103: return parent.getBandYLocation(this );
104: }
105:
106: /**
107: * DOCUMENT ME!
108: *
109: * @return DOCUMENT ME!
110: */
111: public int getUsableWidth() {
112:
113: return parent.getWidth() - parent.getLeftMargin()
114: - parent.getRightMargin();
115: }
116:
117: /**
118: * Getter for property height.
119: *
120: * @return Value of property height.
121: */
122: public int getHeight() {
123:
124: return height;
125: }
126:
127: /**
128: * Setter for property height.
129: *
130: * @param height New value of property height.
131: */
132: public void setHeight(int height) {
133: this .height = height;
134: }
135:
136: /**
137: * Getter for property name.
138: *
139: * @return Value of property name.
140: */
141: public java.lang.String getName() {
142:
143: return name;
144: }
145:
146: /**
147: * Setter for property name.
148: *
149: * @param name New value of property name.
150: */
151: public void setName(java.lang.String name) {
152: this .name = name;
153: }
154:
155: /**
156: * Getter for property parent.
157: *
158: * @return Value of property parent.
159: */
160: public it.businesslogic.ireport.Report getParent() {
161:
162: return parent;
163: }
164:
165: /**
166: * Setter for property parent.
167: *
168: * @param parent New value of property parent.
169: */
170: public void setParent(it.businesslogic.ireport.Report parent) {
171: this .parent = parent;
172: }
173:
174: /**
175: * Getter for property printWhenExpression.
176: *
177: * @return Value of property printWhenExpression.
178: */
179: public java.lang.String getPrintWhenExpression() {
180:
181: return printWhenExpression;
182: }
183:
184: /**
185: * Setter for property printWhenExpression.
186: *
187: * @param printWhenExpression New value of property printWhenExpression.
188: */
189: public void setPrintWhenExpression(
190: java.lang.String printWhenExpression) {
191: this .printWhenExpression = printWhenExpression;
192: }
193:
194: /**
195: * Getter for property splitAllowed.
196: *
197: * @return Value of property splitAllowed.
198: */
199: public boolean isSplitAllowed() {
200:
201: return splitAllowed;
202: }
203:
204: /**
205: * Setter for property splitAllowed.
206: *
207: * @param splitAllowed New value of property splitAllowed.
208: */
209: public void setSplitAllowed(boolean splitAllowed) {
210: this.splitAllowed = splitAllowed;
211: }
212: }
|