1 16 17 package org.pentaho.ui.component.charting; 18 19 import java.io.File ; 20 import java.util.ArrayList ; 21 import java.util.List ; 22 23 import org.apache.commons.logging.LogFactory; 24 import org.dom4j.Document; 25 import org.jfree.data.general.Dataset; 26 import org.pentaho.core.system.PentahoSystem; 27 import org.pentaho.core.ui.IPentahoUrlFactory; 28 29 public abstract class AbstractJFreeChartComponent extends AbstractChartComponent { 30 31 protected int chartType; 32 protected Dataset dataDefinition; 33 34 public AbstractJFreeChartComponent(int chartType, String definitionPath, int width, int height, IPentahoUrlFactory urlFactory, List messages) { 35 this(urlFactory, messages); 36 this.chartType = chartType; 37 this.definitionPath = definitionPath; 38 this.width = width; 39 this.height = height; 40 String info[] = PentahoSystem.parseActionString(definitionPath); 41 if (info != null && info.length == 3) { 42 setSourcePath(info[0] + File.separator + info[2]); 43 } 44 } 45 46 51 public AbstractJFreeChartComponent(String definitionPath, IPentahoUrlFactory urlFactory, ArrayList messages) { 52 this(urlFactory, messages); 53 this.definitionPath = definitionPath; 54 String info[] = PentahoSystem.parseActionString(definitionPath); 55 if (info != null && info.length == 3) { 56 setSourcePath(info[0] + File.separator + info[2]); 57 } 58 } 59 60 public AbstractJFreeChartComponent(IPentahoUrlFactory urlFactory, List messages) { 61 super(urlFactory, messages); 62 logger = LogFactory.getLog(this.getClass()); 63 } 64 65 73 public abstract Dataset createChart(Document doc); 74 75 78 public Dataset getDataDefinitiont() { 79 return dataDefinition; 80 } 81 82 86 public void setDataDefinition(Dataset dataSet) { 87 this.dataDefinition = dataSet; 88 } 89 90 93 public int getChartType() { 94 return chartType; 95 } 96 97 101 public void setChartType(int chartType) { 102 this.chartType = chartType; 103 } 104 105 } 106 | Popular Tags |