comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineProcessor.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
comparison
equal deleted inserted replaced
9555:ef5754ba5573 9556:9b8e8fc1f408
167 SalixLineCrossSectionIndexData.waterlevel(knownWaterlevel)); 167 SalixLineCrossSectionIndexData.waterlevel(knownWaterlevel));
168 } 168 }
169 169
170 @Override 170 @Override
171 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) { 171 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) {
172 if (bundle.getFacetName().equals(FACET_SALIX_SCENARIO_FILTERED) || bundle.getFacetName().equals(FACET_SALIX_SCENARIO_RAW)) { 172 final String facetName = bundle.getFacetName();
173
174 if (facetName.equals(FACET_SALIX_SCENARIO_FILTERED) || facetName.equals(FACET_SALIX_SCENARIO_RAW)) {
173 final CallContext context = generator.getContext(); 175 final CallContext context = generator.getContext();
174 final SalixLineCalculationResult data = (SalixLineCalculationResult) bundle.getData(context); 176 final SalixLineCalculationResult data = (SalixLineCalculationResult) bundle.getData(context);
175 final int dataIndex = ((SalixScenarioResultFacet) bundle.getFacet()).getDataIndex(); 177 final int dataIndex = ((SalixScenarioResultFacet) bundle.getFacet()).getDataIndex();
176 final double[][] scenarioPoints = data.getScenarioPoints(dataIndex); 178 final double[][] scenarioPoints = data.getScenarioPoints(dataIndex);
177 return buildSeriesForPoints(scenarioPoints, generator, bundle, theme, visible, GAP_DISTANCE); 179 return buildSeriesForPoints(scenarioPoints, generator, bundle, theme, visible, GAP_DISTANCE);
178 } 180 }
179 181
180 if (bundle.getFacetName().equals(FACET_SALIX_RANK)) { 182 if (facetName.equals(FACET_SALIX_RANK)) {
181 final CallMeta meta = generator.getContext().getMeta(); 183 final CallMeta meta = generator.getContext().getMeta();
182 184
183 final StripedAreaDataset dataset = new StripedAreaDataset(theme); 185 final StripedAreaDataset dataset = new StripedAreaDataset(facetName, theme);
184 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.excellent", meta), Color.decode("#00B0F0"), -0.3, 0.3)); 186 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.excellent", meta), Color.decode("#00B0F0"), -0.3, 0.3));
185 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.good", meta), Color.decode("#00B050"), 0.3, 0.5)); 187 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.good", meta), Color.decode("#00B050"), 0.3, 0.5));
186 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.moderate", meta), Color.decode("#FFFF00"), 0.5, 1.0)); 188 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.moderate", meta), Color.decode("#FFFF00"), 0.5, 1.0));
187 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.bad", meta), Color.decode("#FFC000"), 1.0, 1.5)); 189 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.bad", meta), Color.decode("#FFC000"), 1.0, 1.5));
188 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.very_bad", meta), Color.decode("#FF0000"), 1.5, Double.NaN)); 190 dataset.addStripe(new Stripe(getSimpleMsg("uinfo_salix_rank.very_bad", meta), Color.decode("#FF0000"), 1.5, Double.NaN));
190 generator.addAxisDataset(dataset, getAxisName(), visible); 192 generator.addAxisDataset(dataset, getAxisName(), visible);
191 193
192 return null; 194 return null;
193 } 195 }
194 196
195 return buildSeriesForType(generator, bundle, theme, visible, doGetType(bundle.getFacetName()), GAP_DISTANCE); 197 return buildSeriesForType(generator, bundle, theme, visible, doGetType(facetName), GAP_DISTANCE);
196 } 198 }
197 199
198 private String getSimpleMsg(final String code, final CallMeta meta) { 200 private String getSimpleMsg(final String code, final CallMeta meta) {
199 return Resources.getMsg(meta, code); 201 return Resources.getMsg(meta, code);
200 } 202 }

http://dive4elements.wald.intevation.org