comparison artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents c0c162d7cb0e
children e5f688820951 0a5239a1e46e
comparison
equal deleted inserted replaced
8855:d7c005e12af0 8856:5e38e2924c07
117 /** The CallContext object.*/ 117 /** The CallContext object.*/
118 protected CallContext context; 118 protected CallContext context;
119 119
120 protected D4EArtifactCollection collection; 120 protected D4EArtifactCollection collection;
121 121
122 /** The artifact that is used to decorate the chart with meta information.*/ 122 /** Artifact that is used to decorate the chart with meta information.*/
123 protected Artifact master; 123 protected Artifact master;
124 124
125 /** The settings that should be used during output creation.*/ 125 /** The settings that should be used during output creation.*/
126 protected Settings settings; 126 protected Settings settings;
127 127
130 130
131 /** Map of annotations to add at specific Y-axis. */ 131 /** Map of annotations to add at specific Y-axis. */
132 protected SortedMap<Integer, RiverAnnotation> yAnnotations; 132 protected SortedMap<Integer, RiverAnnotation> yAnnotations;
133 133
134 /** List of annotations to insert in plot. */ 134 /** List of annotations to insert in plot. */
135 protected List<RiverAnnotation> annotations = new ArrayList<RiverAnnotation>(); 135 protected List<RiverAnnotation> annotations =
136 new ArrayList<RiverAnnotation>();
136 137
137 protected abstract List<AxisSection> buildYAxisSections(); 138 protected abstract List<AxisSection> buildYAxisSections();
138 139
139 protected String outName; 140 protected String outName;
140 141
377 } 378 }
378 } 379 }
379 380
380 381
381 @Override 382 @Override
382 public void init(String outName, Document request, OutputStream out, CallContext context) { 383 public void init(
384 String outName,
385 Document request,
386 OutputStream out,
387 CallContext context
388 ) {
383 log.debug("ChartGenerator2.init"); 389 log.debug("ChartGenerator2.init");
384 390
385 this.outName = outName; 391 this.outName = outName;
386 this.request = request; 392 this.request = request;
387 this.out = out; 393 this.out = out;
417 this.settings = settings; 423 this.settings = settings;
418 } 424 }
419 425
420 426
421 /** 427 /**
422 * Returns an instance of <i>ChartSettings</i> with a chart specific section 428 * Return instance of <i>ChartSettings</i> with a chart specific section
423 * but with no axes settings. 429 * but with no axes settings.
424 * 430 *
425 * @return an instance of <i>ChartSettings</i>. 431 * @return an instance of <i>ChartSettings</i>.
426 */ 432 */
427 @Override 433 @Override
1181 1187
1182 return new String[] { lower, upper }; 1188 return new String[] { lower, upper };
1183 } 1189 }
1184 1190
1185 1191
1186 /** Returns null if the (x|y)range-element was not found in request document. 1192 /** Returns null if the (x|y)range-element was not found in
1193 *request document.
1187 * This usally means that the axis are not manually zoomed, i.e. showing 1194 * This usally means that the axis are not manually zoomed, i.e. showing
1188 * full data extent. */ 1195 * full data extent. */
1189 protected String[] getValueAxisRangeFromRequest() { 1196 protected String[] getValueAxisRangeFromRequest() {
1190 Element yrange = (Element)XMLUtils.xpath( 1197 Element yrange = (Element)XMLUtils.xpath(
1191 request, 1198 request,
1379 plot.setRenderer(idx, dRenderer); 1386 plot.setRenderer(idx, dRenderer);
1380 1387
1381 area.applyTheme(dRenderer); 1388 area.applyTheme(dRenderer);
1382 1389
1383 // i18n 1390 // i18n
1384 dRenderer.setAreaLabelNumberFormat(Formatter.getFormatter(context.getMeta(), 2, 4)); 1391 dRenderer.setAreaLabelNumberFormat(
1392 Formatter.getFormatter(context.getMeta(), 2, 4));
1385 1393
1386 dRenderer.setAreaLabelTemplate(Resources.getMsg( 1394 dRenderer.setAreaLabelTemplate(Resources.getMsg(
1387 context.getMeta(), "area.label.template", "Area=%sm2")); 1395 context.getMeta(), "area.label.template", "Area=%sm2"));
1388 1396
1389 LegendItem legendItem = dRenderer.getLegendItem(idx, 0); 1397 LegendItem legendItem = dRenderer.getLegendItem(idx, 0);
1415 if (range == null) { 1423 if (range == null) {
1416 return null; 1424 return null;
1417 } 1425 }
1418 else if (range.getLowerBound() == range.getUpperBound()) { 1426 else if (range.getLowerBound() == range.getUpperBound()) {
1419 Range expandedRange = ChartHelper.expandRange(range, 5d); 1427 Range expandedRange = ChartHelper.expandRange(range, 5d);
1420 return new DoubleBounds(expandedRange.getLowerBound(), expandedRange.getUpperBound()); 1428 return new DoubleBounds(
1429 expandedRange.getLowerBound(), expandedRange.getUpperBound());
1421 } 1430 }
1422 1431
1423 return new DoubleBounds(range.getLowerBound(), range.getUpperBound()); 1432 return new DoubleBounds(range.getLowerBound(), range.getUpperBound());
1424 } 1433 }
1425 1434

http://dive4elements.wald.intevation.org