Search in sources :

Example 36 with IndicatorUnit

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;
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) FrequencyExt(org.talend.dq.indicators.ext.FrequencyExt)

Example 37 with IndicatorUnit

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);
    }
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) EObject(org.eclipse.emf.ecore.EObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Example 38 with IndicatorUnit

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);
    }
}
Also used : IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) EObject(org.eclipse.emf.ecore.EObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Example 39 with IndicatorUnit

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;
}
Also used : AbstractPageControllerComposite(org.eclipse.nebula.widgets.pagination.AbstractPageControllerComposite) Composite(org.eclipse.swt.widgets.Composite) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) ArrayList(java.util.ArrayList) TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) Section(org.eclipse.ui.forms.widgets.Section) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates) GridLayout(org.eclipse.swt.layout.GridLayout) ITableTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.table.ITableTypeStates) GridData(org.eclipse.swt.layout.GridData) EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 40 with IndicatorUnit

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);
                }
            }
        }
    }
}
Also used : EIndicatorChartType(org.talend.dq.indicators.preview.EIndicatorChartType) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)54 ArrayList (java.util.ArrayList)24 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)17 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)17 ColumnIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)13 CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)10 TreeItem (org.eclipse.swt.widgets.TreeItem)9 Indicator (org.talend.dataquality.indicators.Indicator)9 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)7 FrequencyExt (org.talend.dq.indicators.ext.FrequencyExt)7 BoxIndicator (org.talend.dataquality.indicators.BoxIndicator)5 CountsIndicator (org.talend.dataquality.indicators.CountsIndicator)5 IQRIndicator (org.talend.dataquality.indicators.IQRIndicator)5 PhoneNumbStatisticsIndicator (org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator)5 IRepositoryNode (org.talend.repository.model.IRepositoryNode)5 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)4 ColumnSetIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)4 IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)4 IChartTypeStates (org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)3 AverageLengthIndicator (org.talend.dataquality.indicators.AverageLengthIndicator)3