Mercurial > dive4elements > river
changeset 3279:5a7b4f890d53
Delta W(t) chart subtitle fixed
flys-artifacts/trunk@4930 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 11 Jul 2012 10:53:38 +0000 |
parents | c27c4e06dd87 |
children | 4a70525c5b0d |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DateRange.java flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties |
diffstat | 8 files changed, 58 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/ChangeLog Wed Jul 11 10:53:38 2012 +0000 @@ -1,3 +1,15 @@ +2012-07-11 Christian Lins <christian.lins@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/DateRange.java, + src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java, + src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java, + src/main/resources/messages.properties, + src/main/resources/messages_de_DE.properties, + src/main/resources/messages_en.properties, + src/main/resources/messages_de.properties: + Delta W(t) chart subtitle now with real values and correct i18n. + + 2012-07-11 Christian Lins <christian.lins@intevation.de> * src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixationArtifactAccess.java Wed Jul 11 10:53:38 2012 +0000 @@ -1,9 +1,7 @@ package de.intevation.flys.artifacts.access; import de.intevation.artifactdatabase.data.StateData; - import de.intevation.flys.artifacts.FLYSArtifact; - import de.intevation.flys.artifacts.model.DateRange; import java.util.Arrays; @@ -206,6 +204,29 @@ return analysisPeriods; } + + /** + * @return DateRange object ranging from eldest to youngest date + * of analysis and reference periods. + */ + public DateRange getDateRange() { + DateRange refP = getReferencePeriod(); + + Date from = refP.getFrom(); + Date to = refP.getTo(); + + DateRange[] rs = getAnalysisPeriods(); + for(DateRange r : rs) { + if(r.getFrom().before(from)) { + from = r.getFrom(); + } + if(r.getTo().after(to)) { + to = r.getTo(); + } + } + + return new DateRange(from, to); + } public Boolean getPreprocessing() { if (preprocessing == null) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DateRange.java Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DateRange.java Wed Jul 11 10:53:38 2012 +0000 @@ -1,12 +1,13 @@ package de.intevation.flys.artifacts.model; +import java.io.Serializable; import java.util.Date; -import java.io.Serializable; - public class DateRange implements Serializable { + private static final long serialVersionUID = -2553914795388094818L; + protected Date from; protected Date to;
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java Wed Jul 11 10:53:38 2012 +0000 @@ -5,16 +5,17 @@ import de.intevation.artifacts.CallContext; import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.flys.artifacts.access.FixationArtifactAccess; import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.fixings.QWD; +import de.intevation.flys.artifacts.resources.Resources; import de.intevation.flys.exports.TimeseriesChartGenerator; import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; import de.intevation.flys.jfree.FLYSAnnotation; import de.intevation.flys.jfree.StyledDomainMarker; import de.intevation.flys.jfree.StyledTimeSeries; import de.intevation.flys.jfree.StyledValueMarker; -import de.intevation.flys.utils.FLYSUtils; import de.intevation.flys.utils.ThemeUtil; import java.io.OutputStream; @@ -76,6 +77,9 @@ idx = c; } } + + + private FLYSArtifact artifact = null; @Override @@ -103,11 +107,15 @@ @Override protected String getDefaultChartSubtitle() { - String[] args = new String[] { - FLYSUtils.getReferenceGaugeName((FLYSArtifact) master) - }; - - return msg(I18N_CHART_SUBTITLE, "", args); + FixationArtifactAccess access = new FixationArtifactAccess(artifact); + DateRange range = access.getDateRange(); + return Resources.format( + context.getMeta(), + I18N_CHART_SUBTITLE, + "", + access.getRiver(), + range.getFrom(), + range.getTo()); } @@ -152,6 +160,8 @@ String name = artifactFacet.getFacetName(); logger.debug("FixDeltaWtGenerator.doOut: " + name); logger.debug("Theme description is: " + artifactFacet.getFacetDescription()); + + this.artifact = (FLYSArtifact)artifactFacet.getArtifact(); if (name.contains(FIX_SECTOR_AVERAGE_DWT)) { doSectorAverageOut(
--- a/flys-artifacts/src/main/resources/messages.properties Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages.properties Wed Jul 11 10:53:38 2012 +0000 @@ -338,7 +338,7 @@ fix.reference.deviation=Reference deviation chart.fix.deltawt.title=Difference from compensating curve -chart.fix.deltawt.subtitle=Water: %1; Period: %2 +chart.fix.deltawt.subtitle=Water: {0}; Period: {1,date,short} to {2,date,short} chart.fix.deltawt.xaxis.label=Date chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
--- a/flys-artifacts/src/main/resources/messages_de.properties Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_de.properties Wed Jul 11 10:53:38 2012 +0000 @@ -339,7 +339,7 @@ fix.reference.deviation=Abweichung im Bezugszeitraum chart.fix.deltawt.title=Abweichungen von der Ausgleichskurve -chart.fix.deltawt.subtitle=Gewässer: %1; Darstellungszeitraum: %2 +chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short} chart.fix.deltawt.xaxis.label=Datum chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_de_DE.properties Wed Jul 11 10:53:38 2012 +0000 @@ -338,7 +338,7 @@ fix.reference.deviation=Abweichung im Bezugszeitraum chart.fix.deltawt.title=Abweichungen von der Ausgleichskurve -chart.fix.deltawt.subtitle=Gewässer: %1; Darstellungszeitraum: %2 +chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short} chart.fix.deltawt.xaxis.label=Datum chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]
--- a/flys-artifacts/src/main/resources/messages_en.properties Wed Jul 11 09:24:07 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_en.properties Wed Jul 11 10:53:38 2012 +0000 @@ -338,7 +338,7 @@ fix.reference.deviation=Reference deviation chart.fix.deltawt.title=Difference from compensating curve -chart.fix.deltawt.subtitle=Water: %1; Period: %1 +chart.fix.deltawt.subtitle=Water: {0}; Period: {1,date,short} to {2,date,short} chart.fix.deltawt.xaxis.label=Date chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm]