I have noted a few issues with the current PaintScaleLegend:
- changes in the ValueAxis of the PaintScaleLegend do no trigger a redraw since the PaintScaleLegend is not registered as an AxisChangeListener for the axis.
- the stripOutlineVisible flag has no effect. A rectangle around the color strip is always drawn.
- Most importantly: for some combinations of position of the PaintScaleLegend, the axisLocation, the padding of the legend, and the subdivisions count, the color strip is frequently interrupted, and the background shines through!
I have changed the source and made a new file LinePaintScaleLegend.
The LinePaintScaleLegend is registered as AxisChangeListener on the ValueAxis and takes the stripOutlineVisible flag into account.
The drawing principle has changed. The drawing is now performed by determining the size of the area of the color strip in java2D space, stepping through the area from the start to the end with an increment of 1 (i.e. pixel by pixel) and drawing a line for each step. The subdivisions are no longer necessary.
The new class has been briefly tested with a couple of combinations of legend position and axis lcoations and has been found to be stable. After further testing, it could replace the original PaintScaleLegend.