Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceEpochGenerator.java @ 4638:6122ee2ab67f
Put start and end km into the context for average calculation.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 04 Dec 2012 15:39:50 +0100 |
parents | 05a54b4d579d |
children | 32f90baf4afa |
comparison
equal
deleted
inserted
replaced
4637:3ab9ec5ca02f | 4638:6122ee2ab67f |
---|---|
4 import org.jfree.data.xy.XYSeries; | 4 import org.jfree.data.xy.XYSeries; |
5 import org.w3c.dom.Document; | 5 import org.w3c.dom.Document; |
6 | 6 |
7 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 7 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
8 import de.intevation.artifactdatabase.state.Facet; | 8 import de.intevation.artifactdatabase.state.Facet; |
9 import de.intevation.flys.artifacts.FLYSArtifact; | |
10 import de.intevation.flys.artifacts.access.FlowVelocityAccess; | |
9 import de.intevation.flys.artifacts.model.FacetTypes; | 11 import de.intevation.flys.artifacts.model.FacetTypes; |
10 import de.intevation.flys.artifacts.model.minfo.BedDiffEpochResult; | 12 import de.intevation.flys.artifacts.model.minfo.BedDiffEpochResult; |
11 import de.intevation.flys.exports.StyledSeriesBuilder; | 13 import de.intevation.flys.exports.StyledSeriesBuilder; |
12 import de.intevation.flys.exports.fixings.FixChartGenerator; | 14 import de.intevation.flys.exports.fixings.FixChartGenerator; |
13 import de.intevation.flys.exports.process.KMIndexProcessor; | 15 import de.intevation.flys.exports.process.KMIndexProcessor; |
14 import de.intevation.flys.exports.process.Processor; | 16 import de.intevation.flys.exports.process.Processor; |
17 import de.intevation.flys.jfree.Bounds; | |
18 import de.intevation.flys.jfree.DoubleBounds; | |
15 import de.intevation.flys.jfree.FLYSAnnotation; | 19 import de.intevation.flys.jfree.FLYSAnnotation; |
16 import de.intevation.flys.jfree.StyledXYSeries; | 20 import de.intevation.flys.jfree.StyledXYSeries; |
17 | 21 |
18 | 22 |
19 public class BedDifferenceEpochGenerator | 23 public class BedDifferenceEpochGenerator |
80 | 84 |
81 if (facet == null) { | 85 if (facet == null) { |
82 return; | 86 return; |
83 } | 87 } |
84 | 88 |
89 if (getXBounds(0) != null && getDomainAxisRange() != null) { | |
90 Bounds bounds = | |
91 calculateZoom(getXBounds(0), getDomainAxisRange()); | |
92 context.putContextValue("startkm", bounds.getLower()); | |
93 context.putContextValue("endkm", bounds.getUpper()); | |
94 } | |
95 else if (getXBounds(0) != null && getDomainAxisRange() == null) { | |
96 context.putContextValue("startkm", getXBounds(0).getLower()); | |
97 context.putContextValue("endkm", getXBounds(0).getUpper()); | |
98 } | |
99 else if (getXBounds(0) == null && getDomainAxisRange() == null) { | |
100 FLYSArtifact artifact = (FLYSArtifact)bundle.getArtifact(); | |
101 FlowVelocityAccess access = new FlowVelocityAccess(artifact); | |
102 context.putContextValue("startkm", access.getLowerKM()); | |
103 context.putContextValue("endkm", access.getUpperKM()); | |
104 } | |
105 else if (getXBounds(0) == null && getDomainAxisRange() != null){ | |
106 FLYSArtifact artifact = (FLYSArtifact)bundle.getArtifact(); | |
107 FlowVelocityAccess access = new FlowVelocityAccess(artifact); | |
108 Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM()); | |
109 Bounds bounds = | |
110 calculateZoom(b, getDomainAxisRange()); | |
111 context.putContextValue("startkm", bounds.getLower()); | |
112 context.putContextValue("endkm", bounds.getUpper()); | |
113 } | |
85 Processor processor = new KMIndexProcessor(); | 114 Processor processor = new KMIndexProcessor(); |
86 if (name.equals(BED_DIFFERENCE_EPOCH)) { | 115 if (name.equals(BED_DIFFERENCE_EPOCH)) { |
87 doBedDifferenceEpochOut( | 116 doBedDifferenceEpochOut( |
88 (BedDiffEpochResult) bundle.getData(context), | 117 (BedDiffEpochResult) bundle.getData(context), |
89 bundle, attr, visible); | 118 bundle, attr, visible); |