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.base;
029:
030: import java.awt.Color;
031: import java.io.Serializable;
032:
033: import net.sf.jasperreports.crosstabs.JRCellContents;
034: import net.sf.jasperreports.engine.JRBox;
035: import net.sf.jasperreports.engine.JRConstants;
036: import net.sf.jasperreports.engine.JRDefaultStyleProvider;
037: import net.sf.jasperreports.engine.JRStyle;
038: import net.sf.jasperreports.engine.base.JRBaseElementGroup;
039: import net.sf.jasperreports.engine.base.JRBaseObjectFactory;
040:
041: /**
042: * Base read-only implementation of {@link net.sf.jasperreports.crosstabs.JRCellContents JRCellContents}.
043: *
044: * @author Lucian Chirita (lucianc@users.sourceforge.net)
045: * @version $Id: JRBaseCellContents.java 1759 2007-06-20 16:47:34Z lucianc $
046: */
047: public class JRBaseCellContents extends JRBaseElementGroup implements
048: JRCellContents, Serializable {
049: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
050:
051: protected JRDefaultStyleProvider defaultStyleProvider;
052: protected JRStyle style;
053: protected String styleNameReference;
054:
055: protected Byte mode;
056: protected Color backcolor;
057: protected JRBox box;
058: protected int width;
059: protected int height;
060:
061: public JRBaseCellContents(JRCellContents cell,
062: JRBaseObjectFactory factory) {
063: super (cell, factory);
064:
065: this .defaultStyleProvider = factory.getDefaultStyleProvider();
066: style = factory.getStyle(cell.getStyle());
067: styleNameReference = cell.getStyleNameReference();
068: mode = cell.getMode();
069: backcolor = cell.getBackcolor();
070: box = cell.getBox();
071: width = cell.getWidth();
072: height = cell.getHeight();
073: }
074:
075: public Color getBackcolor() {
076: return backcolor;
077: }
078:
079: public JRBox getBox() {
080: return box;
081: }
082:
083: public int getWidth() {
084: return width;
085: }
086:
087: public int getHeight() {
088: return height;
089: }
090:
091: public JRDefaultStyleProvider getDefaultStyleProvider() {
092: return defaultStyleProvider;
093: }
094:
095: public JRStyle getStyle() {
096: return style;
097: }
098:
099: public Byte getMode() {
100: return mode;
101: }
102:
103: public String getStyleNameReference() {
104: return styleNameReference;
105: }
106: }
|