XYPlot extends AbstractPlot implements Navigable, AxisListener { public void removePointRenderer(DataSource s, PointRenderer pointRenderer) { List<PointRenderer> pointRenderers = pointRenderersByDataSource.get(s); if (pointRenderers != null) { pointRenderers.remove(pointRenderer); } } XYPlot(DataSource... data); List<PointRenderer> getPointRenderers(DataSource s); void addPointRenderer(DataSource s, PointRenderer pointRenderer); void removePointRenderer(DataSource s, PointRenderer pointRenderer); void setPointRenderers(DataSource s, List<PointRenderer> pointRenderers); void setPointRenderers(DataSource s, PointRenderer pointRendererFirst, PointRenderer... pointRenderers); List<LineRenderer> getLineRenderers(DataSource s); void setLineRenderers(DataSource s, List<LineRenderer> lineRenderers); void setLineRenderers(DataSource s, LineRenderer lineRendererFirst, LineRenderer... lineRenderers); List<AreaRenderer> getAreaRenderers(DataSource s); void setAreaRenderers(DataSource s, List<AreaRenderer> areaRenderers); void setAreaRenderers(DataSource s, AreaRenderer areaRendererFirst, AreaRenderer... areaRenderers); @Override void setAxisRenderer(String axisName, AxisRenderer renderer); @Override void add(int index, DataSource source, boolean visible); Navigator getNavigator(); @Override void draw(DrawingContext context); void rangeChanged(Axis axis, Number min, Number max); static final String AXIS_X; static final String AXIS_X2; static final String AXIS_Y; static final String AXIS_Y2; }
@Test public void testRemovePointRenderer() { DataSource data = new DummyData(2, 1, 1); MockXYPlot plot = new MockXYPlot(); plot.removePointRenderer(null, null); plot.removePointRenderer(data, null); PointRenderer renderer = new DefaultPointRenderer2D(); plot.addPointRenderer(data, renderer); plot.removePointRenderer(data, renderer); assertTrue(plot.getPointRenderers(data).isEmpty()); }