Java Code Examples for org.jfree.chart.renderer.xy.XYLine3DRenderer#setXOffset()

The following examples show how to use org.jfree.chart.renderer.xy.XYLine3DRenderer#setXOffset() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XYLine3DRendererTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    XYLine3DRenderer r1 = new XYLine3DRenderer();
    XYLine3DRenderer r2 = new XYLine3DRenderer();
    assertEquals(r1, r2);

    r1.setXOffset(11.1);
    assertFalse(r1.equals(r2));
    r2.setXOffset(11.1);
    assertTrue(r1.equals(r2));

    r1.setYOffset(11.1);
    assertFalse(r1.equals(r2));
    r2.setYOffset(11.1);
    assertTrue(r1.equals(r2));

    r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,
            4.0f, Color.blue));
    assertFalse(r1.equals(r2));
    r2.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,
            4.0f, Color.blue));
    assertTrue(r1.equals(r2));
}
 
Example 2
Source File: XYLine3DRendererTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    XYLine3DRenderer r1 = new XYLine3DRenderer();
    XYLine3DRenderer r2 = new XYLine3DRenderer();
    assertEquals(r1, r2);
    
    r1.setXOffset(11.1);
    assertFalse(r1.equals(r2));
    r2.setXOffset(11.1);
    assertTrue(r1.equals(r2));

    r1.setYOffset(11.1);
    assertFalse(r1.equals(r2));
    r2.setYOffset(11.1);
    assertTrue(r1.equals(r2));
    
    r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 
            4.0f, Color.blue));
    assertFalse(r1.equals(r2));
    r2.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 
            4.0f, Color.blue));
    assertTrue(r1.equals(r2));   
}
 
Example 3
Source File: EyeCandySixtiesChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected JFreeChart createXyLineChart() throws JRException
{
	JFreeChart jfreeChart = super.createXyLineChart();
	XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();

	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
	XYLine3DRenderer line3DRenderer = new XYLine3DRenderer();


	line3DRenderer.setBaseToolTipGenerator(lineRenderer.getBaseToolTipGenerator());
	line3DRenderer.setURLGenerator(lineRenderer.getURLGenerator());
	line3DRenderer.setBaseStroke(new BasicStroke(2, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
	line3DRenderer.setBaseLinesVisible(lineRenderer.getBaseLinesVisible());
	line3DRenderer.setBaseShapesVisible(lineRenderer.getBaseShapesVisible());
	Stroke stroke = new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
	XYDataset xyDataset = xyPlot.getDataset();
	if (xyDataset != null)
	{
		for (int i = 0; i < xyDataset.getSeriesCount(); i++)
		{
			line3DRenderer.setSeriesStroke(i, stroke);
			line3DRenderer.setSeriesLinesVisible(i, lineRenderer.getBaseLinesVisible());
			line3DRenderer.setSeriesShapesVisible(i, lineRenderer.getBaseShapesVisible());
		}
	}
	line3DRenderer.setXOffset(2);
	line3DRenderer.setYOffset(2);
	line3DRenderer.setWallPaint(ChartThemesConstants.GRAY_PAINT_134);

	xyPlot.setRenderer(line3DRenderer);
	return jfreeChart;
}