Java Code Examples for org.jfree.chart.renderer.xy.StandardXYItemRenderer#setBaseShapesFilled()

The following examples show how to use org.jfree.chart.renderer.xy.StandardXYItemRenderer#setBaseShapesFilled() . 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: LineChartBuilder.java    From nmonvisualizer with Apache License 2.0 6 votes vote down vote up
private void formatRenderer(int index) {
    // show filled markers at each data point
    StandardXYItemRenderer renderer = (StandardXYItemRenderer) chart.getXYPlot().getRenderer(index);

    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);

    // if no data for more than 1 granularity's time period, do not draw a connecting line
    renderer.setPlotDiscontinuous(true);
    renderer.setGapThresholdType(UnitType.ABSOLUTE);

    recalculateGapThreshold(index);

    renderer.setBaseToolTipGenerator(tooltipGenerator);

    if (!definition.showDataPoints()) {
        renderer.setAutoPopulateSeriesShape(false);
        renderer.setBaseShape(new java.awt.Rectangle(), false);
    }
}
 
Example 2
Source File: StandardXYItemRendererTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    StandardXYItemRenderer r1 = new StandardXYItemRenderer();
    StandardXYItemRenderer r2 = new StandardXYItemRenderer();
    assertEquals(r1, r2);

    r1.setBaseShapesVisible(true);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesVisible(true);
    assertTrue(r1.equals(r2));

    r1.setPlotLines(false);
    assertFalse(r1.equals(r2));
    r2.setPlotLines(false);
    assertTrue(r1.equals(r2));

    r1.setPlotImages(true);
    assertFalse(r1.equals(r2));
    r2.setPlotImages(true);
    assertTrue(r1.equals(r2));

    r1.setPlotDiscontinuous(true);
    assertFalse(r1.equals(r2));
    r2.setPlotDiscontinuous(true);
    assertTrue(r1.equals(r2));

    r1.setGapThresholdType(UnitType.ABSOLUTE);
    assertFalse(r1.equals(r2));
    r2.setGapThresholdType(UnitType.ABSOLUTE);
    assertTrue(r1.equals(r2));

    r1.setGapThreshold(1.23);
    assertFalse(r1.equals(r2));
    r2.setGapThreshold(1.23);
    assertTrue(r1.equals(r2));

    r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(r1.equals(r2));
    r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(r1.equals(r2));

    r1.setSeriesShapesFilled(1, Boolean.TRUE);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesFilled(1, Boolean.TRUE);
    assertTrue(r1.equals(r2));

    r1.setBaseShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesFilled(false);
    assertTrue(r1.equals(r2));

    r1.setDrawSeriesLineAsPath(true);
    assertFalse(r1.equals(r2));
    r2.setDrawSeriesLineAsPath(true);
    assertTrue(r1.equals(r2));
}
 
Example 3
Source File: StandardXYItemRendererTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    StandardXYItemRenderer r1 = new StandardXYItemRenderer();
    StandardXYItemRenderer r2 = new StandardXYItemRenderer();
    assertEquals(r1, r2);
    
    r1.setBaseShapesVisible(true);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesVisible(true);
    assertTrue(r1.equals(r2));
    
    r1.setPlotLines(false);
    assertFalse(r1.equals(r2));
    r2.setPlotLines(false);
    assertTrue(r1.equals(r2));

    r1.setPlotImages(true);
    assertFalse(r1.equals(r2));
    r2.setPlotImages(true);
    assertTrue(r1.equals(r2));

    r1.setPlotDiscontinuous(true);
    assertFalse(r1.equals(r2));
    r2.setPlotDiscontinuous(true);
    assertTrue(r1.equals(r2));
    
    r1.setGapThresholdType(UnitType.ABSOLUTE);
    assertFalse(r1.equals(r2));
    r2.setGapThresholdType(UnitType.ABSOLUTE);
    assertTrue(r1.equals(r2));
    
    r1.setGapThreshold(1.23);
    assertFalse(r1.equals(r2));
    r2.setGapThreshold(1.23);
    assertTrue(r1.equals(r2));
    
    r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(r1.equals(r2));
    r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(r1.equals(r2));
    
    r1.setSeriesShapesFilled(1, Boolean.TRUE);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesFilled(1, Boolean.TRUE);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesFilled(false);
    assertTrue(r1.equals(r2));
    
    r1.setDrawSeriesLineAsPath(true);
    assertFalse(r1.equals(r2));
    r2.setDrawSeriesLineAsPath(true);
    assertTrue(r1.equals(r2));
}