changeset 9593:8f4e300b5f79

Punkt 7.1 Vegetationszonen Stripes + Legende ändern
author gernotbelger
date Fri, 11 Jan 2019 17:44:25 +0100
parents e8d8f90308dc
children 225e48df608c
files artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCrossSectionProcessor.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCrossSectionProcessor.java	Fri Jan 11 16:58:44 2019 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCrossSectionProcessor.java	Fri Jan 11 17:44:25 2019 +0100
@@ -85,13 +85,17 @@
 
         final StripedAreaDataset dataset = new StripedAreaDataset(bundle.getFacetName(), theme);
 
-        for (final VegetationZoneServerClientXChange zone : zones) {
+        for (int i = 0; i < zones.size(); i++) {
+            final VegetationZoneServerClientXChange zone = zones.get(i);
+            Integer lowerFromTo = zone.getLowerFromTo();
+            if (i == 0) // Hack; turning "-1" invisible
+                lowerFromTo = 0;
 
-            final double lower = uefdToHeight(river, currentStation, zone.getLowerFromTo());
+            final double lower = uefdToHeight(river, currentStation, lowerFromTo);
             final double upper = uefdToHeight(river, currentStation, zone.getUpperFromTo());
 
             final Color color = Color.decode(zone.getHexColor());
-            final String label = String.format("%s (%dd-%dd)", zone.getZoneName(), zone.getLowerFromTo(), zone.getUpperFromTo());
+            final String label = String.format("%s (%dd-%dd)", zone.getZoneName(), lowerFromTo, zone.getUpperFromTo());
             dataset.addStripe(new Stripe(label, color, lower, upper));
         }
 

http://dive4elements.wald.intevation.org