001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
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.1 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; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.crosstabs.fill;
029:
030: import net.sf.jasperreports.crosstabs.JRCellContents;
031: import net.sf.jasperreports.crosstabs.JRCrosstabBucket;
032: import net.sf.jasperreports.crosstabs.JRCrosstabGroup;
033: import net.sf.jasperreports.engine.JRVariable;
034: import net.sf.jasperreports.engine.fill.JRFillCellContents;
035: import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
036: import net.sf.jasperreports.engine.fill.JRFillVariable;
037:
038: /**
039: * Base crosstab row/column group implementation used at fill time.
040: *
041: * @author Lucian Chirita (lucianc@users.sourceforge.net)
042: * @version $Id: JRFillCrosstabGroup.java 1229 2006-04-19 10:27:35Z teodord $
043: */
044: public abstract class JRFillCrosstabGroup implements JRCrosstabGroup {
045: protected JRCrosstabGroup parentGroup;
046: protected JRFillCellContents header;
047: protected JRFillCellContents totalHeader;
048: protected JRFillVariable variable;
049:
050: public JRFillCrosstabGroup(JRCrosstabGroup group,
051: JRFillObjectFactory factory) {
052: factory.put(group, this );
053:
054: parentGroup = group;
055:
056: header = factory.getCell(group.getHeader());
057: totalHeader = factory.getCell(group.getTotalHeader());
058:
059: variable = factory.getVariable(group.getVariable());
060: }
061:
062: public String getName() {
063: return parentGroup.getName();
064: }
065:
066: public byte getTotalPosition() {
067: return parentGroup.getTotalPosition();
068: }
069:
070: public boolean hasTotal() {
071: return parentGroup.hasTotal();
072: }
073:
074: public JRCrosstabBucket getBucket() {
075: return parentGroup.getBucket();
076: }
077:
078: public JRCellContents getHeader() {
079: return header;
080: }
081:
082: public JRCellContents getTotalHeader() {
083: return totalHeader;
084: }
085:
086: public JRFillCellContents getFillHeader() {
087: return header;
088: }
089:
090: public JRFillCellContents getFillTotalHeader() {
091: return totalHeader;
092: }
093:
094: public JRVariable getVariable() {
095: return variable;
096: }
097:
098: public JRFillVariable getFillVariable() {
099: return variable;
100: }
101:
102: }
|