Java 类org.jfree.chart.renderer.xy.StandardXYBarPainter 实例源码

项目:rapidminer    文件:DateTimeAttributeStatisticsModel.java   
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(final ExampleSet exampleSet) {
    JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
            PlotOrientation.VERTICAL, false, false, false);
    AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
    chart.setBackgroundPaint(null);
    chart.setBackgroundImageAlpha(0.0f);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setOutlineVisible(false);
    plot.setRangeZeroBaselineVisible(false);
    plot.setDomainZeroBaselineVisible(false);
    plot.getDomainAxis().setTickLabelsVisible(false);
    plot.setBackgroundPaint(COLOR_INVISIBLE);
    plot.setBackgroundImageAlpha(0.0f);

    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.DATE_TIME));
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    return chart;
}
项目:rapidminer    文件:NumericalAttributeStatisticsModel.java   
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(ExampleSet exampleSet) {
    JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
            PlotOrientation.VERTICAL, false, false, false);
    AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
    chart.setBackgroundPaint(null);
    chart.setBackgroundImageAlpha(0.0f);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setOutlineVisible(false);
    plot.setRangeZeroBaselineVisible(false);
    plot.setDomainZeroBaselineVisible(false);
    plot.setBackgroundPaint(COLOR_INVISIBLE);
    plot.setBackgroundImageAlpha(0.0f);

    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NUMERICAL));
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    return chart;
}
项目:ccu-historian    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:jfreechart    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme ({@code null} not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtils#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    Args.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:hmftools    文件:CopyNumberCharts.java   
@NotNull
static JFreeChart copyNumberPDF(@NotNull final List<PurpleCopyNumber> copyNumbers) {
    final XYDataset dataset = ploidyPDF(copyNumbers, PurpleCopyNumber::averageTumorCopyNumber, PurpleCopyNumber::bafCount);
    JFreeChart chart =
            ChartFactory.createScatterPlot("Copy Number PDF", "Ploidy", "BAF Count", dataset, PlotOrientation.VERTICAL, false, false,
                    false);

    XYBarRenderer renderer = new XYBarRenderer(0.9);
    renderer.setShadowVisible(false);
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setSeriesPaint(0, Color.BLUE);

    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.getDomainAxis().setRange(0, 10);
    xyPlot.setRenderer(renderer);
    return chart;
}
项目:hmftools    文件:CopyNumberCharts.java   
@NotNull
static JFreeChart minorAllelePDF(@NotNull final List<PurpleCopyNumber> variants) {
    final CategoryTableXYDataset dataset = minorAllele(variants);
    final JFreeChart chart =
            ChartFactory.createXYBarChart("Minor Allele Ploidy PDF", "Ploidy", false, "BAF Count", dataset, PlotOrientation.VERTICAL,
                    true, false, false);

    StackedXYBarRenderer renderer = new StackedXYBarRenderer();
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setShadowVisible(false);

    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.setRenderer(renderer);
    xyPlot.getDomainAxis().setRange(-1.1, 5.1);

    for (int i = 0; i < dataset.getSeriesCount(); i++) {
        renderer.setSeriesPaint(i, copyNumberColor(String.valueOf(dataset.getSeriesKey(i))));
    }
    return chart;
}
项目:hmftools    文件:CopyNumberCharts.java   
@NotNull
static JFreeChart somaticPloidyPDF(@NotNull final List<PurityAdjustedSomaticVariant> variants) {
    final CategoryTableXYDataset dataset = variants(variants);
    final JFreeChart chart =
            ChartFactory.createXYBarChart("Somatic Variant Ploidy PDF", "Ploidy", false, "Count", dataset, PlotOrientation.VERTICAL,
                    true, false, false);

    StackedXYBarRenderer renderer = new StackedXYBarRenderer();
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setShadowVisible(false);
    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.setRenderer(renderer);

    for (int i = 0; i < dataset.getSeriesCount(); i++) {
        renderer.setSeriesPaint(i, copyNumberColor(String.valueOf(dataset.getSeriesKey(i))));
    }
    return chart;
}
项目:aya-lang    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:rapidminer-studio    文件:DateTimeAttributeStatisticsModel.java   
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(final ExampleSet exampleSet) {
    JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
            PlotOrientation.VERTICAL, false, false, false);
    AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
    chart.setBackgroundPaint(null);
    chart.setBackgroundImageAlpha(0.0f);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setOutlineVisible(false);
    plot.setRangeZeroBaselineVisible(false);
    plot.setDomainZeroBaselineVisible(false);
    plot.getDomainAxis().setTickLabelsVisible(false);
    plot.setBackgroundPaint(COLOR_INVISIBLE);
    plot.setBackgroundImageAlpha(0.0f);

    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.DATE_TIME));
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    return chart;
}
项目:rapidminer-studio    文件:NumericalAttributeStatisticsModel.java   
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(ExampleSet exampleSet) {
    JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
            PlotOrientation.VERTICAL, false, false, false);
    AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
    chart.setBackgroundPaint(null);
    chart.setBackgroundImageAlpha(0.0f);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRangeGridlinesVisible(false);
    plot.setDomainGridlinesVisible(false);
    plot.setOutlineVisible(false);
    plot.setRangeZeroBaselineVisible(false);
    plot.setDomainZeroBaselineVisible(false);
    plot.setBackgroundPaint(COLOR_INVISIBLE);
    plot.setBackgroundImageAlpha(0.0f);

    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NUMERICAL));
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);

    return chart;
}
项目:jtem-halfedgetools    文件:HistogramVisualizer.java   
private void updateHistograms() {
    dataSet = new HistogramDataset();
    plotRenderer = new ColoredXYBarRenderer();
    plotRenderer.setShadowVisible(false);
    plotRenderer.setBarPainter(new StandardXYBarPainter());
    plot = new XYPlot(dataSet, domainAxis, rangeAxis, plotRenderer);
    for (HistogrammVisualization vis : activeHistograms) {
        vis.addDataSeries(dataSet);
        vis.addMarkers(plot);
    }
    plot.configureDomainAxes();
    plot.configureRangeAxes();
    chart = new JFreeChart(plot);
    chartPanel.setChart(chart);
    chartPanel.restoreAutoBounds();
}
项目:mzmine2    文件:PeakRenderer.java   
public PeakRenderer(Color color, boolean isTransparent) {

    this.isTransparent = isTransparent;

    // Set painting color
    setDefaultPaint(color);

    // Shadow makes fake peaks
    setShadowVisible(false);

    // Set the tooltip generator
    SpectraToolTipGenerator tooltipGenerator = new SpectraToolTipGenerator();
    setDefaultToolTipGenerator(tooltipGenerator);

    // We want to paint the peaks using simple color without any gradient
    // effects
    setBarPainter(new StandardXYBarPainter());
    }
项目:populus    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:PI    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    if (theme == null) {
        throw new IllegalArgumentException("Null 'theme' argument.");
    }
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:gama    文件:ChartJFreeChartOutputHistogram.java   
public static void enableFlatLook(final boolean flat) {
    if (flat) {
        BarRenderer.setDefaultBarPainter(new StandardBarPainter());
        BarRenderer.setDefaultShadowsVisible(false);
        XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        XYBarRenderer.setDefaultShadowsVisible(false);
        StackedBarRenderer.setDefaultBarPainter(new StandardBarPainter());
        StackedBarRenderer.setDefaultShadowsVisible(false);
    } else {
        BarRenderer.setDefaultBarPainter(new GradientBarPainter());
        BarRenderer.setDefaultShadowsVisible(true);
        XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        XYBarRenderer.setDefaultShadowsVisible(true);
        StackedBarRenderer.setDefaultBarPainter(new GradientBarPainter());
        StackedBarRenderer.setDefaultShadowsVisible(true);
    }
}
项目:ECG-Viewer    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:astor    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    if (theme == null) {
        throw new IllegalArgumentException("Null 'theme' argument.");
    }
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:imagej-ui-swing    文件:SwingHistogramWidget.java   
private final void setTheme(final JFreeChart chart) {
    final XYPlot plot = (XYPlot) chart.getPlot();
    final XYBarRenderer r = (XYBarRenderer) plot.getRenderer();
    final StandardXYBarPainter bp = new StandardXYBarPainter();
    r.setBarPainter(bp);
    r.setSeriesOutlinePaint(0, Color.lightGray);
    r.setShadowVisible(false);
    r.setDrawBarOutline(false);
    setBackgroundDefault(chart);
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();

    // rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setTickLabelsVisible(false);
    rangeAxis.setTickMarksVisible(false);
    final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setTickLabelsVisible(false);
    domainAxis.setTickMarksVisible(false);
}
项目:group-five    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:pm    文件:ChartMain.java   
public ChartMain(Date startDate, JFreeChartTimePeriod jFreeTimePeriod) {
    super();

    this.jFreeTimePeriod = jFreeTimePeriod;
    UIManager.put("ToolTip.background", new java.awt.Color(239, 203, 152, 255));
    UIManager.put("ToolTip.foreground", java.awt.Color.BLACK);

    //ToolTipManager.sharedInstance().setInitialDelay(100);
    ToolTipManager.sharedInstance().setInitialDelay(20);
    //ToolTipManager.sharedInstance().setReshowDelay(0);
    ToolTipManager.sharedInstance().setDismissDelay(120000);

    XYBarRenderer.setDefaultShadowsVisible(false);
    XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());

    barChartDisplayStrategy = new ChartBarSquare(this);

    lineAnnotations = new HashMap<Long, XYTextAnnotation>();

}
项目:manydesigns.cn    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:SPIM_Registration    文件:Histogram.java   
protected JFreeChart createChart( final IntervalXYDataset dataset, final String title, final String units )
{
    final JFreeChart chart = ChartFactory.createXYBarChart(
        title,
        "Distance [" + units + "]",
        false,
        "Count",
        dataset,
        PlotOrientation.VERTICAL,
        false, // legend
        false,
        false );

    final NumberAxis range = (NumberAxis) chart.getXYPlot().getDomainAxis();
    range.setRange( getMin(), getMax() );

    final XYPlot plot = chart.getXYPlot();
    final XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();

    renderer.setSeriesPaint( 0, Color.red );
    renderer.setDrawBarOutline( true );
    renderer.setSeriesOutlinePaint( 0, Color.black );
    renderer.setBarPainter( new StandardXYBarPainter() );

    return chart;
}
项目:buffer_bci    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:buffer_bci    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:proyecto-teoria-control-utn-frro    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:Memetic-Algorithm-for-TSP    文件:ChartFactory.java   
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
项目:iveely.ml    文件:ChartUtils.java   
public static void setChartTheme() {
    StandardChartTheme chartTheme = new StandardChartTheme("CN");
    chartTheme.setExtraLargeFont(FONT);
    chartTheme.setRegularFont(FONT);
    chartTheme.setLargeFont(FONT);
    chartTheme.setSmallFont(FONT);
    chartTheme.setTitlePaint(new Color(51, 51, 51));
    chartTheme.setSubtitlePaint(new Color(85, 85, 85));

    chartTheme.setLegendBackgroundPaint(Color.WHITE);
    chartTheme.setLegendItemPaint(Color.BLACK);//
    chartTheme.setChartBackgroundPaint(Color.WHITE);

    Paint[] OUTLINE_PAINT_SEQUENCE = new Paint[]{Color.WHITE};
    DefaultDrawingSupplier drawingSupplier = new DefaultDrawingSupplier(CHART_COLORS, CHART_COLORS, OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    chartTheme.setDrawingSupplier(drawingSupplier);

    chartTheme.setPlotBackgroundPaint(Color.WHITE);
    chartTheme.setPlotOutlinePaint(Color.WHITE);
    chartTheme.setLabelLinkPaint(new Color(8, 55, 114));
    chartTheme.setLabelLinkStyle(PieLabelLinkStyle.CUBIC_CURVE);

    chartTheme.setAxisOffset(new RectangleInsets(5, 12, 5, 12));
    chartTheme.setDomainGridlinePaint(new Color(192, 208, 224));
    chartTheme.setRangeGridlinePaint(new Color(192, 192, 192));

    chartTheme.setBaselinePaint(Color.WHITE);
    chartTheme.setCrosshairPaint(Color.BLUE);
    chartTheme.setAxisLabelPaint(new Color(51, 51, 51));
    chartTheme.setTickLabelPaint(new Color(67, 67, 72));
    chartTheme.setBarPainter(new StandardBarPainter());
    chartTheme.setXYBarPainter(new StandardXYBarPainter());

    chartTheme.setItemLabelPaint(Color.black);
    chartTheme.setThermometerPaint(Color.white);

    ChartFactory.setChartTheme(chartTheme);
}
项目:rapidminer    文件:ChartRendererFactory.java   
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
    StandardXYBarPainter barPainter = new StandardXYBarPainter();
    renderer.setBarPainter(barPainter);
    renderer.setGradientPaintTransformer(null);
    SeriesFormat seriesFormat = valueSource.getSeriesFormat();
    DimensionConfig domainConfig = valueSource.getDomainConfig();
    ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
    int seriesCount;
    if (valueSourceData != null) {
        seriesCount = valueSourceData.getSeriesCount();
    } else {
        seriesCount = 0;
    }
    DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
            PlotDimension.COLOR);
    // don't need shapeDimensionConfig, since the shape can't be represented for bars.

    // Loop all series and set series format.
    // Format based on dimension configs will be set later on in initFormatDelegate().
    for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
        // configure series paint if necessary
        if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
            renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
        }

        // configure general style of the bars
        renderer.setShadowVisible(false);
        renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
    }
    renderer.setDrawBarOutline(true);
}
项目:KATscans    文件:Histogram.java   
protected void configureChart() {
    logAxis.setTickLabelPaint(UIManager.getDefaults().getColor("Label.foreground"));
    linAxis.setTickLabelPaint(UIManager.getDefaults().getColor("Label.foreground"));

    domainAxis.setTickLabelPaint(UIManager.getDefaults().getColor("Label.foreground"));
    domainAxis.setRange(new Range(displayable.getMatrix().getMinValue(), displayable.getMatrix().getMaxValue()));
    domainAxis.setRangeType(RangeType.POSITIVE);

    barRenderer.setShadowVisible(false);
    barRenderer.setMargin(0);
    barRenderer.setBarPainter(new StandardXYBarPainter());
    barRenderer.setSeriesPaint(0, new Color(200, 80, 80));

    plot.setDomainAxis(domainAxis);
    plot.setBackgroundPaint(null);

    chart.setSubtitles(new ArrayList());
    chartPanel.setOpaque(false);

    chartPanel.getPopupMenu().addSeparator();
    chartPanel.getPopupMenu().add(menuLog);

    menuLog.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (log) {
                menuLog.setText("Logarithmic");
                plot.setRangeAxis(0, linAxis);                    
            } else {
                menuLog.setText("Linear");
                plot.setRangeAxis(0, logAxis);                    
            }
            log = !log;
        }
    });
}
项目:fact-tools    文件:HistogramArrayPlotter.java   
@Override
public void init(ProcessContext ctx) throws Exception {
    super.init(ctx);

    dataset = new SimpleHistogramDataset(key);

    chart = ChartFactory.createHistogram(
            title,
            key,
            "#",
            dataset,
            PlotOrientation.VERTICAL,
            true,
            true,
            false
    );

    chart.setBackgroundPaint(new Color(230, 230, 230));
    XYPlot xyplot = (XYPlot) chart.getPlot();
    if (logAxis)
        xyplot.setRangeAxis(new LogarithmicAxis("#"));

    chart.setTitle(title);
    xyplot.setForegroundAlpha(0.7F);
    xyplot.setBackgroundPaint(Color.WHITE);
    xyplot.setDomainGridlinePaint(new Color(150, 150, 150));
    xyplot.setRangeGridlinePaint(new Color(150, 150, 150));
    XYBarRenderer xybarrenderer = (XYBarRenderer) xyplot.getRenderer();
    xybarrenderer.setShadowVisible(false);
    xybarrenderer.setBarPainter(new StandardXYBarPainter());
    //      xybarrenderer.setDrawBarOutline(false);

    final ChartPanel chartPanel = new ChartPanel(chart);
    frame = new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(chartPanel, BorderLayout.CENTER);
    frame.setSize(width, height);
    frame.setVisible(true);
}
项目:fact-tools    文件:HistogramPlotter.java   
@Override
public void init(ProcessContext ctx) throws Exception {
    super.init(ctx);

    dataset = new SimpleHistogramDataset(key);

    chart = ChartFactory.createHistogram(
            title,
            key,
            "#",
            dataset,
            PlotOrientation.VERTICAL,
            true,
            true,
            false
    );

    chart.setBackgroundPaint(new Color(230, 230, 230));
    XYPlot xyplot = (XYPlot) chart.getPlot();
    if (logAxis)
        xyplot.setRangeAxis(new LogarithmicAxis("#"));

    chart.setTitle(title);
    xyplot.setForegroundAlpha(0.7F);
    xyplot.setBackgroundPaint(Color.WHITE);
    xyplot.setDomainGridlinePaint(new Color(150, 150, 150));
    xyplot.setRangeGridlinePaint(new Color(150, 150, 150));
    XYBarRenderer xybarrenderer = (XYBarRenderer) xyplot.getRenderer();
    xybarrenderer.setShadowVisible(false);
    xybarrenderer.setBarPainter(new StandardXYBarPainter());
    //      xybarrenderer.setDrawBarOutline(false);

    final ChartPanel chartPanel = new ChartPanel(chart);
    frame = new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(chartPanel, BorderLayout.CENTER);
    frame.setSize(width, height);
    frame.setVisible(true);
}
项目:rapidminer-studio    文件:ChartRendererFactory.java   
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
    StandardXYBarPainter barPainter = new StandardXYBarPainter();
    renderer.setBarPainter(barPainter);
    renderer.setGradientPaintTransformer(null);
    SeriesFormat seriesFormat = valueSource.getSeriesFormat();
    DimensionConfig domainConfig = valueSource.getDomainConfig();
    ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
    int seriesCount;
    if (valueSourceData != null) {
        seriesCount = valueSourceData.getSeriesCount();
    } else {
        seriesCount = 0;
    }
    DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
            PlotDimension.COLOR);
    // don't need shapeDimensionConfig, since the shape can't be represented for bars.

    // Loop all series and set series format.
    // Format based on dimension configs will be set later on in initFormatDelegate().
    for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
        // configure series paint if necessary
        if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
            renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
        }

        // configure general style of the bars
        renderer.setShadowVisible(false);
        renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
    }
    renderer.setDrawBarOutline(true);
}
项目:Health    文件:Histogram.java   
/**
 * Create Histogram chart.
 *
 * @param table
 *            table to use for chart
 * @param column
 *            column from table that should be used
 * @param bin
 *            the amount of bins to use
 * @return chart
 */
public static JFreeChart createHist(final Table table, final String column,
        final int bin) {
    final String xName = "Plotted column: " + column;
    final String yName = "";
    final double margin = 0.20;

    HistogramDataset dataSet = createDataset(table, column, bin);

    final CategoryAxis xAxis = new CategoryAxis(xName);
    xAxis.setLowerMargin(margin);
    xAxis.setUpperMargin(margin);
    final NumberAxis yAxis = new NumberAxis(yName);
    yAxis.setAutoRangeIncludesZero(false);

    JFreeChart chart = makeChart(dataSet, column);

    final int gridIn = 150;

    XYPlot xyplot = (XYPlot) chart.getPlot();
    xyplot.setBackgroundPaint(Color.WHITE);
    xyplot.setDomainGridlinePaint(new Color(gridIn, gridIn, gridIn));
    xyplot.setRangeGridlinePaint(new Color(gridIn, gridIn, gridIn));

    XYBarRenderer renderer = (XYBarRenderer) xyplot.getRenderer();
    renderer.setDrawBarOutline(true);
    renderer.setShadowVisible(false);
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setShadowVisible(false);

    return chart;
}
项目:jtem-halfedgetools    文件:HistogramVisualizer.java   
public HistogrammVisualization(
    HalfedgeLayer layer,
    Adapter<?> source,
    DataVisualizer visualizer, 
    NodeType type
) {
    super(layer, source, visualizer, type);
    renderer.setShadowVisible(false);
    renderer.setBarPainter(new StandardXYBarPainter());
}
项目:astor    文件:StandardXYBarPainterTests.java   
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    StandardXYBarPainter p1 = new StandardXYBarPainter();
    StandardXYBarPainter p2 = new StandardXYBarPainter();
    assertTrue(p1.equals(p2));
    int h1 = p1.hashCode();
    int h2 = p2.hashCode();
    assertEquals(h1, h2);
}
项目:imglib2-script    文件:Histogram.java   
static private final void setTheme(final JFreeChart chart) {
    XYPlot plot = (XYPlot) chart.getPlot();
    XYBarRenderer r = (XYBarRenderer) plot.getRenderer();
    StandardXYBarPainter bp = new StandardXYBarPainter();
    r.setBarPainter(bp);
    r.setSeriesOutlinePaint(0, Color.lightGray);
    r.setShadowVisible(false);
    r.setDrawBarOutline(false);
    setBackgroundDefault(chart);
}
项目:snap-desktop    文件:StatisticsPanel.java   
private static ChartPanel getHistogramPlotPanel(XIntervalSeriesCollection dataset, String xAxisLabel, String yAxisLabel, Color color) {
        JFreeChart chart = ChartFactory.createHistogram(
                null,
                xAxisLabel,
                yAxisLabel,
                dataset,
                PlotOrientation.VERTICAL,
                false,  // Legend?
                true,   // tooltips
                false   // url
        );
        final XYPlot xyPlot = chart.getXYPlot();
        //xyPlot.setForegroundAlpha(0.85f);
        xyPlot.setNoDataMessage("No data");
        xyPlot.setAxisOffset(new RectangleInsets(5, 5, 5, 5));

        final XYBarRenderer renderer = (XYBarRenderer) xyPlot.getRenderer();
        renderer.setDrawBarOutline(false);
        renderer.setShadowVisible(false);
        renderer.setSeriesPaint(0, color);
        StandardXYBarPainter painter = new StandardXYBarPainter();
        renderer.setBarPainter(painter);

        ChartPanel chartPanel = new ChartPanel(chart);
        chartPanel.setPreferredSize(new Dimension(300, 200));
//        chartPanel.getPopupMenu().add(createCopyDataToClipboardMenuItem());
        return chartPanel;
    }
项目:snap-desktop    文件:HistogramPanel.java   
private void createUI() {
    dataset = new XIntervalSeriesCollection();
    chart = ChartFactory.createHistogram(
            CHART_TITLE,
            "Values",
            "Frequency in #pixels",
            dataset,
            PlotOrientation.VERTICAL,
            false,  // Legend?
            true,   // tooltips
            false   // url
    );
    final XYPlot xyPlot = chart.getXYPlot();
    xyPlot.setDomainZeroBaselineStroke(new BasicStroke(0.2f));

    final XYBarRenderer renderer = (XYBarRenderer) xyPlot.getRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setShadowVisible(false);
    renderer.setShadowYOffset(-4.0);
    renderer.setBaseToolTipGenerator(new XYPlotToolTipGenerator());
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setSeriesPaint(0, new Color(0, 0, 200));

    createUI(createChartPanel(chart), createOptionsPanel(), bindingContext);

    isInitialized = true;

    final Binding minBinding = xAxisRangeControl.getBindingContext().getBinding("min");
    final double min = (Double) minBinding.getPropertyValue();
    final Binding maxBinding = xAxisRangeControl.getBindingContext().getBinding("max");
    final double max = (Double) maxBinding.getPropertyValue();
    if (!histogramComputing && min > max) {
        minBinding.setPropertyValue(max);
        maxBinding.setPropertyValue(min);
    }
    updateXAxis();
}
项目:rapidminer-5    文件:ChartRendererFactory.java   
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
    StandardXYBarPainter barPainter = new StandardXYBarPainter();
    renderer.setBarPainter(barPainter);
    renderer.setGradientPaintTransformer(null);
    SeriesFormat seriesFormat = valueSource.getSeriesFormat();
    DimensionConfig domainConfig = valueSource.getDomainConfig();
    ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
    int seriesCount;
    if (valueSourceData != null) {
        seriesCount = valueSourceData.getSeriesCount();
    } else {
        seriesCount = 0;
    }
    DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(PlotDimension.COLOR);
    // don't need shapeDimensionConfig, since the shape can't be represented for bars.

    // Loop all series and set series format.
    // Format based on dimension configs will be set later on in initFormatDelegate().
    for(int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
        // configure series paint if necessary
        if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
            renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
        }

        // configure general style of the bars
        renderer.setShadowVisible(false);
        renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
    }
    renderer.setDrawBarOutline(true);
}
项目:jClipCorn    文件:StatisticsYearChart.java   
@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
    JFreeChart chart = ChartFactory.createHistogram(
            "",  //$NON-NLS-1$
            "",  //$NON-NLS-1$
            "",  //$NON-NLS-1$
            getDataSet(movielist, source), 
            PlotOrientation.VERTICAL, 
            false, 
            false, 
            false
            );

    chart.removeLegend();

    XYPlot plot = chart.getXYPlot();

    XYBarRenderer bar_renderer = (XYBarRenderer) plot.getRenderer();
    bar_renderer.setBaseFillPaint(HISTOGRAMMCHART_COLOR);
    bar_renderer.setMargin( 0.2 );
    bar_renderer.setBarAlignmentFactor( 0 );
    bar_renderer.setSeriesPaint(0, HISTOGRAMMCHART_COLOR);
    bar_renderer.setShadowVisible(true);
    bar_renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator("{1}: {2}", new DecimalFormat("0"), new DecimalFormat("0"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    bar_renderer.setBarPainter(new StandardXYBarPainter());

    plot.setBackgroundPaint(HISTOGRAMMACKGROUND_COLOR);
    plot.setDomainGridlinePaint(GRIDLINECOLOR);
    plot.setRangeGridlinePaint(GRIDLINECOLOR);

    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    if (plot.getDomainAxis() instanceof NumberAxis) {
        ((NumberAxis)plot.getDomainAxis()).setNumberFormatOverride(new DecimalFormat("0")); //$NON-NLS-1$
    }
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);

    return chart;
}