org.jfree.chart.renderer.category.LineRenderer3D Java Examples

The following examples show how to use org.jfree.chart.renderer.category.LineRenderer3D. 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: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    LineRenderer3D r1 = new LineRenderer3D();
    LineRenderer3D r2 = new LineRenderer3D();
    assertEquals(r1, r2);

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

    r1.setYOffset(111.1);
    assertFalse(r1.equals(r2));
    r2.setYOffset(111.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: ChartFactory.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator());
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #3
Source File: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    LineRenderer3D r1 = new LineRenderer3D();
    LineRenderer3D r2 = new LineRenderer3D();
    assertEquals(r1, r2);
    
    r1.setXOffset(99.9);
    assertFalse(r1.equals(r2));
    r2.setXOffset(99.9);
    assertTrue(r1.equals(r2));
    
    r1.setYOffset(111.1);
    assertFalse(r1.equals(r2));
    r2.setYOffset(111.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 #4
Source File: ChartFactory.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical)
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #5
Source File: ChartFactory.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical)
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #6
Source File: ChartFactory.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical)
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #7
Source File: ChartFactory.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical)
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #8
Source File: ChartFactory.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical)
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #9
Source File: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    LineRenderer3D r1 = new LineRenderer3D();
    LineRenderer3D r2 = new LineRenderer3D();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
Example #10
Source File: ChartFactory.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by 
 * this method uses a {@link CategoryPlot} instance as the plot, with a 
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as 
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis 
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code> 
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical) 
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
                                           String categoryAxisLabel,
                                           String valueAxisLabel,
                                           CategoryDataset dataset,
                                           PlotOrientation orientation,
                                           boolean legend,
                                           boolean tooltips,
                                           boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);

    return chart;

}
 
Example #11
Source File: ChartFactory.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by
 * this method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical)
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
Example #12
Source File: ChartFactory.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a line chart with default settings. The chart object returned by 
 * this method uses a {@link CategoryPlot} instance as the plot, with a 
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as 
 * the range axis, and a {@link LineRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis 
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code> 
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the chart orientation (horizontal or vertical) 
 *                     (<code>null</code> not permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A line chart.
 */
public static JFreeChart createLineChart3D(String title,
                                           String categoryAxisLabel,
                                           String valueAxisLabel,
                                           CategoryDataset dataset,
                                           PlotOrientation orientation,
                                           boolean legend,
                                           boolean tooltips,
                                           boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    LineRenderer3D renderer = new LineRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseURLGenerator(new StandardCategoryURLGenerator());
    }
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);

    return chart;

}
 
Example #13
Source File: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    LineRenderer3D r1 = new LineRenderer3D();
    LineRenderer3D r2 = new LineRenderer3D();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
Example #14
Source File: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Checks that the two renderers are equal but independent of one another.
 *
 * @param r1  renderer 1.
 * @param r2  renderer 2.
 *
 * @return A boolean.
 */
private boolean checkIndependence(LineRenderer3D r1, LineRenderer3D r2) {

    // should be equal...
    boolean b0 = r1.equals(r2);

    // and independent...
    r1.setBaseLinesVisible(!r1.getBaseLinesVisible());
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseLinesVisible(r1.getBaseLinesVisible());
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesLinesVisible(1, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesLinesVisible(1, true);
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setBaseShapesVisible(!r1.getBaseShapesVisible());
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseShapesVisible(r1.getBaseShapesVisible());
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesShapesVisible(1, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesShapesVisible(1, true);
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesShapesFilled(0, false);
    r2.setSeriesShapesFilled(0, true);
    boolean b7 = !r1.equals(r2);
    r2.setSeriesShapesFilled(0, false);
    boolean b8 = (r1.equals(r2));

    r1.setBaseShapesFilled(false);
    r2.setBaseShapesFilled(true);
    boolean b9 = !r1.equals(r2);
    r2.setBaseShapesFilled(false);
    boolean b10 = (r1.equals(r2));

    return b0 && b7 && b8 && b9 && b10;

}
 
Example #15
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
 
Example #16
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
 
Example #17
Source File: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Checks that the two renderers are equal but independent of one another.
 * 
 * @param r1  renderer 1.
 * @param r2  renderer 2.
 * 
 * @return A boolean.
 */
private boolean checkIndependence(LineRenderer3D r1, LineRenderer3D r2) {

    // should be equal...
    boolean b0 = r1.equals(r2);
    
    // and independent...
    r1.setBaseLinesVisible(!r1.getBaseLinesVisible());
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseLinesVisible(r1.getBaseLinesVisible());
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesLinesVisible(1, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesLinesVisible(1, true);
    if (!r1.equals(r2)) {
        return false;
    }
            
    r1.setBaseShapesVisible(!r1.getBaseShapesVisible());
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseShapesVisible(r1.getBaseShapesVisible());
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesShapesVisible(1, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesShapesVisible(1, true);
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesShapesFilled(0, false);
    r2.setSeriesShapesFilled(0, true);
    boolean b7 = !r1.equals(r2);
    r2.setSeriesShapesFilled(0, false);
    boolean b8 = (r1.equals(r2));
    
    r1.setBaseShapesFilled(false);
    r2.setBaseShapesFilled(true);
    boolean b9 = !r1.equals(r2);
    r2.setBaseShapesFilled(false);
    boolean b10 = (r1.equals(r2));
    
    return b0 && b7 && b8 && b9 && b10;

}
 
Example #18
Source File: StandardChartTheme.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    if (renderer == null) {
        throw new IllegalArgumentException("Null 'renderer' argument.");
    }

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
 
Example #19
Source File: LineRenderer3DTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Check that this class implements PublicCloneable.
 */
public void testPublicCloneable() {
    LineRenderer3D r1 = new LineRenderer3D();
    assertTrue(r1 instanceof PublicCloneable);
}
 
Example #20
Source File: StandardChartTheme.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
 
Example #21
Source File: StandardChartTheme.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
 
Example #22
Source File: StandardChartTheme.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}
 
Example #23
Source File: StandardChartTheme.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");

    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }

    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);

    // now we handle some special cases - yes, UGLY code alert!

    // BarRenderer
    if (renderer instanceof BarRenderer) {
        BarRenderer br = (BarRenderer) renderer;
        br.setBarPainter(this.barPainter);
        br.setShadowVisible(this.shadowVisible);
        br.setShadowPaint(this.shadowPaint);
    }

    // BarRenderer3D
    if (renderer instanceof BarRenderer3D) {
        BarRenderer3D br3d = (BarRenderer3D) renderer;
        br3d.setWallPaint(this.wallPaint);
    }

    // LineRenderer3D
    if (renderer instanceof LineRenderer3D) {
        LineRenderer3D lr3d = (LineRenderer3D) renderer;
        lr3d.setWallPaint(this.wallPaint);
    }

    //  StatisticalBarRenderer
    if (renderer instanceof StatisticalBarRenderer) {
        StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
        sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
    }

    // MinMaxCategoryRenderer
    if (renderer instanceof MinMaxCategoryRenderer) {
        MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
        mmcr.setGroupPaint(this.errorIndicatorPaint);
    }
}