Search in sources :

Example 6 with TableIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.

the class SimpleRuleStatisticsChartState method getCustomerDataset.

public ICustomerDataset getCustomerDataset() {
    CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
    for (TableIndicatorUnit unit : units) {
        String value = CommonStateUtil.getUnitValue(unit.getValue(), StringFormatUtil.DOUBLE_NUMBER);
        String label = unit.getIndicatorName();
        // $NON-NLS-1$
        customerdataset.addValue(Double.parseDouble(value), label, "");
        ChartDataEntity entity = CommonStateUtil.createDataEntity(unit, value, label);
        customerdataset.addDataEntity(entity);
    }
    return customerdataset;
}
Also used : TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 7 with TableIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.

the class WhereRuleStatisticsStateTable method getCustomerXYDataset.

@Override
public ICustomerDataset getCustomerXYDataset() {
    Map<Integer, Double> valueMap = new HashMap<Integer, Double>();
    int x = 0;
    for (TableIndicatorUnit unit : units) {
        x++;
        double y = 100 * (1 - (Double.parseDouble(unit.getValue().toString()) / getRowCount()));
        valueMap.put(x, y);
    }
    final CustomerXYSeriesCollection dataset = new CustomerXYSeriesCollection(valueMap);
    return dataset;
}
Also used : HashMap(java.util.HashMap) CustomerXYSeriesCollection(org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerXYSeriesCollection) TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit)

Example 8 with TableIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.

the class WhereRuleStatisticsStateTable method getCustomerDatasetRownCount.

/**
 * DOC xqliu Comment method "getCustomerDatasetRownCount".
 *
 * @return
 */
public ICustomerDataset getCustomerDatasetRownCount() {
    CustomerDefaultCategoryDataset customerDataset = new CustomerDefaultCategoryDataset();
    TableIndicatorUnit rownCountUnit = getRownCountUnit(units);
    if (rownCountUnit != null) {
        addRownCountDataEntity2CustomerDataset(customerDataset, rownCountUnit);
    }
    return customerDataset;
}
Also used : TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)

Example 9 with TableIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.

the class WhereRuleStatisticsTableState method getDataEntity.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
     */
@Override
public ChartDataEntity[] getDataEntity() {
    List<WhereRuleChartDataEntity> dataEnities = new ArrayList<WhereRuleChartDataEntity>();
    for (TableIndicatorUnit unit : tableunits) {
        if (IndicatorEnum.WhereRuleIndicatorEnum.equals(unit.getType())) {
            double value = WhereRuleStatisticsStateUtil.getMatchValue(unit.getValue());
            WhereRuleChartDataEntity entity = WhereRuleStatisticsStateUtil.createRuleDataEntity(unit, unit.getIndicatorName(), value, WhereRuleStatisticsStateUtil.getNotMatchValue(unit.getValue(), value, unit.geIndicatorCount()));
            dataEnities.add(entity);
        }
    }
    return dataEnities.toArray(new WhereRuleChartDataEntity[dataEnities.size()]);
}
Also used : WhereRuleChartDataEntity(org.talend.dq.indicators.preview.table.WhereRuleChartDataEntity) ArrayList(java.util.ArrayList) TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit)

Example 10 with TableIndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit in project tdq-studio-se by Talend.

the class DQRuleUtilities method createIndicatorUnit.

/**
 * DOC xqliu Comment method "createIndicatorUnit".
 *
 * @param fe
 * @param tableIndicator
 * @param analysis
 * @return
 */
public static TableIndicatorUnit createIndicatorUnit(RuleRepNode ruleRepNode, TableIndicator tableIndicator, Analysis analysis) {
    IndicatorDefinition whereRule = ruleRepNode.getRule();
    for (Indicator indicator : tableIndicator.getIndicators()) {
        if (whereRule.getName().equals(indicator.getName())) {
            return null;
        }
    }
    WhereRuleIndicator[] compositeWhereRuleIndicator = createCompositeWhereRuleIndicator(tableIndicator.getColumnSet(), whereRule);
    IndicatorEnum type = IndicatorEnum.findIndicatorEnum(compositeWhereRuleIndicator[0].eClass());
    TableIndicatorUnit addIndicatorUnit = tableIndicator.addSpecialIndicator(whereRule, type, compositeWhereRuleIndicator[0]);
    DependenciesHandler.getInstance().setUsageDependencyOn(analysis, whereRule);
    return addIndicatorUnit;
}
Also used : WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) TableIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition) TableIndicator(org.talend.dataprofiler.core.model.TableIndicator) Indicator(org.talend.dataquality.indicators.Indicator) WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator)

Aggregations

TableIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.TableIndicatorUnit)24 ArrayList (java.util.ArrayList)8 TableIndicator (org.talend.dataprofiler.core.model.TableIndicator)5 Indicator (org.talend.dataquality.indicators.Indicator)5 TreeItem (org.eclipse.swt.widgets.TreeItem)4 RowCountIndicator (org.talend.dataquality.indicators.RowCountIndicator)4 CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)3 WhereRuleIndicator (org.talend.dataquality.indicators.sql.WhereRuleIndicator)3 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)3 RuleRepNode (org.talend.dq.nodes.RuleRepNode)3 IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)3 NamedColumnSet (orgomg.cwm.resource.relational.NamedColumnSet)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 List (java.util.List)2 Map (java.util.Map)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2