diff flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 3809:cc83b8e42dbe

Picked rev3347-rev3351 from trunk. flys-artifacts/tags/pre2.6-2011-12-05@3352 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 05 Dec 2011 09:48:44 +0000
parents 65f9d707caff
children 156304542edf
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Dec 02 11:01:11 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Mon Dec 05 09:48:44 2011 +0000
@@ -13,6 +13,7 @@
 
 import org.w3c.dom.Document;
 
+import de.intevation.artifactdatabase.state.ArtifactAndFacet;
 import de.intevation.artifactdatabase.state.Facet;
 
 import de.intevation.flys.artifacts.FLYSArtifact;
@@ -23,8 +24,6 @@
 
 import de.intevation.flys.jfree.FLYSAnnotation;
 
-import de.intevation.artifactdatabase.state.ArtifactAndFacet;
-
 import de.intevation.flys.utils.FLYSUtils;
 import de.intevation.flys.utils.DataUtil;
 
@@ -38,7 +37,7 @@
 extends      XYChartGenerator
 implements   FacetTypes
 {
-    public static enum YAXIS {
+    public enum YAXIS {
         W(0),
         Q(1),
         D(2);
@@ -84,6 +83,11 @@
     public static final String I18N_YAXIS_LABEL_DEFAULT  = "W [NN + m]";
     public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]";
 
+    public final static String I18N_WDIFF_YAXIS_LABEL =
+        "chart.w_differences.yaxis.label";
+
+    public final static String I18N_WDIFF_YAXIS_LABEL_DEFAULT = "m";
+
     /** Whether or not the plot is inverted (left-right). */
     protected boolean inverted;
 
@@ -154,10 +158,15 @@
     }
 
 
+    @Override
+    protected String getYAxisLabel() {
+        return getWAxisLabel();
+    }
+
     /**
      * Get internationalized label for the y axis.
      */
-    protected String getYAxisLabel() {
+    protected String getWAxisLabel() {
         FLYSArtifact flys = (FLYSArtifact) master;
 
         String unit = FLYSUtils.getRiver(flys).getWstUnit().getName();
@@ -178,14 +187,13 @@
         Font labelFont = new Font("Tahoma", Font.BOLD, 14);
         String label = "default";
         if (index == YAXIS.W.idx) {
-            label = getYAxisLabel();
+            label = getWAxisLabel();
         }
         else if (index == YAXIS.Q.idx) {
-            label = msg(get2YAxisLabelKey(), get2YAxisDefaultLabel());
+            label = msg(getQAxisLabelKey(), getQAxisDefaultLabel());
         }
         else if (index == YAXIS.D.idx) {
-            // TODO: diff label
-            label = "TODO: diff";
+            label = msg(I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT);
         }
         NumberAxis axis = new NumberAxis(label);
         // "Q" Axis shall include 0.
@@ -203,7 +211,7 @@
      * Get default value for the second Y-Axis' label (if no translation was
      * found).
      */
-    protected String get2YAxisDefaultLabel() {
+    protected String getQAxisDefaultLabel() {
         return I18N_2YAXIS_LABEL_DEFAULT;
     }
 
@@ -211,7 +219,7 @@
     /**
      * Get key for internationalization of the second Y-Axis' label.
      */
-    protected String get2YAxisLabelKey() {
+    protected String getQAxisLabelKey() {
         return I18N_2YAXIS_LABEL;
     }
 

http://dive4elements.wald.intevation.org