diff artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractProcessor.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 853f2dafc16e
children 1d4262a68f1f
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractProcessor.java	Tue Oct 23 16:26:48 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractProcessor.java	Tue Oct 23 16:26:58 2018 +0200
@@ -104,11 +104,12 @@
 
         final Artifact artifact = bundle.getArtifact();
 
-        final StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme);
+        final String facetDescription = bundle.getFacetDescription();
+        final String facetName = bundle.getFacetName();
+
+        final StyledXYSeries series = new StyledXYSeries(facetName, facetDescription, theme);
         series.putMetaData(metaData, artifact, context);
 
-        final String facetName = bundle.getFacetName();
-
         final double[][] filteredPoints = filterPoints(points, context, artifact, facetName);
 
         if (gapDistance == null)
@@ -129,11 +130,12 @@
 
         final Artifact artifact = bundle.getArtifact();
 
-        final StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme);
+        final String facetName = bundle.getFacetName();
+        final String facetDescription = bundle.getFacetDescription();
+
+        final StyledXYSeries series = new StyledXYSeries(facetName, facetDescription, theme);
         series.putMetaData(metaData, artifact, context);
 
-        final String facetName = bundle.getFacetName();
-
         // Create WQKms to use the step points method
         // REMARK: must have any values in w array; not sure whether the name is needed
         final WQKms wqkms = new WQKms(points[0], points[1], points[1], facetName);
@@ -150,16 +152,19 @@
 
         final AbstractTkhCalculationResult data = (AbstractTkhCalculationResult) getResult(generator, bundle);
 
-        final StyledXYSeries seriesUp = new StyledXYSeries(bundle.getFacetDescription(), theme);
+        final String facetName = bundle.getFacetName();
+        final String facetDescription = bundle.getFacetDescription();
+
+        final StyledXYSeries seriesUp = new StyledXYSeries(facetName, facetDescription, theme);
         final double[][] pointsUp = data.getTkhUpPoints();
         StyledSeriesBuilder.addPoints(seriesUp, pointsUp, true);
 
         // REMARK: we add " " because the description is misused as id, which must be unique.
-        final StyledXYSeries seriesDown = new StyledXYSeries(bundle.getFacetDescription() + " ", theme);
+        final StyledXYSeries seriesDown = new StyledXYSeries(facetName, facetDescription + " ", theme);
         final double[][] pointsDown = data.getTkhDownPoints();
         StyledSeriesBuilder.addPoints(seriesDown, pointsDown, true);
 
-        final StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme);
+        final StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(facetName, theme);
         area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN);
         area.addSeries(seriesUp);
         area.addSeries(seriesDown);

http://dive4elements.wald.intevation.org