# HG changeset patch # User Christian Lins # Date 1354748306 -3600 # Node ID 64664e8244ff2260b4c0d89e442e722e4e64e112 # Parent c04db3178d0919148f8ea81f9f540afa7c222408# Parent 1fea4243721ce1c202494502cd18006b9775357e Merged diff -r c04db3178d09 -r 64664e8244ff flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/GaugeAccess.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/GaugeAccess.java Wed Dec 05 23:58:26 2012 +0100 @@ -0,0 +1,30 @@ +package de.intevation.flys.artifacts.access; + +import java.util.Arrays; + +import org.apache.log4j.Logger; + +import de.intevation.artifacts.CallContext; +import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.flys.utils.FLYSUtils; +import de.intevation.flys.utils.StringUtil; + +/** For the moment, light-weight wrapper around FLYSUtils. */ +// TODO employ 'Caching' like other Accesses, remove usage of FLYSUtils. +public class GaugeAccess +extends RangeAccess +{ + private static Logger logger = Logger.getLogger(GaugeAccess.class); + + public GaugeAccess(FLYSArtifact artifact, CallContext context) { + super(artifact, context); + } + + + public String getGaugeName() { + return FLYSUtils.getGaugename(this.getArtifact()); + } + + // TODO there is also getGauges in FLYSUtils... +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c04db3178d09 -r 64664e8244ff flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/RangeAccess.java Wed Dec 05 23:58:26 2012 +0100 @@ -0,0 +1,50 @@ +package de.intevation.flys.artifacts.access; + +import java.util.Arrays; + +import org.apache.log4j.Logger; + +import de.intevation.artifacts.CallContext; +import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.flys.utils.FLYSUtils; +import de.intevation.flys.utils.StringUtil; + +/** For the moment, light-weight wrapper around FLYSUtils. */ +// TODO employ 'Caching' like other Accesses, remove usage of FLYSUtils. +public class RangeAccess +extends RiverAccess +{ + private static Logger logger = Logger.getLogger(RangeAccess.class); + + private CallContext context; + + + public RangeAccess(FLYSArtifact artifact, CallContext context) { + super(artifact); + this.context = context; + } + + + /** + * Get min and max kilometer, independent of parametization + * (ld_from/to vs ld_locations). + */ + public double[] getKmRange() { + return FLYSUtils.getKmRange(this.getArtifact()); + } + + + public double[] getKmFromTo() { + return FLYSUtils.getKmFromTo(this.getArtifact()); + } + + + /** + * Return sorted array of locations at which stuff was calculated + * (from ld_locations data), null if not parameterized this way. + */ + public double[] getLocations() { + return FLYSUtils.getLocations(this.getArtifact()); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c04db3178d09 -r 64664e8244ff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java Wed Dec 05 23:54:09 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java Wed Dec 05 23:58:26 2012 +0100 @@ -130,6 +130,7 @@ FV("flow_velocity"), SQA("sq_relation_a"), SQB("sq_relation_b"), + W_D("w_differences"), SQC("sq_relation_c"), SQD("sq_relation_d"), SQE("sq_relation_e"), diff -r c04db3178d09 -r 64664e8244ff flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledAreaSeriesCollection.java --- a/flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledAreaSeriesCollection.java Wed Dec 05 23:54:09 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/StyledAreaSeriesCollection.java Wed Dec 05 23:58:26 2012 +0100 @@ -87,7 +87,7 @@ ThemeUtil.getBackgroundColorString(theme)); int transparency = ThemeUtil.parseTransparency(theme); - if (transparency > 0) { + if (transparency > 0 && paint != null) { paint = new Color( paint.getRed(), paint.getGreen(),