use of org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultBAWDataset in project tdq-studio-se by Talend.
the class AnalysisUtils method createDynamicBAWChartEventReceiver.
/**
* DOC yyin Comment method "createDynamicBAWChartEventReceiver".
*
* @param oneCategoryIndicatorModel
* @param categoryDataset
* @return
*/
public static DynamicBAWChartEventReceiver createDynamicBAWChartEventReceiver(DynamicIndicatorModel oneCategoryIndicatorModel, Map<Indicator, EventReceiver> eventReceivers) {
DynamicBAWChartEventReceiver bawReceiver = new DynamicBAWChartEventReceiver();
Object categoryDataset = oneCategoryIndicatorModel.getDataset();
if (categoryDataset instanceof CustomerDefaultBAWDataset) {
// all summary selected
bawReceiver.setBawDataset((CustomerDefaultBAWDataset) categoryDataset);
} else {
// not-all summary selected
bawReceiver.setDataset(categoryDataset);
}
bawReceiver.setBAWparentComposite(oneCategoryIndicatorModel.getBawParentChartComp());
bawReceiver.setTableViewer(oneCategoryIndicatorModel.getTableViewer());
int index = 0;
int length = oneCategoryIndicatorModel.getSummaryIndicators().size();
for (Indicator oneIndicator : oneCategoryIndicatorModel.getSummaryIndicators()) {
DynamicChartEventReceiver eReceiver = bawReceiver.createEventReceiver(IndicatorEnum.findIndicatorEnum(oneIndicator.eClass()), oneIndicator);
eReceiver.setTableViewer(oneCategoryIndicatorModel.getTableViewer());
eReceiver.setEntityIndex(index++);
if (SummaryStatisticsState.FULL_FLAG != length) {
eReceiver.setDataset(categoryDataset);
}
eReceiver.clearValue();
eventReceivers.put(oneIndicator, eReceiver);
EventManager.getInstance().register(oneIndicator, EventEnum.DQ_DYMANIC_CHART, eReceiver);
}
bawReceiver.clearValue();
return bawReceiver;
}
use of org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultBAWDataset in project tdq-studio-se by Talend.
the class SummaryStatisticsState method getCustomerDataset.
public ICustomerDataset getCustomerDataset() {
Map<IndicatorEnum, Double> map = new HashMap<IndicatorEnum, Double>();
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
// MOD xqliu 2009-06-29 bug 7068
String value = null;
if (indicators2ValueMap.containsKey(unit)) {
value = indicators2ValueMap.get(unit);
} else {
value = summaryUtil.getUnitValue(unit);
}
if (Java2SqlType.isNumbericInSQL(sqltype)) {
try {
map.put(unit.getType(), Double.parseDouble(value));
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
ChartDataEntity entity = summaryUtil.createDataEntity(unit, value);
customerdataset.addDataEntity(entity);
}
if (isIntact() && !isSupportDynamicChart) {
CustomerDefaultBAWDataset dataset = new CustomerDefaultBAWDataset(map.get(IndicatorEnum.MeanIndicatorEnum), map.get(IndicatorEnum.MedianIndicatorEnum), map.get(IndicatorEnum.LowerQuartileIndicatorEnum), map.get(IndicatorEnum.UpperQuartileIndicatorEnum), map.get(IndicatorEnum.MinValueIndicatorEnum), map.get(IndicatorEnum.MaxValueIndicatorEnum), customerdataset);
dataset.addDataEntity(customerdataset.getDataEntities());
return dataset;
} else {
// MOD hcheng,Range indicator value should not appear in bar chart
if (!isIntact()) {
map.remove(IndicatorEnum.RangeIndicatorEnum);
map.remove(IndicatorEnum.IQRIndicatorEnum);
}
for (IndicatorEnum indicatorEnum : map.keySet()) {
customerdataset.addValue(map.get(indicatorEnum), indicatorEnum.getLabel(), indicatorEnum.getLabel());
}
return customerdataset;
}
}
Aggregations