comparison artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java @ 8722:a83d519155ab

(issue1754) Do not base smoothing radius on calculation range Using the calculation parameters for startkm and endkm in the case that the domain axis had the default extend caused weird behavior when zooming and led to too large radius values for most data that only had valid values on a subset of the caluclation range.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 28 Apr 2015 14:22:47 +0200
parents cfb3a4d0c637
children 686d8876edf9
comparison
equal deleted inserted replaced
8721:1083cb887ffb 8722:a83d519155ab
78 else if (getXBounds(0) != null && getDomainAxisRange() == null) { 78 else if (getXBounds(0) != null && getDomainAxisRange() == null) {
79 context.putContextValue("startkm", getXBounds(0).getLower()); 79 context.putContextValue("startkm", getXBounds(0).getLower());
80 context.putContextValue("endkm", getXBounds(0).getUpper()); 80 context.putContextValue("endkm", getXBounds(0).getUpper());
81 context.putContextValue("bounds_defined", true); 81 context.putContextValue("bounds_defined", true);
82 } 82 }
83 else if (getXBounds(0) == null && getDomainAxisRange() == null) {
84 RangeAccess access = new RangeAccess(artifact);
85 if (access.hasFrom() && access.hasTo()) {
86 context.putContextValue("startkm", access.getFrom());
87 context.putContextValue("endkm", access.getTo());
88 context.putContextValue("bounds_defined", true);
89 }
90 }
91 else if (getXBounds(0) == null && getDomainAxisRange() != null){ 83 else if (getXBounds(0) == null && getDomainAxisRange() != null){
92 RangeAccess access = new RangeAccess(artifact); 84 RangeAccess access = new RangeAccess(artifact);
93 if (access.hasFrom() && access.hasTo()) { 85 if (access.hasFrom() && access.hasTo()) {
94 Bounds b = new DoubleBounds(access.getFrom(), access.getTo()); 86 Bounds b = new DoubleBounds(access.getFrom(), access.getTo());
95 Bounds bounds = 87 Bounds bounds =
97 context.putContextValue("startkm", bounds.getLower()); 89 context.putContextValue("startkm", bounds.getLower());
98 context.putContextValue("endkm", bounds.getUpper()); 90 context.putContextValue("endkm", bounds.getUpper());
99 context.putContextValue("bounds_defined", true); 91 context.putContextValue("bounds_defined", true);
100 } 92 }
101 } 93 }
94 /*
95 else if (getXBounds(0) == null && getDomainAxisRange() == null) {
96 .. In this case the automatic zoom of the diagram will provide
97 decent values for the zooom calculation.
98 }
99 */
102 super.doOut(bundle, theme, visible); 100 super.doOut(bundle, theme, visible);
103 } 101 }
104 } 102 }
105 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 103 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org