use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class DateFrequencyStateUtil method getCustomerDataset.
public static ICustomerDataset getCustomerDataset(List<IndicatorUnit> units, int sortType) {
CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
for (IndicatorUnit unit : units) {
if (unit.isExcuted()) {
FrequencyExt[] frequencyExt = (FrequencyExt[]) unit.getValue();
ComparatorsFactory.sort(frequencyExt, sortType);
int numOfShown = FrequencyTypeStateUtil.getNumberOfShown(unit, frequencyExt);
for (int i = 0; i < numOfShown; i++) {
FrequencyExt freqExt = frequencyExt[i];
String keyLabel = FrequencyTypeStateUtil.getKeyLabel(freqExt, 30);
customerdataset.addValue(freqExt.getValue(), unit.getIndicatorName(), keyLabel);
ChartDataEntity entity = createDataEntity(unit, freqExt, keyLabel);
customerdataset.addDataEntity(entity);
}
}
}
return customerdataset;
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ColumnSetAnalysisDetailsPage method createAllMatch.
private void createAllMatch(final Composite composite) {
List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
EIndicatorChartType matchingType = EIndicatorChartType.PATTERN_MATCHING;
IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(matchingType, units);
Object chart = chartTypeState.getChart();
TOPChartUtils.getInstance().decorateChart(chart, false);
if (chart != null) {
TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
}
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ColumnSetAnalysisDetailsPage method createSimpleStatistics.
private void createSimpleStatistics(final Composite composite) {
List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, simpleStatIndicator.getRowCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, simpleStatIndicator.getDistinctCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, simpleStatIndicator.getDuplicateCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, simpleStatIndicator.getUniqueCountIndicator()));
IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(EIndicatorChartType.SIMPLE_STATISTICS, units);
// create chart
Object chart = chartTypeState.getChart();
TOPChartUtils.getInstance().decorateChart(chart, false);
if (chart != null) {
TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
}
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ColumnSetAnalysisResultPage method createAllMatchPart.
private Section createAllMatchPart(Composite parentComp, String title, AllMatchIndicator matchIndicator) {
Section section = createSection(form, parentComp, title, null);
section.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(section);
sectionClient.setLayout(new GridLayout(2, false));
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
EIndicatorChartType matchingType = EIndicatorChartType.PATTERN_MATCHING;
ITableTypeStates tableTypeState = TableTypeStatesFactory.getInstance().getTableState(matchingType, units);
TableWithData chartData = new TableWithData(matchingType, tableTypeState.getDataEntity());
TableViewer tableviewer = tableTypeState.getTableForm(sectionClient);
tableviewer.setInput(chartData);
// MOD qiongli feature 19192.
if (masterPage.getCurrentModelElement().getParameters().isStoreData()) {
ChartTableFactory.addMenuAndTip(tableviewer, tableTypeState.getDataExplorer(), masterPage.getCurrentModelElement());
} else {
TableUtils.addTooltipForTable(tableviewer.getTable());
TableUtils.addActionTooltip(tableviewer.getTable());
}
if (canShowChartForResultPage()) {
IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(matchingType, units);
Object chart = chartTypeState.getChart();
TOPChartUtils.getInstance().decorateChart(chart, false);
if (chart != null) {
TOPChartUtils.getInstance().createChartComposite(sectionClient, SWT.NONE, chart, true);
}
}
section.setClient(sectionClient);
return section;
}
use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.
the class ResultPaginationInfo method createResultDataComposite.
private void createResultDataComposite(Composite comp, ModelElementIndicator modelElementIndicator) {
if (modelElementIndicator.getIndicators().length != 0) {
Map<EIndicatorChartType, List<IndicatorUnit>> indicatorComposite = CompositeIndicator.getInstance().getIndicatorComposite(modelElementIndicator);
for (EIndicatorChartType chartType : indicatorComposite.keySet()) {
List<IndicatorUnit> units = indicatorComposite.get(chartType);
if (!units.isEmpty()) {
if (chartType == EIndicatorChartType.UDI_FREQUENCY) {
for (IndicatorUnit unit : units) {
List<IndicatorUnit> specialUnit = new ArrayList<IndicatorUnit>();
specialUnit.add(unit);
createChart(comp, chartType, specialUnit);
}
} else {
createChart(comp, chartType, units);
}
}
}
}
}
Aggregations