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.design;
029:
030: import net.sf.jasperreports.crosstabs.base.JRBaseCrosstabGroup;
031: import net.sf.jasperreports.engine.JRVariable;
032: import net.sf.jasperreports.engine.design.JRDesignVariable;
033:
034: /**
035: * Base crosstab row/column group implementation to be used at design time.
036: *
037: * @author Lucian Chirita (lucianc@users.sourceforge.net)
038: * @version $Id: JRDesignCrosstabGroup.java 1229 2006-04-19 10:27:35Z teodord $
039: */
040: public abstract class JRDesignCrosstabGroup extends JRBaseCrosstabGroup {
041: protected JRDesignVariable designVariable;
042:
043: protected JRDesignCrosstabGroup() {
044: super ();
045:
046: variable = designVariable = new JRDesignVariable();
047: designVariable.setCalculation(JRVariable.CALCULATION_SYSTEM);
048: designVariable.setSystemDefined(true);
049:
050: header = new JRDesignCellContents();
051: totalHeader = new JRDesignCellContents();
052: }
053:
054: /**
055: * Sets the group name.
056: *
057: * @param name the name
058: * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getName()
059: */
060: public void setName(String name) {
061: this .name = name;
062: designVariable.setName(name);
063: }
064:
065: /**
066: * Sets the position of the total row/column.
067: *
068: * @param totalPosition the position of the total row/column
069: * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getTotalPosition()
070: */
071: public void setTotalPosition(byte totalPosition) {
072: this .totalPosition = totalPosition;
073: }
074:
075: /**
076: * Sets the group bucketing information.
077: *
078: * @param bucket the bucketing information
079: * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getBucket()
080: */
081: public void setBucket(JRDesignCrosstabBucket bucket) {
082: this .bucket = bucket;
083: }
084:
085: /**
086: * Sets the group header cell.
087: *
088: * @param header the header cell
089: * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getHeader()
090: */
091: public void setHeader(JRDesignCellContents header) {
092: if (header == null) {
093: header = new JRDesignCellContents();
094: }
095:
096: this .header = header;
097: }
098:
099: /**
100: * Sets the group total header cell.
101: *
102: * @param totalHeader the total header
103: * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getTotalHeader()
104: */
105: public void setTotalHeader(JRDesignCellContents totalHeader) {
106: if (totalHeader == null) {
107: totalHeader = new JRDesignCellContents();
108: }
109:
110: this.totalHeader = totalHeader;
111: }
112: }
|