changeset 7807:ad4a3980092f minfo-opt

Concatenate the subtitle parts and add them to the default subtitle.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 07 Mar 2014 11:12:59 +0100
parents 7ac103a49e35
children ea6b441b4872
files artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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();

http://dive4elements.wald.intevation.org