[PATCH] Punkt 7.1 Vegetationszonen Stripes + Legende ändern

Wald Commits scm-commit at wald.intevation.org
Fri Jan 11 17:44:30 CET 2019


# HG changeset patch
# User gernotbelger
# Date 1547225065 -3600
# Node ID 8f4e300b5f798ac2e389c6955c58a3f9e9cff42f
# Parent  e8d8f90308dcce5e338885c9061fca7099217016
Punkt 7.1 Vegetationszonen Stripes + Legende ändern

diff -r e8d8f90308dc -r 8f4e300b5f79 artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCrossSectionProcessor.java
--- 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));
         }
 


More information about the Dive4Elements-commits mailing list