KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > base > JRBaseGroup


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.engine.base;
29
30 import java.io.Serializable JavaDoc;
31
32 import net.sf.jasperreports.engine.JRBand;
33 import net.sf.jasperreports.engine.JRConstants;
34 import net.sf.jasperreports.engine.JRExpression;
35 import net.sf.jasperreports.engine.JRGroup;
36 import net.sf.jasperreports.engine.JRVariable;
37
38
39 /**
40  * @author Teodor Danciu (teodord@users.sourceforge.net)
41  * @version $Id: JRBaseGroup.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
42  */

43 public class JRBaseGroup implements JRGroup, Serializable JavaDoc
44 {
45
46
47     /**
48      *
49      */

50     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
51
52     /**
53      *
54      */

55     protected String JavaDoc name = null;
56     protected boolean isStartNewColumn = false;
57     protected boolean isStartNewPage = false;
58     protected boolean isResetPageNumber = false;
59     protected boolean isReprintHeaderOnEachPage = false;
60     protected int minHeightToStartNewPage = 0;
61
62     /**
63      *
64      */

65     protected JRExpression expression = null;
66     protected JRBand groupHeader = null;
67     protected JRBand groupFooter = null;
68     protected JRVariable countVariable = null;
69     
70
71     /**
72      *
73      */

74     protected JRBaseGroup()
75     {
76     }
77         
78
79     /**
80      *
81      */

82     protected JRBaseGroup(JRGroup group, JRBaseObjectFactory factory)
83     {
84         factory.put(group, this);
85         
86         name = group.getName();
87         isStartNewColumn = group.isStartNewColumn();
88         isStartNewPage = group.isStartNewPage();
89         isResetPageNumber = group.isResetPageNumber();
90         isReprintHeaderOnEachPage = group.isReprintHeaderOnEachPage();
91         minHeightToStartNewPage = group.getMinHeightToStartNewPage();
92         
93         expression = factory.getExpression(group.getExpression());
94
95         groupHeader = factory.getBand(group.getGroupHeader());
96         groupFooter = factory.getBand(group.getGroupFooter());
97         countVariable = factory.getVariable(group.getCountVariable());
98     }
99         
100
101     /**
102      *
103      */

104     public String JavaDoc getName()
105     {
106         return this.name;
107     }
108     
109     /**
110      *
111      */

112     public boolean isStartNewColumn()
113     {
114         return this.isStartNewColumn;
115     }
116         
117     /**
118      *
119      */

120     public void setStartNewColumn(boolean isStart)
121     {
122         this.isStartNewColumn = isStart;
123     }
124         
125     /**
126      *
127      */

128     public boolean isStartNewPage()
129     {
130         return this.isStartNewPage;
131     }
132         
133     /**
134      *
135      */

136     public void setStartNewPage(boolean isStart)
137     {
138         this.isStartNewPage = isStart;
139     }
140         
141     /**
142      *
143      */

144     public boolean isResetPageNumber()
145     {
146         return this.isResetPageNumber;
147     }
148         
149     /**
150      *
151      */

152     public void setResetPageNumber(boolean isReset)
153     {
154         this.isResetPageNumber = isReset;
155     }
156         
157     /**
158      *
159      */

160     public boolean isReprintHeaderOnEachPage()
161     {
162         return this.isReprintHeaderOnEachPage;
163     }
164         
165     /**
166      *
167      */

168     public void setReprintHeaderOnEachPage(boolean isReprint)
169     {
170         this.isReprintHeaderOnEachPage = isReprint;
171     }
172         
173     /**
174      *
175      */

176     public int getMinHeightToStartNewPage()
177     {
178         return this.minHeightToStartNewPage;
179     }
180
181     /**
182      *
183      */

184     public void setMinHeightToStartNewPage(int minHeight)
185     {
186         this.minHeightToStartNewPage = minHeight;
187     }
188         
189     /**
190      *
191      */

192     public JRExpression getExpression()
193     {
194         return this.expression;
195     }
196     
197     /**
198      *
199      */

200     public JRBand getGroupHeader()
201     {
202         return this.groupHeader;
203     }
204         
205     /**
206      *
207      */

208     public JRBand getGroupFooter()
209     {
210         return this.groupFooter;
211     }
212         
213     /**
214      *
215      */

216     public JRVariable getCountVariable()
217     {
218         return this.countVariable;
219     }
220
221
222 }
223
Popular Tags