dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25558
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12711: PNG maps, fixed but with relative periods
------------------------------------------------------------
revno: 12711
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-16 11:44:07 +0200
message:
PNG maps, fixed but with relative periods
modified:
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/InternalMapLayer.java
dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/Legend.java
dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendItem.java
dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendSet.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 2013-10-16 09:21:05 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java 2013-10-16 09:44:07 +0000
@@ -141,7 +141,10 @@
else
{
// Build the legend set, then render it to an image
- LegendSet legendSet = new LegendSet( internalMap.getLayers().get( 0 ) ); //TODO
+ InternalMapLayer mapLayer = internalMap.getLayers().get( 0 ); //TODO improve
+
+ LegendSet legendSet = new LegendSet( mapLayer ); //TODO
+
BufferedImage legendImage = legendSet.render();
// Combine the legend image and the map image into one image
@@ -200,8 +203,17 @@
String name = mapView.getName();
- Period period = !mapView.getPeriods().isEmpty() ? mapView.getPeriods().get( 0 ) : null;
-
+ Period period = null;
+
+ if ( !mapView.getPeriods().isEmpty() ) // TODO integrate with BaseAnalyticalObject
+ {
+ period = mapView.getPeriods().get( 0 );
+ }
+ else if ( mapView.getRelatives() != null )
+ {
+ period = mapView.getRelatives().getRelativePeriods( date, null, false ).get( 0 );
+ }
+
Integer radiusLow = mapView.getRadiusLow() != null ? mapView.getRadiusLow() : DEFAULT_RADIUS_LOW;
Integer radiusHigh = mapView.getRadiusHigh() != null ? mapView.getRadiusHigh() : DEFAULT_RADIUS_HIGH;
=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMapLayer.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMapLayer.java 2013-10-10 17:32:50 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMapLayer.java 2013-10-16 09:44:07 +0000
@@ -96,6 +96,13 @@
// Logic
// -------------------------------------------------------------------------
+ @Override
+ public String toString()
+ {
+ return "[Name: " + name + ", period: " + period + ", radius high: " + radiusHigh + ", radius low: " + radiusLow +
+ ", color high: " + colorHigh + ", color low: " + colorLow + ", classes: " + classes + "]";
+ }
+
/**
* Interpolates the radii of this map layer's set of map objects according
* the highest and lowest values among them.
=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/Legend.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/Legend.java 2013-10-06 22:11:27 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/Legend.java 2013-10-16 09:44:07 +0000
@@ -103,4 +103,10 @@
{
legendItems.add( legendItem );
}
+
+ @Override
+ public String toString()
+ {
+ return legendItems != null ? legendItems.toString() : "[No legend items]";
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendItem.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendItem.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendItem.java 2013-10-16 09:44:07 +0000
@@ -86,4 +86,10 @@
{
this.interval = interval;
}
+
+ @Override
+ public String toString()
+ {
+ return interval != null ? interval.toString() : "[No interval]";
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendSet.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendSet.java 2013-10-06 22:11:27 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/LegendSet.java 2013-10-16 09:44:07 +0000
@@ -154,4 +154,10 @@
return imageHeight;
}
+
+ @Override
+ public String toString()
+ {
+ return legends != null ? legends.toString() : "[No legends]";
+ }
}