/** * Sets the stroke used for a series and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param series the series index (zero-based). * @param stroke the stroke ({@code null} permitted). * * @see #getSeriesStroke(int) */ public void setSeriesStroke(int series, Stroke stroke) { setSeriesStroke(series, stroke, true); }
/** * Sets the stroke used for a series and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param series the series index (zero-based). * @param stroke the stroke (<code>null</code> permitted). * * @see #getSeriesStroke(int) */ public void setSeriesStroke(int series, Stroke stroke) { setSeriesStroke(series, stroke, true); }
/** * Returns the stroke used to draw the items in a series. * * @param series the series (zero-based index). * * @return The stroke (never {@code null}). * * @since 1.0.6 */ public Stroke lookupSeriesStroke(int series) { Stroke result = getSeriesStroke(series); if (result == null && this.autoPopulateSeriesStroke) { DrawingSupplier supplier = getDrawingSupplier(); if (supplier != null) { result = supplier.getNextStroke(); setSeriesStroke(series, result, false); } } if (result == null) { result = this.defaultStroke; } return result; }
/** * Returns the stroke used to draw the items in a series. * * @param series the series (zero-based index). * * @return The stroke (never <code>null</code>). * * @since 1.0.6 */ public Stroke lookupSeriesStroke(int series) { // return the override, if there is one... if (this.stroke != null) { return this.stroke; } // otherwise look up the paint table Stroke result = getSeriesStroke(series); if (result == null && this.autoPopulateSeriesStroke) { DrawingSupplier supplier = getDrawingSupplier(); if (supplier != null) { result = supplier.getNextStroke(); setSeriesStroke(series, result, false); } } if (result == null) { result = this.baseStroke; } return result; }
List list = params.getList(ChartParams.RENDERER_SERIES_STROKES); for (int i = 0; i < list.size(); i++) { renderer.setSeriesStroke(i, (Stroke) list.get(i));
private void configureSeries(AbstractRenderer renderer, int seriesIndex) { if (getSeriesPaint() != null) { renderer.setSeriesPaint(seriesIndex, UIChart.findColor(getSeriesPaint())); } if (getSeriesFillPaint() != null) { renderer.setSeriesFillPaint(seriesIndex, UIChart.findColor(getSeriesFillPaint())); } if (getSeriesOutlinePaint() != null) { renderer.setSeriesOutlinePaint(seriesIndex, UIChart.findColor(getSeriesOutlinePaint())); } if (getSeriesOutlineStroke() != null) { renderer.setSeriesOutlineStroke(seriesIndex, UIChart.findStroke(getSeriesOutlineStroke())); } if (getSeriesStroke() != null) { renderer.setSeriesStroke(seriesIndex, UIChart.findStroke(getSeriesStroke())); } if (getSeriesVisible() != null) { renderer.setSeriesVisible(seriesIndex, getSeriesVisible()); } if (getSeriesVisibleInLegend() != null) { renderer.setSeriesVisibleInLegend(seriesIndex, getSeriesVisibleInLegend()); } renderer.setSeriesItemLabelsVisible(seriesIndex, true); }