comparison artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java @ 7168:81416a62fa57

Saveguard range access in case an artifact has no range
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 26 Sep 2013 12:22:22 +0200
parents ab109ae2acc6
children ad4a3980092f
comparison
equal deleted inserted replaced
7167:2fd238b681a9 7168:81416a62fa57
69 context.putContextValue("startkm", getXBounds(0).getLower()); 69 context.putContextValue("startkm", getXBounds(0).getLower());
70 context.putContextValue("endkm", getXBounds(0).getUpper()); 70 context.putContextValue("endkm", getXBounds(0).getUpper());
71 } 71 }
72 else if (getXBounds(0) == null && getDomainAxisRange() == null) { 72 else if (getXBounds(0) == null && getDomainAxisRange() == null) {
73 RangeAccess access = new RangeAccess(artifact); 73 RangeAccess access = new RangeAccess(artifact);
74 context.putContextValue("startkm", access.getFrom()); 74 if (access.hasFrom() && access.hasTo()) {
75 context.putContextValue("endkm", access.getTo()); 75 context.putContextValue("startkm", access.getFrom());
76 context.putContextValue("endkm", access.getTo());
77 }
76 } 78 }
77 else if (getXBounds(0) == null && getDomainAxisRange() != null){ 79 else if (getXBounds(0) == null && getDomainAxisRange() != null){
78 RangeAccess access = new RangeAccess(artifact); 80 RangeAccess access = new RangeAccess(artifact);
79 Bounds b = new DoubleBounds(access.getFrom(), access.getTo()); 81 if (access.hasFrom() && access.hasTo()) {
80 Bounds bounds = 82 Bounds b = new DoubleBounds(access.getFrom(), access.getTo());
81 calculateZoom(b, getDomainAxisRange()); 83 Bounds bounds =
82 context.putContextValue("startkm", bounds.getLower()); 84 calculateZoom(b, getDomainAxisRange());
83 context.putContextValue("endkm", bounds.getUpper()); 85 context.putContextValue("startkm", bounds.getLower());
86 context.putContextValue("endkm", bounds.getUpper());
87 }
84 } 88 }
85 super.doOut(bundle, theme, visible); 89 super.doOut(bundle, theme, visible);
86 } 90 }
87 } 91 }
88 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 92 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org