comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCurveGenerator.java @ 9556:9b8e8fc1f408

Use facetName in all processors as themeType for legend aggregation.
author gernotbelger
date Tue, 23 Oct 2018 16:26:58 +0200
parents 929d645691ae
children 9b39cfd39e59
comparison
equal deleted inserted replaced
9555:ef5754ba5573 9556:9b8e8fc1f408
161 return; 161 return;
162 } 162 }
163 163
164 final CallContext context = getContext(); 164 final CallContext context = getContext();
165 165
166 // TODO: mainvalues.q
167 // TODO: mainvalues.w
168 // } else if (name.equals(MAINVALUES_Q) || name.equals(MAINVALUES_W)) {
169 // doAnnotations((RiverAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible);
170
166 if (name.equals(DURATION_W)) { 171 if (name.equals(DURATION_W)) {
167 doWOut((WQDay) (artifactFacet.getData(context)), artifactFacet, attr, visible); 172 doWOut((WQDay) (artifactFacet.getData(context)), artifactFacet, attr, visible);
168 } else if (name.equals(DURATION_Q)) { 173 } else if (name.equals(DURATION_Q)) {
169 doQOut((WQDay) artifactFacet.getData(context), artifactFacet, attr, visible); 174 doQOut((WQDay) artifactFacet.getData(context), artifactFacet, attr, visible);
170 } else if (name.equals(FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_Q) 175 } else if (name.equals(FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_Q)
171 || name.equals(FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_W)) { 176 || name.equals(FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_W)) {
172 doAnnotations((RiverAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible); 177 doAnnotations((RiverAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible);
173 } 178 } else if (FloodDurationCurveProcessor.isInfrastructureFacet(name) && (artifactFacet.getData(context) != null)) {
174 else if (FloodDurationCurveProcessor.isInfrastructureFacet(name) && (artifactFacet.getData(context) != null)) { 179 doAnnotations((RiverAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible);
180 } else if (name.equals(MAINVALUES_Q) || name.equals(MAINVALUES_W)) {
175 doAnnotations((RiverAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible); 181 doAnnotations((RiverAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible);
176 } 182 }
177 // else if (name.equals(RELATIVE_POINT)) { 183 // else if (name.equals(RELATIVE_POINT)) {
178 // doPointOut((Point2D) artifactFacet.getData(context), artifactFacet, attr, visible); 184 // doPointOut((Point2D) artifactFacet.getData(context), artifactFacet, attr, visible);
179 // } 185 // }
193 * @param theme 199 * @param theme
194 */ 200 */
195 protected void doWOut(final WQDay wqdays, final ArtifactAndFacet aaf, final ThemeDocument theme, final boolean visible) { 201 protected void doWOut(final WQDay wqdays, final ArtifactAndFacet aaf, final ThemeDocument theme, final boolean visible) {
196 202
197 // log.debug("DurationCurveGenerator.doWOut"); 203 // log.debug("DurationCurveGenerator.doWOut");
198 final XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 204 final XYSeries series = new StyledXYSeries(aaf.getFacetName(), aaf.getFacetDescription(), theme);
199 final int size = wqdays.size(); 205 final int size = wqdays.size();
200 for (int i = 0; i < size; i++) { 206 for (int i = 0; i < size; i++) {
201 final int day = wqdays.getDay(i); 207 final int day = wqdays.getDay(i);
202 final double w = wqdays.getW(i); 208 final double w = wqdays.getW(i);
203 series.add(day, w); 209 series.add(day, w);
206 } 212 }
207 213
208 protected void doPointOut(final Point2D point, final ArtifactAndFacet aandf, final ThemeDocument theme, final boolean visible) { 214 protected void doPointOut(final Point2D point, final ArtifactAndFacet aandf, final ThemeDocument theme, final boolean visible) {
209 215
210 // log.debug("DurationCurveGenerator.doPointOut"); 216 // log.debug("DurationCurveGenerator.doPointOut");
211 final XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); 217 final XYSeries series = new StyledXYSeries(aandf.getFacetName(), aandf.getFacetDescription(), theme);
212 series.add(point.getX(), point.getY()); 218 series.add(point.getX(), point.getY());
213 addAxisSeries(series, YAXIS.W.idx, visible); 219 addAxisSeries(series, YAXIS.W.idx, visible);
214 } 220 }
215 221
216 /** 222 /**
221 * @param theme 227 * @param theme
222 */ 228 */
223 protected void doQOut(final WQDay wqdays, final ArtifactAndFacet aaf, final ThemeDocument theme, final boolean visible) { 229 protected void doQOut(final WQDay wqdays, final ArtifactAndFacet aaf, final ThemeDocument theme, final boolean visible) {
224 230
225 // log.debug("DurationCurveGenerator.doQOut"); 231 // log.debug("DurationCurveGenerator.doQOut");
226 final XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 232 final XYSeries series = new StyledXYSeries(aaf.getFacetName(), aaf.getFacetDescription(), theme);
227 final int size = wqdays.size(); 233 final int size = wqdays.size();
228 for (int i = 0; i < size; i++) { 234 for (int i = 0; i < size; i++) {
229 final int day = wqdays.getDay(i); 235 final int day = wqdays.getDay(i);
230 final double q = wqdays.getQ(i); 236 final double q = wqdays.getQ(i);
231 series.add(day, q); 237 series.add(day, q);

http://dive4elements.wald.intevation.org