Search in sources :

Example 6 with PatternChartDataEntity

use of org.talend.dq.indicators.preview.table.PatternChartDataEntity in project tdq-studio-se by Talend.

the class PatternDynamicChartEventReceiver method refreshTable.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver#refreshTable(java.lang.String)
     */
@Override
public void refreshTable(String value) {
    TableWithData input = (TableWithData) tableViewer.getInput();
    if (input != null) {
        ChartDataEntity[] dataEntities = input.getEnity();
        if (dataEntities != null && dataEntities.length > getIndexInDataset()) {
            ((PatternChartDataEntity) dataEntities[getIndexInDataset()]).setNumMatch(value);
            ((PatternChartDataEntity) dataEntities[getIndexInDataset()]).setNumNoMatch(value);
            tableViewer.getTable().clearAll();
            tableViewer.setInput(input);
        }
    }
}
Also used : PatternChartDataEntity(org.talend.dq.indicators.preview.table.PatternChartDataEntity) TableWithData(org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData) PatternChartDataEntity(org.talend.dq.indicators.preview.table.PatternChartDataEntity) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity)

Example 7 with PatternChartDataEntity

use of org.talend.dq.indicators.preview.table.PatternChartDataEntity in project tdq-studio-se by Talend.

the class PatternStatisticeStateUtil method createDataEntity.

/**
 * DOC yyin Comment method "createDataEntity".
 *
 * @param unit
 * @param label
 * @param notMathCount
 * @param machCount
 * @return
 */
public static PatternChartDataEntity createDataEntity(IndicatorUnit unit, String label, String notMathCount, String machCount) {
    PatternChartDataEntity patternEntity = new PatternChartDataEntity();
    patternEntity.setIndicator(unit.getIndicator());
    patternEntity.setLabel(label);
    patternEntity.setNumMatch(machCount);
    patternEntity.setNumNoMatch(notMathCount);
    return patternEntity;
}
Also used : PatternChartDataEntity(org.talend.dq.indicators.preview.table.PatternChartDataEntity)

Example 8 with PatternChartDataEntity

use of org.talend.dq.indicators.preview.table.PatternChartDataEntity in project tdq-studio-se by Talend.

the class RedundancyAnalysisResultPage method creatChart.

private void creatChart(Composite parent, String tableA, String tableB) {
    CustomerDefaultCategoryDataset dataset = new CustomerDefaultCategoryDataset();
    // DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(rowMatchingIndicatorA.getNotMatchingValueCount(), NOT_MATCHING, tableA);
    dataset.addValue(rowMatchingIndicatorA.getMatchingValueCount(), MATCHING, tableA);
    // add by hcheng
    PatternChartDataEntity dataEntityA = new PatternChartDataEntity();
    dataEntityA.setLabel(tableA);
    dataEntityA.setIndicator(rowMatchingIndicatorA);
    dataEntityA.setNumMatch(rowMatchingIndicatorA.getMatchingValueCount().toString());
    dataEntityA.setNumNoMatch(rowMatchingIndicatorA.getNotMatchingValueCount().toString());
    dataset.addDataEntity(dataEntityA);
    if (!isHasDeactivatedIndicator) {
        dataset.addValue(rowMatchingIndicatorB.getNotMatchingValueCount(), NOT_MATCHING, tableB);
        dataset.addValue(rowMatchingIndicatorB.getMatchingValueCount(), MATCHING, tableB);
        PatternChartDataEntity dataEntityB = new PatternChartDataEntity();
        dataEntityB.setLabel(tableB);
        dataEntityB.setIndicator(rowMatchingIndicatorB);
        dataEntityB.setNumMatch(rowMatchingIndicatorB.getMatchingValueCount().toString());
        dataEntityB.setNumNoMatch(rowMatchingIndicatorB.getNotMatchingValueCount().toString());
        dataset.addDataEntity(dataEntityB);
    }
    Object chart = TOPChartUtils.getInstance().createStackedBarChart(// $NON-NLS-1$
    DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.ColumnsComparison"), // $NON-NLS-1$
    dataset, true, true);
    final Object chartComp = TOPChartUtils.getInstance().createChartComposite(parent, SWT.NONE, chart, true);
    // add by hcheng for 6530(add menu to "View query result" for chart )
    addMenuToChartComp(chartComp, new RowMatchExplorer(), getAnalysisHandler().getAnalysis(), ((ICustomerDataset) dataset).getDataEntities());
}
Also used : PatternChartDataEntity(org.talend.dq.indicators.preview.table.PatternChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) RowMatchExplorer(org.talend.dq.analysis.explore.RowMatchExplorer)

Aggregations

PatternChartDataEntity (org.talend.dq.indicators.preview.table.PatternChartDataEntity)8 CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)4 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)4 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)2 TableWithData (org.talend.dataprofiler.core.ui.editor.preview.model.TableWithData)2 PatternMatchingExt (org.talend.dq.indicators.ext.PatternMatchingExt)2 ArrayList (java.util.ArrayList)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 GridData (org.eclipse.swt.layout.GridData)1 Table (org.eclipse.swt.widgets.Table)1 TableColumn (org.eclipse.swt.widgets.TableColumn)1 TableItem (org.eclipse.swt.widgets.TableItem)1 TableStructureEntity (org.talend.dataprofiler.core.ui.editor.preview.model.entity.TableStructureEntity)1 Analysis (org.talend.dataquality.analysis.Analysis)1 Indicator (org.talend.dataquality.indicators.Indicator)1 ColumnDependencyIndicator (org.talend.dataquality.indicators.columnset.ColumnDependencyIndicator)1 ColumnDependencyExplorer (org.talend.dq.analysis.explore.ColumnDependencyExplorer)1 RowMatchExplorer (org.talend.dq.analysis.explore.RowMatchExplorer)1