1 37 38 39 package org.jfree.chart.demo; 40 41 import org.jfree.data.AbstractDataset; 42 import org.jfree.data.DatasetChangeListener; 43 import org.jfree.data.HighLowDataset; 44 import org.jfree.data.SignalsDataset; 45 46 51 public class SampleSignalDataset extends AbstractDataset implements SignalsDataset { 52 53 54 private HighLowDataset data; 55 56 59 public SampleSignalDataset() { 60 this.data = DemoDatasetFactory.createHighLowDataset(); 61 } 62 63 70 public int getItemCount(int series) { 71 return data.getItemCount(series); 72 } 73 74 79 public int getSeriesCount() { 80 return data.getSeriesCount(); 81 } 82 83 90 public String getSeriesName(int series) { 91 return data.getSeriesName(series); 92 } 93 94 105 public Number getXValue(int series, int item) { 106 return data.getXValue(series, item); 107 } 108 109 117 public Number getYValue(int series, int item) { 118 return data.getYValue(series, item); 119 } 120 121 129 public int getType(int series, int item) { 130 return SignalsDataset.ENTER_LONG; 131 } 132 133 141 public double getLevel(int series, int item) { 142 return getXValue(series, item).doubleValue(); 143 } 144 145 150 public void addChangeListener(DatasetChangeListener listener) { 151 data.addChangeListener(listener); 152 } 153 154 159 public void removeChangeListener(DatasetChangeListener listener) { 160 data.removeChangeListener(listener); 161 } 162 163 } 164 | Popular Tags |