[PATCH 3 of 5] Concatenate the subtitle parts and add them to the default subtitle

Wald Commits scm-commit at wald.intevation.org
Fri Mar 7 11:17:16 CET 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1394187179 -3600
# Branch minfo-opt
# Node ID ad4a3980092f09ffd89715734721bbba85382b10
# Parent  7ac103a49e35c5de775363dd077aa35d50eebd74
Concatenate the subtitle parts and add them to the default subtitle.

diff -r 7ac103a49e35 -r ad4a3980092f artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Fri Mar 07 11:11:11 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Fri Mar 07 11:12:59 2014 +0100
@@ -26,16 +26,21 @@
     @Override
     public String getDefaultChartSubtitle() {
         double[] dist = getRange();
-
+        String parts = "";
+        if (subTitleParts != null && !subTitleParts.isEmpty()) {
+             for (String p : subTitleParts) {
+                 parts += ", " + p;
+             }
+        }
         if (dist == null || dist.length != 2 ||
                 Double.isNaN(dist[0]) || Double.isNaN(dist[1])) {
             Object [] args = new Object[] {getRiverName()};
-            return msg(I18N_CHART_SHORT_SUBTITLE, "", args);
+            return msg(I18N_CHART_SHORT_SUBTITLE, "", args) + parts;
         }
 
         if (Math.abs(dist[0] - dist[1]) < 1E-5) {
             Object [] args = new Object[] {getRiverName(), dist[1]};
-            return msg(I18N_CHART_LOCATION_SUBTITLE, "", args);
+            return msg(I18N_CHART_LOCATION_SUBTITLE, "", args) + parts;
         }
 
         return super.getDefaultChartSubtitle();


More information about the Dive4elements-commits mailing list