comparison artifacts/src/main/java/org/dive4elements/river/exports/process/AreaProcessor.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 d8e753d0fdb9
children
comparison
equal deleted inserted replaced
9555:ef5754ba5573 9556:9b8e8fc1f408
32 public class AreaProcessor extends DefaultProcessor { 32 public class AreaProcessor extends DefaultProcessor {
33 33
34 private static final Logger log = Logger.getLogger(AreaProcessor.class); 34 private static final Logger log = Logger.getLogger(AreaProcessor.class);
35 35
36 protected XYSeries getSeries( 36 protected XYSeries getSeries(
37 String facetName,
37 String seriesName, 38 String seriesName,
38 Object data, 39 Object data,
39 String facetType, 40 String facetType,
40 ThemeDocument theme 41 ThemeDocument theme
41 ) { 42 ) {
42 if (data == null || facetType == null) { 43 if (data == null || facetType == null) {
43 return null; 44 return null;
44 } 45 }
45 46
46 XYSeries series = new StyledXYSeries(seriesName, false, theme); 47 XYSeries series = new StyledXYSeries(facetName,seriesName, false, theme);
47 48
48 if (facetType.equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { 49 if (facetType.equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) {
49 WQCKms wqckms = (WQCKms) data; 50 WQCKms wqckms = (WQCKms) data;
50 int size = wqckms.size(); 51 int size = wqckms.size();
51 for (int i = 0; i < size; i++) { 52 for (int i = 0; i < size; i++) {
83 ArtifactAndFacet bundle, 84 ArtifactAndFacet bundle,
84 ThemeDocument theme, 85 ThemeDocument theme,
85 boolean visible) { 86 boolean visible) {
86 CallContext context = generator.getContext(); 87 CallContext context = generator.getContext();
87 String seriesName = bundle.getFacetDescription(); 88 String seriesName = bundle.getFacetDescription();
88 StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); 89 StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(bundle.getFacetName(),theme);
89 90
90 log.debug("Area Processor processing: " + seriesName); 91 log.debug("Area Processor processing: " + seriesName);
91 92
92 AreaFacet.Data data = (AreaFacet.Data) bundle.getData(context); 93 AreaFacet.Data data = (AreaFacet.Data) bundle.getData(context);
93 94
94 String lowerFacetName = data.getLowerFacetName(); 95 String lowerFacetName = data.getLowerFacetName();
95 String upperFacetName = data.getUpperFacetName(); 96 String upperFacetName = data.getUpperFacetName();
96 97
97 XYSeries up = getSeries( 98 XYSeries up = getSeries(bundle.getFacetName(),
98 seriesName, data.getUpperData(), upperFacetName, theme); 99 seriesName, data.getUpperData(), upperFacetName, theme);
99 XYSeries down = getSeries( 100 XYSeries down = getSeries(bundle.getFacetName(),
100 seriesName + " ", data.getLowerData(), lowerFacetName, theme); 101 seriesName + " ", data.getLowerData(), lowerFacetName, theme);
101 102
102 103
103 // TODO Depending on style, the area (e.g. 20m^2) 104 // TODO Depending on style, the area (e.g. 20m^2)
104 // should be added as annotation. 105 // should be added as annotation.

http://dive4elements.wald.intevation.org