001: /*
002: * Copyright (C) 2003 Erik Swenson - erik@oreports.com
003: *
004: * This program is free software; you can redistribute it and/or modify it
005: * under the terms of the GNU General Public License as published by the Free
006: * Software Foundation; either version 2 of the License, or (at your option)
007: * any later version.
008: *
009: * This program is distributed in the hope that it will be useful, but WITHOUT
010: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
012: * more details.
013: *
014: * You should have received a copy of the GNU General Public License along with
015: * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
016: * Place - Suite 330, Boston, MA 02111-1307, USA.
017: *
018: */
019:
020: package org.efs.openreports.objects;
021:
022: import java.io.Serializable;
023:
024: public class ReportChart implements Serializable {
025: private static final long serialVersionUID = 7406441909199255551L;
026:
027: public static final int BAR_CHART = 0;
028: public static final int PIE_CHART = 1;
029: public static final int XY_CHART = 2;
030: public static final int TIME_CHART = 3;
031: public static final int RING_CHART = 4;
032: public static final int AREA_CHART = 5;
033: public static final int XY_AREA_CHART = 6;
034: public static final int TIME_AREA_CHART = 7;
035: public static final int STACKED_BAR_CHART = 8;
036: public static final int DIAL_CHART = 9;
037: public static final int THERMOMETER_CHART = 10;
038: public static final int BUBBLE_CHART = 11;
039: public static final int XY_BAR_CHART = 13;
040: public static final int STACKED_XY_BAR_CHART = 14;
041: public static final int TIME_BAR_CHART = 15;
042: public static final int STACKED_TIME_BAR_CHART = 16;
043:
044: public static final int HORIZONTAL = 1;
045: public static final int VERTICAL = 2;
046:
047: public static final String DRILLDOWN_PARAMETER = "DrillDown";
048:
049: private Integer id;
050: private String name;
051: private String description;
052: private String query;
053:
054: private int chartType;
055:
056: private int width = 400;
057: private int height = 400;
058:
059: private String xAxisLabel;
060: private String yAxisLabel;
061:
062: private boolean showLegend;
063: private boolean showTitle;
064: private boolean showValues;
065: private int plotOrientation;
066:
067: private ReportDataSource dataSource;
068:
069: private Report drillDownReport;
070:
071: private ReportChart overlayChart;
072:
073: public ReportChart() {
074: }
075:
076: public void setId(Integer id) {
077: this .id = id;
078: }
079:
080: public String toString() {
081: return name;
082: }
083:
084: public String getDescription() {
085: return description;
086: }
087:
088: public String getTitle() {
089: if (showTitle)
090: return description;
091: return null;
092: }
093:
094: public Integer getId() {
095: return id;
096: }
097:
098: public String getName() {
099: return name;
100: }
101:
102: public void setDescription(String description) {
103: this .description = description;
104: }
105:
106: public void setName(String name) {
107: this .name = name;
108: }
109:
110: public int compareTo(Object object) {
111: ReportChart reportChart = (ReportChart) object;
112: return name.compareTo(reportChart.getName());
113: }
114:
115: public ReportDataSource getDataSource() {
116: return dataSource;
117: }
118:
119: public void setDataSource(ReportDataSource dataSource) {
120: this .dataSource = dataSource;
121: }
122:
123: public String getQuery() {
124: return query;
125: }
126:
127: public void setQuery(String query) {
128: this .query = query;
129: }
130:
131: public int getChartType() {
132: return chartType;
133: }
134:
135: public void setChartType(int chartType) {
136: this .chartType = chartType;
137: }
138:
139: public int getHeight() {
140: return height;
141: }
142:
143: public void setHeight(int height) {
144: this .height = height;
145: }
146:
147: public int getWidth() {
148: return width;
149: }
150:
151: public void setWidth(int width) {
152: this .width = width;
153: }
154:
155: public String getXAxisLabel() {
156: return xAxisLabel;
157: }
158:
159: public void setXAxisLabel(String axisLabel) {
160: xAxisLabel = axisLabel;
161: }
162:
163: public String getYAxisLabel() {
164: return yAxisLabel;
165: }
166:
167: public void setYAxisLabel(String axisLabel) {
168: yAxisLabel = axisLabel;
169: }
170:
171: public boolean isShowLegend() {
172: return showLegend;
173: }
174:
175: public void setShowLegend(Boolean showLegend) {
176: if (showLegend == null)
177: showLegend = new Boolean(false);
178: this .showLegend = showLegend.booleanValue();
179: }
180:
181: public boolean isShowTitle() {
182: return showTitle;
183: }
184:
185: public void setShowTitle(Boolean showTitle) {
186: if (showTitle == null)
187: showTitle = new Boolean(false);
188: this .showTitle = showTitle.booleanValue();
189: }
190:
191: public int getPlotOrientation() {
192: return plotOrientation;
193: }
194:
195: public void setPlotOrientation(Integer plotOrientation) {
196: if (plotOrientation == null)
197: plotOrientation = new Integer(VERTICAL);
198: this .plotOrientation = plotOrientation.intValue();
199: }
200:
201: public Report getDrillDownReport() {
202: return drillDownReport;
203: }
204:
205: public void setDrillDownReport(Report drillDownReport) {
206: this .drillDownReport = drillDownReport;
207: }
208:
209: public boolean isShowValues() {
210: return showValues;
211: }
212:
213: public void setShowValues(Boolean showValues) {
214: if (showValues == null)
215: showValues = new Boolean(false);
216: this .showValues = showValues.booleanValue();
217: }
218:
219: public ReportChart getOverlayChart() {
220: return overlayChart;
221: }
222:
223: public void setOverlayChart(ReportChart overlayChart) {
224: this.overlayChart = overlayChart;
225: }
226: }
|