1 37 38 package org.jfree.chart.demo; 39 40 import org.jfree.data.AbstractDataset; 41 import org.jfree.data.DatasetChangeListener; 42 import org.jfree.data.IntervalXYDataset; 43 44 49 public class SimpleIntervalXYDataset extends AbstractDataset implements IntervalXYDataset { 50 51 52 private Double [] xStart = new Double [3]; 53 54 55 private Double [] xEnd = new Double [3]; 56 57 58 private Double [] y = new Double [3]; 59 60 63 public SimpleIntervalXYDataset() { 64 65 xStart[0] = new Double (0.0); 66 xStart[1] = new Double (2.0); 67 xStart[2] = new Double (3.5); 68 69 xEnd[0] = new Double (2.0); 70 xEnd[1] = new Double (3.5); 71 xEnd[2] = new Double (4.0); 72 73 y[0] = new Double (3.0); 74 y[1] = new Double (4.5); 75 y[2] = new Double (2.5); 76 } 77 78 83 public int getSeriesCount() { 84 return 1; 85 } 86 87 94 public String getSeriesName(int series) { 95 return "Series 1"; 96 } 97 98 105 public int getItemCount(int series) { 106 return 3; 107 } 108 109 120 public Number getXValue(int series, int item) { 121 return xStart[item]; 122 } 123 124 132 public Number getYValue(int series, int item) { 133 return y[item]; 134 } 135 136 144 public Number getStartXValue(int series, int item) { 145 return xStart[item]; 146 } 147 148 156 public Number getEndXValue(int series, int item) { 157 return xEnd[item]; 158 } 159 160 168 public Number getStartYValue(int series, int item) { 169 return y[item]; 170 } 171 172 180 public Number getEndYValue(int series, int item) { 181 return y[item]; 182 } 183 184 189 public void addChangeListener(DatasetChangeListener listener) { 190 } 191 192 197 public void removeChangeListener(DatasetChangeListener listener) { 198 } 199 200 } 201 | Popular Tags |