Mercurial > dive4elements > river
changeset 6869:68fd84c474b7
issue738: Adjust S/Q-Relation Diagram subtitles.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 19 Aug 2013 16:37:04 +0200 (2013-08-19) |
parents | 08e3c22500f3 |
children | 956377f39878 |
files | artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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;