@@ -348,9 +348,12 @@ class Java2DCartoBuilder implements CartoBuilder {
348348 int height = scaleBarItem. height
349349 int border = 5
350350 Font font = scaleBarItem. font
351+ Color fontColor = scaleBarItem. textColor
351352 Color strokeColor = scaleBarItem. strokeColor
352353 Color fillColor = scaleBarItem. fillColor
353354 int strokeWidth = scaleBarItem. strokeWidth
355+ Color barStrokeColor = scaleBarItem. barStrokeColor
356+ float barStrokeWidth = scaleBarItem. barStrokeWidth
354357 int ticHeight = 10
355358
356359 ScaleBarItem.ScaleBarInfo scaleBarInfo = scaleBarItem. calculateScaleBarInfo()
@@ -366,6 +369,7 @@ class Java2DCartoBuilder implements CartoBuilder {
366369 int lineXEnd = (int )(lineXStart + scaleBarInfo. widthInPixels)
367370 int lineY = y + height - border
368371
372+ // Outline
369373 if (fillColor) {
370374 graphics. color = fillColor
371375 graphics. fillRect(lineXStart - border, y, lineXEnd - lineXStart + border * 2 , height)
@@ -374,9 +378,13 @@ class Java2DCartoBuilder implements CartoBuilder {
374378 graphics. stroke = new BasicStroke (strokeWidth)
375379 graphics. drawRect(lineXStart - border, y, lineXEnd - lineXStart + border * 2 , height)
376380
381+ // Scale bar
382+ graphics. color = barStrokeColor
383+ graphics. stroke = new BasicStroke (barStrokeWidth)
377384 graphics. drawLine(lineXStart, lineY, lineXEnd, lineY)
378385 graphics. drawLine(lineXStart, y + height - border, lineXStart, y + height - border - ticHeight)
379386 graphics. drawLine(lineXEnd, y + height - border, lineXEnd, y + height - border - ticHeight)
387+ graphics. color = fontColor
380388 graphics. font = font
381389 String scaleText = " ${ (int) scaleBarInfo.widthInUnits} ${ scaleBarInfo.unitForScaleText} "
382390 drawString(scaleText, new Rectangle (
0 commit comments