XYPlot extends AbstractPlot implements Navigable, AxisListener { public List<AreaRenderer> getAreaRenderers(DataSource s) { List<AreaRenderer> areaRenderers = areaRenderersByDataSource.get(s); if (areaRenderers != null) { return Collections.unmodifiableList(areaRenderers); } return Collections.emptyList(); } 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 testGetAreaRenderers() { DataSource data = new DummyData(2, 1, 1.0); MockXYPlot plot = new MockXYPlot(data); AreaRenderer renderer = new DefaultAreaRenderer2D(); plot.setAreaRenderers(data, renderer); assertNotNull(plot.getAreaRenderers(new DummyData(4, 2, 0.0))); assertNotNull(plot.getAreaRenderers(null)); List<AreaRenderer> renderers = plot.getAreaRenderers(data); assertTrue(renderers.contains(renderer)); assertEquals(renderers.size(), 1); }