Revision 68eab158
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java | ||
---|---|---|
18 | 18 |
import java.util.UUID; |
19 | 19 |
import java.util.stream.Collectors; |
20 | 20 |
|
21 |
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; |
|
22 | 21 |
import org.eclipse.jface.layout.GridDataFactory; |
23 | 22 |
import org.eclipse.jface.window.Window; |
24 | 23 |
import org.eclipse.swt.SWT; |
... | ... | |
39 | 38 |
import eu.etaxonomy.cdm.model.description.Feature; |
40 | 39 |
import eu.etaxonomy.cdm.model.description.QuantitativeData; |
41 | 40 |
import eu.etaxonomy.cdm.model.description.SpecimenDescription; |
42 |
import eu.etaxonomy.cdm.model.description.StatisticalMeasure; |
|
43 | 41 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
44 | 42 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
45 | 43 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
... | ... | |
160 | 158 |
matrix.setDirty(); |
161 | 159 |
|
162 | 160 |
aggregateCategorcialHistogram(matrix.getFeatureToHistogramMap()); |
163 |
aggregateQuantitativeSummary(matrix.getFeatureToQuantStatisticsMap()); |
|
161 |
aggregateQuantitativeSummary(matrix.getFeatureToQuantDataStatisticsMap());
|
|
164 | 162 |
} |
165 | 163 |
|
166 | 164 |
}); |
... | ... | |
185 | 183 |
} |
186 | 184 |
|
187 | 185 |
@SuppressWarnings("unchecked") |
188 |
private void aggregateQuantitativeSummary(Map<Feature, DescriptiveStatistics> featureToQuantStatisticsMap) {
|
|
189 |
featureToQuantStatisticsMap.clear(); |
|
186 |
private void aggregateQuantitativeSummary(Map<Feature, QuantitativeDataStatistics> featureToQuantDataStatisticsMap) {
|
|
187 |
featureToQuantDataStatisticsMap.clear();
|
|
190 | 188 |
matrix.getDescriptions() |
191 | 189 |
.forEach(o -> ((RowWrapperDTO) o).getSpecimenDescription().getElements().stream() |
192 | 190 |
.filter(descriptionElement -> descriptionElement instanceof QuantitativeData) |
193 | 191 |
.forEach(quantData -> { |
194 | 192 |
Feature feature = ((QuantitativeData) quantData).getFeature(); |
195 |
DescriptiveStatistics statistics = featureToQuantStatisticsMap.get(feature);
|
|
196 |
if(statistics==null){
|
|
197 |
statistics = new DescriptiveStatistics();
|
|
193 |
QuantitativeDataStatistics dataStatistics = featureToQuantDataStatisticsMap.get(feature);
|
|
194 |
if(dataStatistics==null){
|
|
195 |
dataStatistics = new QuantitativeDataStatistics();
|
|
198 | 196 |
} |
199 |
featureToQuantStatisticsMap.put(feature, statistics); |
|
200 |
((QuantitativeData) quantData).getStatisticalValues().stream() |
|
201 |
.filter(value -> value.getType().equals(StatisticalMeasure.EXACT_VALUE())) |
|
202 |
.forEach(value -> featureToQuantStatisticsMap.get(feature).addValue(value.getValue())); |
|
197 |
featureToQuantDataStatisticsMap.put(feature, dataStatistics); |
|
198 |
dataStatistics.addQuantitativeData((QuantitativeData) quantData); |
|
203 | 199 |
})); |
204 | 200 |
} |
205 | 201 |
|
Also available in: Unified diff
ref #7549 Add min and max data series to quant data chart