Commander Salamander wrote:I have a XYLineAndShapeRenderer that needs to paint all series black. This works fine with the deprecated setPaint method, but when I use setBasePaint it does not work (each XYSeries is a different color).
XYLineAndShapeRenderer uses the return value of getItemPaint(series,item) when drawing the items.
This method is defined in AbstractRenderer and returns lookupSeriesPaint(series) which will return the variable "paint". If "paint" is null, it will check getSeriesPaint(series) for a non-null value. If that also fails and if autoPopulateSeriesPaint is true, the paint will be requested from the DrawingSupplier. If for some reason that still gives a null paint, then basePaint will be returned which is intialized as DEFAULT_PAINT or Color.blue.
IMHO the first check in AbstractRenderer.getItemPaint(series,item) should be whether the basePaint should be used and if so, return it. A simple patch (introducing a private useBasePaint flag with public setters and getters and modification of getItemPaint(series,item)) should do it.