KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > crosstabs > design > JRDesignCrosstabGroup


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.crosstabs.design;
29
30 import net.sf.jasperreports.crosstabs.base.JRBaseCrosstabGroup;
31 import net.sf.jasperreports.engine.JRVariable;
32 import net.sf.jasperreports.engine.design.JRDesignVariable;
33
34 /**
35  * Base crosstab row/column group implementation to be used at design time.
36  *
37  * @author Lucian Chirita (lucianc@users.sourceforge.net)
38  * @version $Id: JRDesignCrosstabGroup.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
39  */

40 public abstract class JRDesignCrosstabGroup extends JRBaseCrosstabGroup
41 {
42     protected JRDesignVariable designVariable;
43     
44     protected JRDesignCrosstabGroup()
45     {
46         super();
47         
48         variable = designVariable = new JRDesignVariable();
49         designVariable.setCalculation(JRVariable.CALCULATION_SYSTEM);
50         designVariable.setSystemDefined(true);
51         
52         header = new JRDesignCellContents();
53         totalHeader = new JRDesignCellContents();
54     }
55     
56     
57     /**
58      * Sets the group name.
59      *
60      * @param name the name
61      * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getName()
62      */

63     public void setName(String JavaDoc name)
64     {
65         this.name = name;
66         designVariable.setName(name);
67     }
68     
69     
70     /**
71      * Sets the position of the total row/column.
72      *
73      * @param totalPosition the position of the total row/column
74      * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getTotalPosition()
75      */

76     public void setTotalPosition(byte totalPosition)
77     {
78         this.totalPosition = totalPosition;
79     }
80     
81     
82     /**
83      * Sets the group bucketing information.
84      *
85      * @param bucket the bucketing information
86      * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getBucket()
87      */

88     public void setBucket(JRDesignCrosstabBucket bucket)
89     {
90         this.bucket = bucket;
91     }
92
93     
94     /**
95      * Sets the group header cell.
96      *
97      * @param header the header cell
98      * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getHeader()
99      */

100     public void setHeader(JRDesignCellContents header)
101     {
102         if (header == null)
103         {
104             header = new JRDesignCellContents();
105         }
106         
107         this.header = header;
108     }
109
110     
111     /**
112      * Sets the group total header cell.
113      *
114      * @param totalHeader the total header
115      * @see net.sf.jasperreports.crosstabs.JRCrosstabGroup#getTotalHeader()
116      */

117     public void setTotalHeader(JRDesignCellContents totalHeader)
118     {
119         if (totalHeader == null)
120         {
121             totalHeader = new JRDesignCellContents();
122         }
123         
124         this.totalHeader = totalHeader;
125     }
126 }
127
Popular Tags