Coverage Report - ar.com.fdvs.dj.domain.DJChart
 
Classes in this File Line Coverage Branch Coverage Complexity
DJChart
45%
16/35
25%
1/4
1.154
 
 1  
 /*
 2  
  * DynamicJasper: A library for creating reports dynamically by specifying
 3  
  * columns, groups, styles, etc. at runtime. It also saves a lot of development
 4  
  * time in many cases! (http://sourceforge.net/projects/dynamicjasper)
 5  
  *
 6  
  * Copyright (C) 2008  FDV Solutions (http://www.fdvsolutions.com)
 7  
  *
 8  
  * This library is free software; you can redistribute it and/or
 9  
  * modify it under the terms of the GNU Lesser General Public
 10  
  *
 11  
  * License as published by the Free Software Foundation; either
 12  
  *
 13  
  * version 2.1 of the License, or (at your option) any later version.
 14  
  *
 15  
  * This library is distributed in the hope that it will be useful,
 16  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  
  *
 18  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 19  
  *
 20  
  * Lesser General Public License for more details.
 21  
  *
 22  
  * You should have received a copy of the GNU Lesser General Public
 23  
  * License along with this library; if not, write to the Free Software
 24  
  *
 25  
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 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  
  * Charts to be displayed by dynamicjasper
 44  
  * @author msimone
 45  
  * @deprecated
 46  
  */
 47  
 public class DJChart extends DJBaseElement{
 48  
 
 49  
         private static final long serialVersionUID = Entity.SERIAL_VERSION_UID;
 50  
         
 51  
         //The possible chart types
 52  
         public static final byte PIE_CHART = JRDesignChart.CHART_TYPE_PIE;
 53  
         public static final byte BAR_CHART = JRDesignChart.CHART_TYPE_BAR;
 54  
 //        public static final byte LINE_CHART = JRDesignChart.CHART_TYPE_LINE; //not yet... to much to think left
 55  
 
 56  
         //The possible calculation types
 57  1
         public static final byte CALCULATION_COUNT = CalculationEnum.COUNT.getValue();
 58  1
         public static final byte CALCULATION_SUM = CalculationEnum.SUM.getValue();
 59  
 
 60  
         //How to build the chart?
 61  
         private byte type;
 62  
         private DJGroup columnsGroup;
 63  
 //        private AbstractColumn column;
 64  
         
 65  
         /**
 66  
          * List<AbstractColumn>
 67  
          */
 68  8
         private List columns = new ArrayList();
 69  
         
 70  
 
 71  
         private byte operation;
 72  
 
 73  
         //How to show the chart?
 74  
         private DJChartOptions chartOptions;
 75  
 
 76  0
         public DJChart(){}
 77  
 
 78  0
         public DJChart(byte type, DJGroup columnsGroup, AbstractColumn column, byte operation, DJChartOptions chartOptions){
 79  0
                 this.type = type;
 80  0
                 this.columnsGroup = columnsGroup;
 81  
                 
 82  0
                 if (column != null)
 83  0
                         this.columns.add(column);
 84  
                 
 85  0
                 this.operation = operation;
 86  0
                 this.chartOptions = chartOptions;
 87  0
         }
 88  
         
 89  8
         public DJChart(byte type, DJGroup columnsGroup, List columns, byte operation, DJChartOptions chartOptions){
 90  8
                 this.type = type;
 91  8
                 this.columnsGroup = columnsGroup;
 92  
                 
 93  8
                 if (columns != null)
 94  8
                         this.columns.addAll(columns);
 95  
                 
 96  8
                 this.operation = operation;
 97  8
                 this.chartOptions = chartOptions;
 98  8
         }
 99  
 
 100  
 //        public AbstractColumn getColumn() {
 101  
 //                return column;
 102  
 //        }
 103  
 //
 104  
 //        public void setColumn(AbstractColumn column) {
 105  
 //                this.column = column;
 106  
 //        }
 107  
 
 108  
         public byte getOperation() {
 109  20
                 return operation;
 110  
         }
 111  
 
 112  
         public void setOperation(byte operation) {
 113  0
                 this.operation = operation;
 114  0
         }
 115  
 
 116  
         public byte getType() {
 117  24
                 return type;
 118  
         }
 119  
 
 120  
         public void setType(byte type) {
 121  0
                 this.type = type;
 122  0
         }
 123  
 
 124  
         public DJGroup getColumnsGroup() {
 125  32
                 return columnsGroup;
 126  
         }
 127  
 
 128  
         public void setColumnsGroup(DJGroup columnsGroup) {
 129  0
                 this.columnsGroup = columnsGroup;
 130  0
         }
 131  
 
 132  
         public DJChartOptions getOptions() {
 133  24
                 return chartOptions;
 134  
         }
 135  
 
 136  
         public void setOptions(DJChartOptions options) {
 137  0
                 this.chartOptions = options;
 138  0
         }
 139  
         
 140  
         public List getColumns() {
 141  16
                 return columns;
 142  
         }
 143  
 
 144  
         public void setColumns(List columns) {
 145  0
                 this.columns = columns;
 146  0
         }
 147  
         
 148  
 }