Package org.jfree.chart.renderer

Examples of org.jfree.chart.renderer.AbstractRenderer


  public Plot getPlot(int chartType) throws DatasetProduceException, ChartValidationException {
    if (plot == null) {
      int rendererIndex = PlotTypes.getRendererIndex(type);

      Dataset data = getDataset();
      AbstractRenderer rend = PlotTypes.getRenderer(rendererIndex);
      if (chartType == ChartConstants.OVERLAY_XY || chartType == ChartConstants.COMBINED_XY) {
        switch (rendererIndex) {
          case PlotConstants.XY_AREA :
          case PlotConstants.XY_LINE :
          case PlotConstants.XY_SHAPES_AND_LINES :
View Full Code Here


    if (plot == null) {
      int rendererIndex = PlotTypes.getRendererIndex(type);
     
      Dataset data = (Dataset) getDataset();
      log.debug("Plot.getPlot: data name: " +data.getClass().getName());
      AbstractRenderer rend = PlotTypes.getRenderer(rendererIndex);
      log.debug("Plot.getPlot: rendererIndex: " + rendererIndex);
      if (chartType == ChartConstants.OVERLAY_XY || chartType == ChartConstants.COMBINED_XY) {
        switch (rendererIndex) {
          case XY_AREA :
          case XY_LINE :
View Full Code Here

    }

    public void configure(ChartView view, ConfigurableRenderer configurableRenderer) {
        LineChartView chartView = (LineChartView) view;
        final boolean fillPaintsSpecified = chartView.getFillPaints() != null && !chartView.getFillPaints().isEmpty();
        AbstractRenderer renderer = (AbstractRenderer) configurableRenderer;

        if (chartView.getDefaultFillColor() != null || fillPaintsSpecified) {
            if (renderer instanceof XYRendererAdapter) {
                ((XYRendererAdapter) renderer).setUseFillPaint(true);
            } else if (renderer instanceof LineAndShapeRenderer) {
                ((LineAndShapeRenderer) renderer).setUseFillPaint(true);
            }
        }

        if (chartView.getDefaultFillColor() != null && !fillPaintsSpecified) {
            renderer.setBaseFillPaint(chartView.getDefaultFillColor());
            for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                renderer.setSeriesFillPaint(seriesIndex, chartView.getDefaultFillColor());
            }
        } else if (fillPaintsSpecified) {
            final Iterator fillPaintsIterator = chartView.getFillPaints().iterator();
            for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                if (fillPaintsIterator.hasNext()) {
                    final Paint paint = (Paint) fillPaintsIterator.next();
                    renderer.setSeriesFillPaint(seriesIndex, paint);
                }
            }
        }
    }
View Full Code Here

    public void configure(ChartView view, ConfigurableRenderer configurableRenderer) {
        GridChartView chartView = (GridChartView) view;
        boolean isLabelsVisible = chartView.isLabelsVisible();

        AbstractRenderer renderer = (AbstractRenderer) configurableRenderer;

        if (isLabelsVisible) {
            renderer.setBaseItemLabelsVisible(true);

            setGenerator(renderer);
            defaultInit(chartView, renderer);
            colorInit(chartView, renderer);
        } else {
            renderer.setBaseItemLabelsVisible(false);
            if (chartView.getLabels() == null || chartView.getLabels().getText() == null) {
                setGenerator(renderer);
            }
        }
    }
View Full Code Here

    public void configure(ChartView view, ConfigurableRenderer configurableRenderer) {
        LineChartView chartView = (LineChartView) view;

        final boolean lineStylesSpecified = chartView.getLineStyles() != null && !chartView.getLineStyles().isEmpty();
        AbstractRenderer renderer = (AbstractRenderer) configurableRenderer;

        if (renderer instanceof XYRendererAdapter) {
            ((XYRendererAdapter) renderer).setBaseShapesVisible(chartView.isShapesVisible());
        } else if (renderer instanceof LineAndShapeRenderer) {
            ((LineAndShapeRenderer) renderer).setBaseShapesVisible(chartView.isShapesVisible());
        }

        if (chartView.getDefaultLineStyle() != null && !lineStylesSpecified) {
            renderer.setBaseStroke(chartView.getDefaultLineStyle().getStroke());
            for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                renderer.setSeriesStroke(seriesIndex, chartView.getDefaultLineStyle().getStroke());
            }
        } else if (lineStylesSpecified) {
            final Iterator strokesIterator = chartView.getLineStyles().iterator();
            for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                if (strokesIterator.hasNext()) {
                    final LineStyle lineStyle = (LineStyle) strokesIterator.next();
                    renderer.setSeriesStroke(seriesIndex, lineStyle.getStroke());
                }
            }
        }
    }
View Full Code Here

    }

    public void configure(ChartView view, ConfigurableRenderer configurableRenderer) {
        GridChartView chartView = (GridChartView) view;
        boolean outlinesSpecified = chartView.getOutlines() != null && !chartView.getOutlines().isEmpty();
        AbstractRenderer renderer = (AbstractRenderer) configurableRenderer;


        if (chartView.getDefaultOutlineStyle() != null || outlinesSpecified) {
            if (renderer instanceof BarRenderer) {
                ((BarRenderer) renderer).setDrawBarOutline(true);
            } else if (renderer instanceof XYBarRendererAdapter) {
                ((XYBarRendererAdapter) renderer).setDrawBarOutline(true);
            } else if (renderer instanceof LineAndShapeRenderer) {
                ((LineAndShapeRenderer) renderer).setDrawOutlines(true);
                ((LineAndShapeRenderer) renderer).setUseOutlinePaint(true);
            } else if (renderer instanceof XYRendererAdapter) {
                ((XYRendererAdapter) renderer).setDrawOutlines(true);
                ((XYRendererAdapter) renderer).setUseOutlinePaint(true);
            }
        }

        if (chartView.getDefaultOutlineStyle() != null && !outlinesSpecified) {
            renderer.setBaseOutlinePaint(chartView.getDefaultOutlineStyle().getColor());
            renderer.setBaseOutlineStroke(chartView.getDefaultOutlineStyle().getStroke());
            for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                renderer.setSeriesOutlinePaint(seriesIndex, chartView.getDefaultOutlineStyle().getColor());
                renderer.setSeriesOutlineStroke(seriesIndex, chartView.getDefaultOutlineStyle().getStroke());
            }
        } else if (outlinesSpecified) {
            final Iterator outlinesIterator = chartView.getOutlines().iterator();
            for (int seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                if (outlinesIterator.hasNext()) {
                    final LineStyle lineStyle = (LineStyle) outlinesIterator.next();
                    renderer.setSeriesOutlinePaint(seriesIndex, lineStyle.getColor());
                    renderer.setSeriesOutlineStroke(seriesIndex, lineStyle.getStroke());
                }
            }
        }
    }
View Full Code Here

        colors[i] = Color.decode("#" + colorsHex[i]);
      }
    }

    dataset.getColumnCount();
    AbstractRenderer renderer = (AbstractRenderer) plot.getRenderer();
    for (int i = 0; i < dataset.getColumnCount(); i++) {
      renderer.setSeriesPaint(i, colors[i % colors.length]);

    }
  }
View Full Code Here

TOP

Related Classes of org.jfree.chart.renderer.AbstractRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.