diff gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 492:79e80c289018

Added labels and titles to 'Profilschnitt' charts. gnv-artifacts/trunk@569 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 19 Jan 2010 10:06:03 +0000
parents 20dde2b6f1b5
children 4080b57dcb52
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Mon Jan 18 15:49:12 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Tue Jan 19 10:06:03 2010 +0000
@@ -245,15 +245,7 @@
                 Collection measurements = this.getMeasurements(uuid);
                 Collection dates        = this.getDates(uuid);
 
-                ChartLabels chartLables = new ChartLabels(
-                    createChartTitle(locale, uuid),
-                    createChartSubtitle(locale, uuid),
-                    RessourceFactory.getInstance().getRessource(
-                        locale,
-                        domainLable,
-                        domainLable
-                    )
-                );
+                ChartLabels chartLables = createChartLabels(locale, uuid);
 
                 String exportFormat = getExportFormat(mimeType);
 
@@ -766,6 +758,18 @@
         return theme;
     }
 
+    protected ChartLabels createChartLabels(Locale locale, String uuid) {
+        return new ChartLabels(
+            createChartTitle(locale, uuid),
+            createChartSubtitle(locale, uuid),
+            RessourceFactory.getInstance().getRessource(
+                locale,
+                domainLable,
+                domainLable
+            )
+        );
+    }
+
 
     protected String createChartTitle(Locale locale, String uuid) {
         return getFisName(locale);
@@ -795,6 +799,24 @@
     }
 
 
+    protected String getSelectedInputDataName(String uuid, String key) {
+        Collection values = getCollection(key, uuid);
+
+        if (values != null) {
+            Iterator it = values.iterator();
+
+            while (it.hasNext()) {
+                KeyValueDescibeData data = (KeyValueDescibeData) it.next();
+
+                if (data.isSelected()) {
+                    return data.getValue();
+                }
+            }
+        }
+        return null;
+    }
+
+
     protected Collection<KeyValueDescibeData> getParameters(String uuid) {
         return this.getCollection(parameterValuesName, uuid);
     }

http://dive4elements.wald.intevation.org