------------------------------------------------------------
revno: 5377
committer: Lars Helge Overland <larshe...@gmail.com>
branch nick: dhis2
timestamp: Mon 2011-12-12 22:39:45 +0100
message:
  Map generation: fixed bug with legend colors
modified:
  
dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java	2011-12-12 21:17:15 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java	2011-12-12 21:39:45 +0000
@@ -7,6 +7,7 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.hisp.dhis.aggregation.AggregatedMapValue;
 import org.hisp.dhis.mapgeneration.IntervalSet.DistributionStrategy;
 import org.hisp.dhis.mapping.MapView;
@@ -128,9 +129,9 @@
 
         // Get the low and high colors, typically in hexadecimal form, e.g.
         // '#ff3200' is an orange color
-        Color colorLow = Utilities.createColorFromString( mapView.getColorLow() != null ? mapView.getColorLow()
+        Color colorLow = Utilities.createColorFromString( StringUtils.trimToNull( mapView.getColorLow() ) != null ? mapView.getColorLow()
             : DEFAULT_COLOR_LOW );
-        Color colorHigh = Utilities.createColorFromString( mapView.getColorHigh() != null ? mapView.getColorHigh()
+        Color colorHigh = Utilities.createColorFromString( StringUtils.trimToNull( mapView.getColorHigh() ) != null ? mapView.getColorHigh()
             : DEFAULT_COLOR_HIGH );
 
         // TODO MapView should be extended to feature opacity

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to