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.engine;
029:
030: import java.util.HashMap;
031: import java.util.Map;
032:
033: import net.sf.jasperreports.charts.JRAreaPlot;
034: import net.sf.jasperreports.charts.JRBar3DPlot;
035: import net.sf.jasperreports.charts.JRBarPlot;
036: import net.sf.jasperreports.charts.JRBubblePlot;
037: import net.sf.jasperreports.charts.JRCandlestickPlot;
038: import net.sf.jasperreports.charts.JRCategoryDataset;
039: import net.sf.jasperreports.charts.JRCategorySeries;
040: import net.sf.jasperreports.charts.JRLinePlot;
041: import net.sf.jasperreports.charts.JRPie3DPlot;
042: import net.sf.jasperreports.charts.JRPieDataset;
043: import net.sf.jasperreports.charts.JRPiePlot;
044: import net.sf.jasperreports.charts.JRTimePeriodDataset;
045: import net.sf.jasperreports.charts.JRTimePeriodSeries;
046: import net.sf.jasperreports.charts.JRTimeSeries;
047: import net.sf.jasperreports.charts.JRTimeSeriesDataset;
048: import net.sf.jasperreports.charts.JRXyzDataset;
049: import net.sf.jasperreports.charts.JRXyzSeries;
050: import net.sf.jasperreports.crosstabs.JRCrosstab;
051:
052: /**
053: * @author Teodor Danciu (teodord@users.sourceforge.net)
054: * @version $Id: JRAbstractObjectFactory.java 1759 2007-06-20 16:47:34Z lucianc $
055: */
056: public abstract class JRAbstractObjectFactory {
057:
058: /**
059: *
060: */
061: private Map objectsMap = new HashMap();
062:
063: /**
064: *
065: */
066: protected Object get(Object object) {
067: return objectsMap.get(object);
068: }
069:
070: /**
071: *
072: */
073: public void put(Object object, Object copy) {
074: objectsMap.put(object, copy);
075: }
076:
077: /**
078: *
079: */
080: public abstract JRReportFont getReportFont(JRReportFont font);
081:
082: /**
083: *
084: */
085: public abstract JRStyle getStyle(JRStyle style);
086:
087: /**
088: * Sets a style or a style reference on an object.
089: * <p/>
090: * If the container includes a style (see {@link JRStyleContainer#getStyle() getStyle()},
091: * a copy of this style will be created via {@link #getStyle(JRStyle) getStyle(JRStyle)}
092: * and set on the object.
093: * <p/>
094: * In addition to this, the implementation needs to handle the case when the container includes
095: * an external style reference (see {@link JRStyleContainer#getStyleNameReference() getStyleNameReference()}.
096: *
097: * @param setter a setter for the object on which the style should be set.
098: * @param styleContainer the original style container
099: * @see #getStyle(JRStyle)
100: */
101: public abstract void setStyle(JRStyleSetter setter,
102: JRStyleContainer styleContainer);
103:
104: /**
105: *
106: */
107: public abstract JRElementGroup getElementGroup(
108: JRElementGroup elementGroup);
109:
110: /**
111: *
112: */
113: public abstract JRBreak getBreak(JRBreak breakElement);
114:
115: /**
116: *
117: */
118: public abstract JRLine getLine(JRLine line);
119:
120: /**
121: *
122: */
123: public abstract JRRectangle getRectangle(JRRectangle rectangle);
124:
125: /**
126: *
127: */
128: public abstract JREllipse getEllipse(JREllipse ellipse);
129:
130: /**
131: *
132: */
133: public abstract JRImage getImage(JRImage image);
134:
135: /**
136: *
137: */
138: public abstract JRStaticText getStaticText(JRStaticText staticText);
139:
140: /**
141: *
142: */
143: public abstract JRTextField getTextField(JRTextField textField);
144:
145: /**
146: *
147: */
148: public abstract JRSubreport getSubreport(JRSubreport subreport);
149:
150: /**
151: *
152: */
153: public abstract JRPieDataset getPieDataset(JRPieDataset pieDataset);
154:
155: /**
156: *
157: */
158: public abstract JRPiePlot getPiePlot(JRPiePlot piePlot);
159:
160: /**
161: *
162: */
163: public abstract JRPie3DPlot getPie3DPlot(JRPie3DPlot pie3DPlot);
164:
165: /**
166: *
167: */
168: public abstract JRCategoryDataset getCategoryDataset(
169: JRCategoryDataset categoryDataset);
170:
171: /**
172: *
173: */
174: public abstract JRTimeSeriesDataset getTimeSeriesDataset(
175: JRTimeSeriesDataset timeSeriesDataset);
176:
177: /**
178: *
179: */
180: public abstract JRTimePeriodDataset getTimePeriodDataset(
181: JRTimePeriodDataset timePeriodDataset);
182:
183: /**
184: *
185: */
186: public abstract JRTimePeriodSeries getTimePeriodSeries(
187: JRTimePeriodSeries timePeriodSeries);
188:
189: /**
190: *
191: */
192: public abstract JRTimeSeries getTimeSeries(JRTimeSeries timeSeries);
193:
194: /**
195: *
196: */
197: public abstract JRCategorySeries getCategorySeries(
198: JRCategorySeries categorySeries);
199:
200: /**
201: *
202: */
203: public abstract JRXyzDataset getXyzDataset(JRXyzDataset xyzDataset);
204:
205: /**
206: *
207: */
208: public abstract JRXyzSeries getXyzSeries(JRXyzSeries xyzSeries);
209:
210: /**
211: *
212: */
213: public abstract JRBarPlot getBarPlot(JRBarPlot barPlot);
214:
215: /**
216: *
217: */
218: public abstract JRBar3DPlot getBar3DPlot(JRBar3DPlot barPlot);
219:
220: /**
221: *
222: */
223: public abstract JRLinePlot getLinePlot(JRLinePlot linePlot);
224:
225: /**
226: *
227: */
228: public abstract JRAreaPlot getAreaPlot(JRAreaPlot areaPlot);
229:
230: /**
231: *
232: */
233: public abstract JRBubblePlot getBubblePlot(JRBubblePlot bubblePlot);
234:
235: /**
236: *
237: */
238: public abstract JRCandlestickPlot getCandlestickPlot(
239: JRCandlestickPlot candlestickPlot);
240:
241: /**
242: *
243: */
244: public abstract JRChart getChart(JRChart chart);
245:
246: public abstract JRCrosstab getCrosstab(JRCrosstab crosstab);
247:
248: public abstract JRFrame getFrame(JRFrame frame);
249:
250: public abstract JRConditionalStyle getConditionalStyle(
251: JRConditionalStyle conditionalStyle, JRStyle parentStyle);
252:
253: public abstract JRExpression getExpression(JRExpression expression,
254: boolean assignNotUsedId);
255:
256: public JRExpression getExpression(JRExpression expression) {
257: return getExpression(expression, false);
258: }
259: }
|