KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.awt.Color JavaDoc;
31
32 import net.sf.jasperreports.crosstabs.JRCellContents;
33 import net.sf.jasperreports.engine.JRBox;
34 import net.sf.jasperreports.engine.JRConstants;
35 import net.sf.jasperreports.engine.JRDefaultStyleProvider;
36 import net.sf.jasperreports.engine.JRStyle;
37 import net.sf.jasperreports.engine.design.JRDesignElementGroup;
38
39 /**
40  * Implementation of {@link net.sf.jasperreports.crosstabs.JRCellContents JRCellContents} used for
41  * report design.
42  *
43  * @author Lucian Chirita (lucianc@users.sourceforge.net)
44  * @version $Id: JRDesignCellContents.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
45  */

46 public class JRDesignCellContents extends JRDesignElementGroup implements JRCellContents
47 {
48     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
49
50     protected JRDefaultStyleProvider defaultStyleProvider;
51     protected JRStyle style;
52     
53     protected Byte JavaDoc mode;
54     private Color JavaDoc backcolor;
55     private JRBox box;
56     private int width = JRCellContents.NOT_CALCULATED;
57     private int height = JRCellContents.NOT_CALCULATED;
58
59     
60     /**
61      * Creates an empty cell contents.
62      */

63     public JRDesignCellContents()
64     {
65         super();
66     }
67     
68     public Color JavaDoc getBackcolor()
69     {
70         return backcolor;
71     }
72     
73     
74     /**
75      * Sets the cell background color.
76      *
77      * @param color the background color
78      * @see JRCellContents#getBackcolor()
79      */

80     public void setBackcolor(Color JavaDoc color)
81     {
82         backcolor = color;
83     }
84
85     public JRBox getBox()
86     {
87         return box;
88     }
89     
90     
91     /**
92      * Sets the cell border.
93      *
94      * @param box the border
95      * @see JRCellContents#getBox()
96      */

97     public void setBox(JRBox box)
98     {
99         this.box = box;
100     }
101
102     public int getHeight()
103     {
104         return height;
105     }
106
107     
108     /**
109      * Sets the computed cell height.
110      *
111      * @param height the cell height
112      * @see JRCellContents#getHeight()
113      */

114     protected void setHeight(int height)
115     {
116         this.height = height;
117     }
118
119     public int getWidth()
120     {
121         return width;
122     }
123
124
125     /**
126      * Sets the computed cell width.
127      *
128      * @param width the cell width
129      * @see JRCellContents#getWidth()
130      */

131     protected void setWidth(int width)
132     {
133         this.width = width;
134     }
135
136     public JRDefaultStyleProvider getDefaultStyleProvider()
137     {
138         return defaultStyleProvider;
139     }
140
141     public JRStyle getStyle()
142     {
143         return style;
144     }
145     
146     
147     /**
148      * Sets the style used by this cell.
149      * <p/>
150      * The style is only used for cell background and borders and is not inherited by
151      * elements inside the cell.
152      *
153      * @param style the style to be used
154      */

155     public void setStyle(JRStyle style)
156     {
157         this.style = style;
158     }
159
160     public Byte JavaDoc getMode()
161     {
162         return mode;
163     }
164
165     
166     /**
167      * Sets the cell transparency mode.
168      *
169      * @param mode the transparency mode
170      * @see JRCellContents#getMode()
171      */

172     public void setMode(Byte JavaDoc mode)
173     {
174         this.mode = mode;
175     }
176 }
177
Popular Tags