[PATCH] issue738: Adjust S/Q-Relation Diagram subtitles

Wald Commits scm-commit at wald.intevation.org
Mon Aug 19 16:32:11 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1376923024 -7200
# Node ID 68fd84c474b7c7fdd45a112011687a600fc6fe59
# Parent  08e3c22500f32c6a0785fdd1ee1c47b7a71054e3
issue738: Adjust S/Q-Relation Diagram subtitles.

diff -r 08e3c22500f3 -r 68fd84c474b7 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java	Mon Aug 19 16:29:28 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java	Mon Aug 19 16:37:04 2013 +0200
@@ -11,6 +11,10 @@
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
 import org.dive4elements.artifactdatabase.state.Facet;
 
+import org.dive4elements.river.artifacts.D4EArtifact;
+
+import org.dive4elements.river.artifacts.access.SQRelationAccess;
+
 import org.dive4elements.river.artifacts.model.FacetTypes;
 
 import org.dive4elements.river.artifacts.model.sq.SQ;
@@ -54,6 +58,11 @@
     public static final String I18N_YAXIS_LABEL =
         "chart.sq_relation.yaxis.label";
 
+    public static final String I18N_SUBTITLE =
+        "chart.computed.discharge.curve.subtitle";
+
+    /** Needed to access data to create subtitle. */
+    protected D4EArtifact artifact;
 
     /** The logger that is used in this generator. */
     private static Logger logger = Logger.getLogger(SQRelationGenerator.class);
@@ -75,6 +84,23 @@
         };
     }
 
+    /**
+     * Returns the default subtitle for this chart.
+     *
+     * @return the default subtitle for this chart.
+     */
+    @Override
+    protected String getDefaultChartSubtitle() {
+        SQRelationAccess sqAccess = new SQRelationAccess(artifact);
+        Object[] args = null;
+        args = new Object[] {
+            sqAccess.getRiver(),
+            sqAccess.getLocation()
+        };
+        return msg(I18N_SUBTITLE, "", args);
+    }
+
+
 
     @Override
     public String getDefaultChartTitle() {
@@ -114,6 +140,8 @@
     ) {
         logger.debug("doOut");
 
+        this.artifact = (D4EArtifact) artifactAndFacet.getArtifact();
+
         Facet  facet = artifactAndFacet.getFacet();
         String name  = facet != null ? facet.getName() : null;
 


More information about the Dive4elements-commits mailing list