Coloring grid lines with GridLineCellLayerPainter [message #1798338] |
Thu, 15 November 2018 16:05 |
Frederik Wystup Messages: 1 Registered: November 2018 |
Junior Member |
|
|
Hi,
we're having the requirement to change the color of the grid lines based on specific cell positions.
Currently we think about sub-classing the GridLineCellLayerPainter in order to provide a alternative implementation for GridLineCellLayerPainter.drawGridLines. This would work, but we would need to copy most of the code of the private methods drawHorizontalLines and drawVerticalLines.
Of course this is not a good idea, so we tought about providing a possible patch to enhance the GridLineCellLayerPainter:
private void drawVerticalLines(ILayer natLayer, GC gc, Rectangle rectangle, int adjustment) {
[...]
if (gridColorEvaluator != null) {
graphics.setForeground(gridColorEvaluator.getColorForLabel(cellLabel));
[code][/code]}
graphics.drawLine(xCoord, rectangle.y, xCoord, endY);
graphics.setForeground(getGridColor());
[...]
(Same for: drawHorizontalLines)
Basically the idea is that the color of the grid line is based on specific labels which are set elsewhere. The mapping label to color is done by a GridColorEvalutor which could be set if required.
Could this patch be the way to go or is there another solution to solve this problem? We actually did not find a solution by searching the forum, maybe we missed something here...
|
|
|
|
Powered by
FUDForum. Page generated in 0.02887 seconds