Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java @ 7682:2f7a01fdb093
Extracted method.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 11 Dec 2013 10:39:11 +0100 |
parents | 8b4b9f00bc45 |
children |
comparison
equal
deleted
inserted
replaced
7681:4e76bfff5fa6 | 7682:2f7a01fdb093 |
---|---|
99 | 99 |
100 if (facet == null) { | 100 if (facet == null) { |
101 return; | 101 return; |
102 } | 102 } |
103 | 103 |
104 setContextBoundsEpoch(bundle); | |
105 | |
106 Processor processor = new KMIndexProcessor(); | |
107 Processor woutp = new WOutProcessor(); | |
108 if (name.equals(BED_DIFFERENCE_EPOCH)) { | |
109 doBedDifferenceEpochOut( | |
110 (BedDiffEpochResult) bundle.getData(context), | |
111 bundle, attr, visible); | |
112 } | |
113 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1)) { | |
114 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
115 bundle, attr, visible, 0); | |
116 } | |
117 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2)) { | |
118 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
119 bundle, attr, visible, 1); | |
120 } | |
121 else if (name.equals(BED_DIFFERENCE_EPOCH_FILTERED)) { | |
122 doBedDifferenceEpochOut( | |
123 (BedDiffEpochResult) bundle.getData(context), | |
124 bundle, attr, visible); | |
125 } | |
126 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1_FILTERED)) { | |
127 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
128 bundle, attr, visible, 0); | |
129 } | |
130 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2_FILTERED)) { | |
131 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
132 bundle, attr, visible, 1); | |
133 } | |
134 else if (processor.canHandle(name)) { | |
135 processor.doOut(this, bundle, attr, visible, YAXIS.dW.idx); | |
136 } | |
137 else if (woutp.canHandle(name)) { | |
138 woutp.doOut(this, bundle, attr, visible, YAXIS.W.idx); | |
139 } | |
140 else if (name.equals(W_DIFFERENCES)) { | |
141 doWDifferencesOut( | |
142 (WKms) bundle.getData(context), | |
143 bundle, | |
144 attr, | |
145 visible); | |
146 } | |
147 else if (name.equals(LONGITUDINAL_ANNOTATION)) { | |
148 doAnnotations( | |
149 (RiverAnnotation) bundle.getData(context), | |
150 bundle, | |
151 attr, | |
152 visible); | |
153 } | |
154 else { | |
155 logger.warn("Unknown facet name " + name); | |
156 } | |
157 } | |
158 | |
159 protected void setContextBoundsEpoch(ArtifactAndFacet bundle) { | |
104 if (getXBounds(0) != null && getDomainAxisRange() != null) { | 160 if (getXBounds(0) != null && getDomainAxisRange() != null) { |
105 Bounds bounds = | 161 Bounds bounds = |
106 calculateZoom(getXBounds(0), getDomainAxisRange()); | 162 calculateZoom(getXBounds(0), getDomainAxisRange()); |
107 context.putContextValue("startkm", bounds.getLower()); | 163 context.putContextValue("startkm", bounds.getLower()); |
108 context.putContextValue("endkm", bounds.getUpper()); | 164 context.putContextValue("endkm", bounds.getUpper()); |
123 Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM()); | 179 Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM()); |
124 Bounds bounds = | 180 Bounds bounds = |
125 calculateZoom(b, getDomainAxisRange()); | 181 calculateZoom(b, getDomainAxisRange()); |
126 context.putContextValue("startkm", bounds.getLower()); | 182 context.putContextValue("startkm", bounds.getLower()); |
127 context.putContextValue("endkm", bounds.getUpper()); | 183 context.putContextValue("endkm", bounds.getUpper()); |
128 } | |
129 Processor processor = new KMIndexProcessor(); | |
130 Processor woutp = new WOutProcessor(); | |
131 if (name.equals(BED_DIFFERENCE_EPOCH)) { | |
132 doBedDifferenceEpochOut( | |
133 (BedDiffEpochResult) bundle.getData(context), | |
134 bundle, attr, visible); | |
135 } | |
136 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1)) { | |
137 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
138 bundle, attr, visible, 0); | |
139 } | |
140 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2)) { | |
141 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
142 bundle, attr, visible, 1); | |
143 } | |
144 else if (name.equals(BED_DIFFERENCE_EPOCH_FILTERED)) { | |
145 doBedDifferenceEpochOut( | |
146 (BedDiffEpochResult) bundle.getData(context), | |
147 bundle, attr, visible); | |
148 } | |
149 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1_FILTERED)) { | |
150 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
151 bundle, attr, visible, 0); | |
152 } | |
153 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2_FILTERED)) { | |
154 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | |
155 bundle, attr, visible, 1); | |
156 } | |
157 else if (processor.canHandle(name)) { | |
158 processor.doOut(this, bundle, attr, visible, YAXIS.dW.idx); | |
159 } | |
160 else if (woutp.canHandle(name)) { | |
161 woutp.doOut(this, bundle, attr, visible, YAXIS.W.idx); | |
162 } | |
163 else if (name.equals(W_DIFFERENCES)) { | |
164 doWDifferencesOut( | |
165 (WKms) bundle.getData(context), | |
166 bundle, | |
167 attr, | |
168 visible); | |
169 } | |
170 else if (name.equals(LONGITUDINAL_ANNOTATION)) { | |
171 doAnnotations( | |
172 (RiverAnnotation) bundle.getData(context), | |
173 bundle, | |
174 attr, | |
175 visible); | |
176 } | |
177 else { | |
178 logger.warn("Unknown facet name " + name); | |
179 } | 184 } |
180 } | 185 } |
181 | 186 |
182 @Override | 187 @Override |
183 protected String getDefaultChartTitle() { | 188 protected String getDefaultChartTitle() { |