1 19 20 package org.efs.openreports.objects; 21 22 import java.io.Serializable ; 23 24 public class ReportChart implements Serializable 25 { 26 private static final long serialVersionUID = 7406441909199255551L; 27 28 public static final int BAR_CHART = 0; 29 public static final int PIE_CHART = 1; 30 public static final int XY_CHART = 2; 31 public static final int TIME_CHART = 3; 32 public static final int RING_CHART = 4; 33 34 public static final int HORIZONTAL = 1; 35 public static final int VERTICAL = 2; 36 37 public static final String DRILLDOWN_PARAMETER = "DrillDown"; 38 39 private Integer id; 40 private String name; 41 private String description; 42 private String query; 43 44 private int chartType; 45 private int width = 400; 46 private int height = 400; 47 48 private String xAxisLabel; 49 private String yAxisLabel; 50 51 private boolean showLegend; 52 private boolean showTitle; 53 private boolean showValues; 54 private int plotOrientation; 55 56 private ReportDataSource dataSource; 57 58 private Report drillDownReport; 59 60 public ReportChart() 61 { 62 } 63 64 public void setId(Integer id) 65 { 66 this.id = id; 67 } 68 69 public String toString() 70 { 71 return name; 72 } 73 74 public String getDescription() 75 { 76 return description; 77 } 78 79 public String getTitle() 80 { 81 if (showTitle) return description; 82 return null; 83 } 84 85 public Integer getId() 86 { 87 return id; 88 } 89 90 public String getName() 91 { 92 return name; 93 } 94 95 public void setDescription(String description) 96 { 97 this.description = description; 98 } 99 100 public void setName(String name) 101 { 102 this.name = name; 103 } 104 105 public int compareTo(Object object) 106 { 107 ReportChart reportChart = (ReportChart) object; 108 return name.compareTo(reportChart.getName()); 109 } 110 111 public ReportDataSource getDataSource() 112 { 113 return dataSource; 114 } 115 116 public void setDataSource(ReportDataSource dataSource) 117 { 118 this.dataSource = dataSource; 119 } 120 121 public String getQuery() 122 { 123 return query; 124 } 125 126 public void setQuery(String query) 127 { 128 this.query = query; 129 } 130 131 public int getChartType() 132 { 133 return chartType; 134 } 135 136 public void setChartType(int chartType) 137 { 138 this.chartType = chartType; 139 } 140 141 public int getHeight() 142 { 143 return height; 144 } 145 146 public void setHeight(int height) 147 { 148 this.height = height; 149 } 150 151 public int getWidth() 152 { 153 return width; 154 } 155 156 public void setWidth(int width) 157 { 158 this.width = width; 159 } 160 161 public String getXAxisLabel() 162 { 163 return xAxisLabel; 164 } 165 166 public void setXAxisLabel(String axisLabel) 167 { 168 xAxisLabel = axisLabel; 169 } 170 171 public String getYAxisLabel() 172 { 173 return yAxisLabel; 174 } 175 176 public void setYAxisLabel(String axisLabel) 177 { 178 yAxisLabel = axisLabel; 179 } 180 181 public boolean isShowLegend() 182 { 183 return showLegend; 184 } 185 186 public void setShowLegend(Boolean showLegend) 187 { 188 if (showLegend == null) showLegend = new Boolean (false); 189 this.showLegend = showLegend.booleanValue(); 190 } 191 192 public boolean isShowTitle() 193 { 194 return showTitle; 195 } 196 197 public void setShowTitle(Boolean showTitle) 198 { 199 if (showTitle == null) showTitle = new Boolean (false); 200 this.showTitle = showTitle.booleanValue(); 201 } 202 203 public int getPlotOrientation() 204 { 205 return plotOrientation; 206 } 207 208 public void setPlotOrientation(Integer plotOrientation) 209 { 210 if (plotOrientation == null) plotOrientation = new Integer (VERTICAL); 211 this.plotOrientation = plotOrientation.intValue(); 212 } 213 214 public Report getDrillDownReport() 215 { 216 return drillDownReport; 217 } 218 219 public void setDrillDownReport(Report drillDownReport) 220 { 221 this.drillDownReport = drillDownReport; 222 } 223 224 public boolean isShowValues() 225 { 226 return showValues; 227 } 228 229 public void setShowValues(Boolean showValues) 230 { 231 if (showValues == null) showValues = new Boolean (false); 232 this.showValues = showValues.booleanValue(); 233 } 234 } | Popular Tags |