Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.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 |
---|---|
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.model.FacetTypes; | 9 import de.intevation.flys.artifacts.model.FacetTypes; |
10 import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult; | 10 import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult; |
11 import de.intevation.flys.artifacts.model.minfo.BedDifferencesResult; | |
11 import de.intevation.flys.exports.StyledSeriesBuilder; | 12 import de.intevation.flys.exports.StyledSeriesBuilder; |
12 import de.intevation.flys.exports.fixings.FixChartGenerator; | 13 import de.intevation.flys.exports.fixings.FixChartGenerator; |
13 import de.intevation.flys.exports.process.KMIndexProcessor; | 14 import de.intevation.flys.exports.process.KMIndexProcessor; |
14 import de.intevation.flys.exports.process.Processor; | 15 import de.intevation.flys.exports.process.Processor; |
16 import de.intevation.flys.jfree.Bounds; | |
17 import de.intevation.flys.jfree.DoubleBounds; | |
15 import de.intevation.flys.jfree.FLYSAnnotation; | 18 import de.intevation.flys.jfree.FLYSAnnotation; |
16 import de.intevation.flys.jfree.StyledXYSeries; | 19 import de.intevation.flys.jfree.StyledXYSeries; |
17 | 20 |
18 | 21 |
19 public class BedDiffHeightYearGenerator | 22 public class BedDiffHeightYearGenerator |
77 | 80 |
78 if (facet == null) { | 81 if (facet == null) { |
79 return; | 82 return; |
80 } | 83 } |
81 | 84 |
85 if (getXBounds(0) != null && getDomainAxisRange() != null) { | |
86 Bounds bounds = | |
87 calculateZoom(getXBounds(0), getDomainAxisRange()); | |
88 context.putContextValue("startkm", bounds.getLower()); | |
89 context.putContextValue("endkm", bounds.getUpper()); | |
90 } | |
91 else if (getXBounds(0) != null && getDomainAxisRange() == null) { | |
92 context.putContextValue("startkm", getXBounds(0).getLower()); | |
93 context.putContextValue("endkm", getXBounds(0).getUpper()); | |
94 } | |
95 else if (getXBounds(0) == null && getDomainAxisRange() == null) { | |
96 BedDifferencesResult data = (BedDifferencesResult)bundle.getData(context); | |
97 context.putContextValue("startkm", data.getKms().min()); | |
98 context.putContextValue("endkm", data.getKms().max()); | |
99 } | |
100 else if (getXBounds(0) == null && getDomainAxisRange() != null){ | |
101 BedDifferencesResult data = (BedDifferencesResult)bundle.getData(context); | |
102 Bounds b = new DoubleBounds(data.getKms().min(), data.getKms().max()); | |
103 Bounds bounds = | |
104 calculateZoom(b, getDomainAxisRange()); | |
105 context.putContextValue("startkm", bounds.getLower()); | |
106 context.putContextValue("endkm", bounds.getUpper()); | |
107 } | |
82 Processor processor = new KMIndexProcessor(); | 108 Processor processor = new KMIndexProcessor(); |
83 if (name.equals(BED_DIFFERENCE_HEIGHT_YEAR)) { | 109 if (name.equals(BED_DIFFERENCE_HEIGHT_YEAR)) { |
84 doBedDifferenceYearOut( | 110 doBedDifferenceYearOut( |
85 (BedDiffYearResult) bundle.getData(context), | 111 (BedDiffYearResult) bundle.getData(context), |
86 bundle, attr, visible); | 112 bundle, attr, visible); |