1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package ar.com.fdvs.dj.domain;
31
32 import java.util.ArrayList;
33 import java.util.List;
34
35 import net.sf.jasperreports.engine.design.JRDesignChart;
36 import net.sf.jasperreports.engine.design.JRDesignVariable;
37 import ar.com.fdvs.dj.domain.entities.DJGroup;
38 import ar.com.fdvs.dj.domain.entities.Entity;
39 import ar.com.fdvs.dj.domain.entities.columns.AbstractColumn;
40 import net.sf.jasperreports.engine.type.CalculationEnum;
41
42
43
44
45
46
47 public class DJChart extends DJBaseElement{
48
49 private static final long serialVersionUID = Entity.SERIAL_VERSION_UID;
50
51
52 public static final byte PIE_CHART = JRDesignChart.CHART_TYPE_PIE;
53 public static final byte BAR_CHART = JRDesignChart.CHART_TYPE_BAR;
54
55
56
57 public static final byte CALCULATION_COUNT = CalculationEnum.COUNT.getValue();
58 public static final byte CALCULATION_SUM = CalculationEnum.SUM.getValue();
59
60
61 private byte type;
62 private DJGroup columnsGroup;
63
64
65
66
67
68 private List columns = new ArrayList();
69
70
71 private byte operation;
72
73
74 private DJChartOptions chartOptions;
75
76 public DJChart(){}
77
78 public DJChart(byte type, DJGroup columnsGroup, AbstractColumn column, byte operation, DJChartOptions chartOptions){
79 this.type = type;
80 this.columnsGroup = columnsGroup;
81
82 if (column != null)
83 this.columns.add(column);
84
85 this.operation = operation;
86 this.chartOptions = chartOptions;
87 }
88
89 public DJChart(byte type, DJGroup columnsGroup, List columns, byte operation, DJChartOptions chartOptions){
90 this.type = type;
91 this.columnsGroup = columnsGroup;
92
93 if (columns != null)
94 this.columns.addAll(columns);
95
96 this.operation = operation;
97 this.chartOptions = chartOptions;
98 }
99
100
101
102
103
104
105
106
107
108 public byte getOperation() {
109 return operation;
110 }
111
112 public void setOperation(byte operation) {
113 this.operation = operation;
114 }
115
116 public byte getType() {
117 return type;
118 }
119
120 public void setType(byte type) {
121 this.type = type;
122 }
123
124 public DJGroup getColumnsGroup() {
125 return columnsGroup;
126 }
127
128 public void setColumnsGroup(DJGroup columnsGroup) {
129 this.columnsGroup = columnsGroup;
130 }
131
132 public DJChartOptions getOptions() {
133 return chartOptions;
134 }
135
136 public void setOptions(DJChartOptions options) {
137 this.chartOptions = options;
138 }
139
140 public List getColumns() {
141 return columns;
142 }
143
144 public void setColumns(List columns) {
145 this.columns = columns;
146 }
147
148 }