XYPlot extends AbstractPlot implements Navigable, AxisListener { @Override public void draw(DrawingContext context) { super.draw(context); if (!navigatorInitialized) { getNavigator().setDefaultState(); navigatorInitialized = true; } } 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 testDraw() { for (MockXYPlot plot : plots) { BufferedImage image = createTestImage(); plot.setBounds(0.0, 0.0, image.getWidth(), image.getHeight()); DrawingContext context = new DrawingContext((Graphics2D) image.getGraphics()); plot.draw(context); assertTrue(plot.isDrawn()); assertNotEmpty(image); } }