本文整理汇总了Java中org.jfree.data.xy.DefaultTableXYDataset.removeSeries方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultTableXYDataset.removeSeries方法的具体用法?Java DefaultTableXYDataset.removeSeries怎么用?Java DefaultTableXYDataset.removeSeries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.xy.DefaultTableXYDataset
的用法示例。
在下文中一共展示了DefaultTableXYDataset.removeSeries方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAutoPrune
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Tests the auto-pruning feature.
*/
public void testAutoPrune() {
// WITH AUTOPRUNING
final DefaultTableXYDataset dataset = new DefaultTableXYDataset(true);
dataset.addSeries(createSeriesA());
assertEquals(2, dataset.getItemCount()); // should be 2 items
dataset.addSeries(createSeriesB());
assertEquals(2, dataset.getItemCount()); // still 2
dataset.removeSeries(1);
assertEquals(1, dataset.getItemCount()); // 1 value pruned.
// WITHOUT AUTOPRUNING
final DefaultTableXYDataset dataset2 = new DefaultTableXYDataset(true);
dataset2.addSeries(createSeriesA());
assertEquals(2, dataset2.getItemCount()); // should be 2 items
dataset2.addSeries(createSeriesB());
assertEquals(2, dataset2.getItemCount()); // still 2
dataset2.removeSeries(1);
assertEquals(1, dataset2.getItemCount()); // still 2.
}
示例2: testAutoPrune
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Tests the auto-pruning feature.
*/
public void testAutoPrune() {
// WITH AUTOPRUNING
DefaultTableXYDataset dataset = new DefaultTableXYDataset(true);
dataset.addSeries(createSeriesA());
assertEquals(2, dataset.getItemCount()); // should be 2 items
dataset.addSeries(createSeriesB());
assertEquals(2, dataset.getItemCount()); // still 2
dataset.removeSeries(1);
assertEquals(1, dataset.getItemCount()); // 1 value pruned.
// WITHOUT AUTOPRUNING
DefaultTableXYDataset dataset2 = new DefaultTableXYDataset(true);
dataset2.addSeries(createSeriesA());
assertEquals(2, dataset2.getItemCount()); // should be 2 items
dataset2.addSeries(createSeriesB());
assertEquals(2, dataset2.getItemCount()); // still 2
dataset2.removeSeries(1);
assertEquals(1, dataset2.getItemCount()); // still 2.
}
示例3: testAutoPrune
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Tests the auto-pruning feature.
*/
public void testAutoPrune() {
// WITH AUTOPRUNING
DefaultTableXYDataset dataset = new DefaultTableXYDataset(true);
dataset.addSeries(createSeriesA());
assertEquals(2, dataset.getItemCount()); // should be 2 items
dataset.addSeries(createSeriesB());
assertEquals(2, dataset.getItemCount()); // still 2
dataset.removeSeries(1);
assertEquals(1, dataset.getItemCount()); // 1 value pruned.
// WITHOUT AUTOPRUNING
DefaultTableXYDataset dataset2 = new DefaultTableXYDataset(true);
dataset2.addSeries(createSeriesA());
assertEquals(2, dataset2.getItemCount()); // should be 2 items
dataset2.addSeries(createSeriesB());
assertEquals(2, dataset2.getItemCount()); // still 2
dataset2.removeSeries(1);
assertEquals(1, dataset2.getItemCount()); // still 2.
}
示例4: testTableXYDataset
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Assorted tests.
*/
public void testTableXYDataset() {
XYSeries series1 = createSeries1();
final XYSeries series2 = createSeries2();
final DefaultTableXYDataset dataset = new DefaultTableXYDataset();
dataset.addSeries(series1);
dataset.addSeries(series2);
// Test that there are 6 X points and some specific values
assertEquals(6, dataset.getItemCount());
assertEquals(6, dataset.getX(0, 5).intValue());
assertEquals(null, dataset.getY(0, 5));
assertEquals(6, dataset.getX(1, 5).intValue());
assertEquals(2, dataset.getY(1, 5).intValue());
// after adding a point to a series, check that there are now 7 items in each series
series2.add(7, 2);
assertEquals(7, dataset.getItemCount());
assertEquals(null, dataset.getY(0, 6));
assertEquals(2, dataset.getY(1, 6).intValue());
// Remove series 1
dataset.removeSeries(series1);
// Test that there are still 7 X points
assertEquals(7, dataset.getItemCount());
// Remove series 2 and add new series
dataset.removeSeries(series2);
series1 = createSeries1();
dataset.addSeries(series1);
// Test that there are now 4 X points
assertEquals(4, dataset.getItemCount());
}
示例5: testPrune
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Tests to see that pruning removes unwanted x values.
*/
public void testPrune() {
final DefaultTableXYDataset dataset = new DefaultTableXYDataset();
dataset.addSeries(createSeries1());
dataset.addSeries(createSeries2());
dataset.removeSeries(1);
dataset.prune();
assertEquals(4, dataset.getItemCount());
}
示例6: testTableXYDataset
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Assorted tests.
*/
public void testTableXYDataset() {
XYSeries series1 = createSeries1();
XYSeries series2 = createSeries2();
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
dataset.addSeries(series1);
dataset.addSeries(series2);
// Test that there are 6 X points and some specific values
assertEquals(6, dataset.getItemCount());
assertEquals(6, dataset.getX(0, 5).intValue());
assertEquals(null, dataset.getY(0, 5));
assertEquals(6, dataset.getX(1, 5).intValue());
assertEquals(2, dataset.getY(1, 5).intValue());
// after adding a point to a series, check that there are now 7
// items in each series
series2.add(7, 2);
assertEquals(7, dataset.getItemCount());
assertEquals(null, dataset.getY(0, 6));
assertEquals(2, dataset.getY(1, 6).intValue());
// Remove series 1
dataset.removeSeries(series1);
// Test that there are still 7 X points
assertEquals(7, dataset.getItemCount());
// Remove series 2 and add new series
dataset.removeSeries(series2);
series1 = createSeries1();
dataset.addSeries(series1);
// Test that there are now 4 X points
assertEquals(4, dataset.getItemCount());
}
示例7: testPrune
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Tests to see that pruning removes unwanted x values.
*/
public void testPrune() {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
dataset.addSeries(createSeries1());
dataset.addSeries(createSeries2());
dataset.removeSeries(1);
dataset.prune();
assertEquals(4, dataset.getItemCount());
}
示例8: removeSeries
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/** Remove a data series */
public void removeSeries(String name){
DefaultTableXYDataset dataset = (DefaultTableXYDataset)chart.getXYPlot().getDataset(0);
int id = ((Integer)seriesIds.get(name)).intValue();
dataset.removeSeries(id);
// Decrament all ids greater than id
for(Enumeration i = seriesIds.keys(); i.hasMoreElements();){
String k = (String)i.nextElement();
int tmpId = ((Integer)seriesIds.get(k)).intValue();
if(tmpId > id)
seriesIds.put(k, new Integer(tmpId - 1));
}
seriesCount--;
}
示例9: testTableXYDataset
import org.jfree.data.xy.DefaultTableXYDataset; //导入方法依赖的package包/类
/**
* Assorted tests.
*/
public void testTableXYDataset() {
XYSeries series1 = createSeries1();
XYSeries series2 = createSeries2();
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
dataset.addSeries(series1);
dataset.addSeries(series2);
// Test that there are 6 X points and some specific values
assertEquals(6, dataset.getItemCount());
assertEquals(6, dataset.getX(0, 5).intValue());
assertEquals(null, dataset.getY(0, 5));
assertEquals(6, dataset.getX(1, 5).intValue());
assertEquals(2, dataset.getY(1, 5).intValue());
// after adding a point to a series, check that there are now 7
// items in each series
series2.add(7, 2);
assertEquals(7, dataset.getItemCount());
assertEquals(null, dataset.getY(0, 6));
assertEquals(2, dataset.getY(1, 6).intValue());
// Remove series 1
dataset.removeSeries(series1);
// Test that there are still 7 X points
assertEquals(7, dataset.getItemCount());
// Remove series 2 and add new series
dataset.removeSeries(series2);
series1 = createSeries1();
dataset.addSeries(series1);
// Test that there are now 4 X points
assertEquals(4, dataset.getItemCount());
}