@@ -120,7 +120,7 @@ class XmlCartoReader implements CartoReader {
120120 } else if (itemType. equalsIgnoreCase(" northArrow" )) {
121121 NorthArrowItem northArrowItem = new NorthArrowItem (getInt(item. x. text()), getInt(item. y. text()), getInt(item. width. text()), getInt(item. height. text()))
122122 if (! item. style. isEmpty()) {
123- northArrowItem. style(NorthArrowStyle . valueOf(item. style. text(). toUpperCase ()))
123+ northArrowItem. style(NorthArrowStyle . valueOf(item. style. text(). trim ()))
124124 }
125125 if (! item. fillColor1. isEmpty()) {
126126 northArrowItem. fillColor1(getColor(item. fillColor1. text()))
@@ -204,12 +204,21 @@ class XmlCartoReader implements CartoReader {
204204 if (! item. fillColor. isEmpty()) {
205205 scaleBarItem. fillColor(getColor(item. fillColor. text()))
206206 }
207+ if (! item. barStrokeColor. isEmpty()) {
208+ scaleBarItem. barStrokeColor(getColor(item. barStrokeColor. text()))
209+ }
207210 if (! item. font. isEmpty()) {
208211 scaleBarItem. font(getFont(item. font))
209212 }
213+ if (! item. textColor. isEmpty()) {
214+ scaleBarItem. textColor(getColor(item. textColor. text()))
215+ }
210216 if (! item. strokeWidth. isEmpty()) {
211217 scaleBarItem. strokeWidth(getFloat(item. strokeWidth. text()))
212218 }
219+ if (! item. barStrokeWidth. isEmpty()) {
220+ scaleBarItem. barStrokeWidth(getFloat(item. barStrokeWidth. text()))
221+ }
213222 if (! item. border. isEmpty()) {
214223 scaleBarItem. border(getInt(item. border. text()))
215224 }
@@ -237,6 +246,15 @@ class XmlCartoReader implements CartoReader {
237246 rowResult. children(). each { row[it. name()] = it. text() }
238247 tableItem. row(row)
239248 }
249+ if (item. columnRowStyle) {
250+ setRowStyle(tableItem. columnRowStyle, item. columnRowStyle)
251+ }
252+ if (item. evenRowStyle) {
253+ setRowStyle(tableItem. evenRowStyle, item. evenRowStyle)
254+ }
255+ if (item. oddRowStyle) {
256+ setRowStyle(tableItem. oddRowStyle, item. oddRowStyle)
257+ }
240258 cartoBuilder. table(tableItem)
241259 } else if (itemType. equalsIgnoreCase(" legend" )) {
242260 LegendItem legendItem = new LegendItem (getInt(item. x. text()), getInt(item. y. text()), getInt(item. width. text()), getInt(item. height. text()))
@@ -318,4 +336,19 @@ class XmlCartoReader implements CartoReader {
318336 VerticalAlign . valueOf(str. toUpperCase())
319337 }
320338
339+ private void setRowStyle (TableItem.RowStyle rowStyle , GPathResult item ) {
340+ if (! item. backgroundColor. isEmpty()) {
341+ rowStyle. backGroundColor = new Color (item. backgroundColor. text()). asColor()
342+ }
343+ if (! item. font. isEmpty()) {
344+ rowStyle. font = getFont(item. font)
345+ }
346+ if (! item. textColor. isEmpty()) {
347+ rowStyle. textColor = new Color (item. textColor. text()). asColor()
348+ }
349+ if (! item. strokeColor. isEmpty()) {
350+ rowStyle. strokeColor = new Color (item. strokeColor. text()). asColor()
351+ }
352+ }
353+
321354}
0 commit comments