Search in sources :

Example 1 with DynamicBAWChartEventReceiver

use of org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver in project tdq-studio-se by Talend.

the class ColumnAnalysisResultPage method registerDynamicEvent.

/**
 * Added TDQ-8787 20140613 yyin: create all charts before running, register each chart with its related indicator.
 */
public void registerDynamicEvent() {
    // get all indicators and datasets
    List<DynamicIndicatorModel> indiAndDatasets = uiPagination.getAllIndcatorAndDatasetOfCurrentPage();
    // register dynamic event,for the indicator (for each column)
    for (DynamicIndicatorModel oneCategoryIndicatorModel : indiAndDatasets) {
        TableViewer tableViewer = oneCategoryIndicatorModel.getTableViewer();
        if (EIndicatorChartType.SUMMARY_STATISTICS.equals(oneCategoryIndicatorModel.getChartType())) {
            // when all/not-all summary indicators are selected
            DynamicBAWChartEventReceiver bawReceiver = AnalysisUtils.createDynamicBAWChartEventReceiver(oneCategoryIndicatorModel, eventReceivers);
            bawReceiver.setChartComposite(chartComposite);
            bawReceiver.setParentChartComposite((Composite) oneCategoryIndicatorModel.getBawParentChartComp());
            bawReceiver.refreshChart();
            bawReceiver.setTableViewer(tableViewer);
        // no need to register the parent baw receiver with one of summary indicator, no need to handle baw
        // actually
        } else {
            int index = 0;
            for (Indicator oneIndicator : oneCategoryIndicatorModel.getIndicatorList()) {
                DynamicChartEventReceiver eReceiver = AnalysisUtils.createDynamicChartEventReceiver(oneCategoryIndicatorModel, index++, oneIndicator);
                eReceiver.setChartComposite(chartComposite);
                eReceiver.refreshChart();
                eReceiver.setTableViewer(tableViewer);
                // clear data
                eReceiver.clearValue();
                registerIndicatorEvent(oneIndicator, eReceiver);
            }
        }
    }
    reLayoutChartComposite();
    registerOtherDynamicEvent();
}
Also used : DynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver) DynamicIndicatorModel(org.talend.dataprofiler.core.model.dynamic.DynamicIndicatorModel) TableViewer(org.eclipse.jface.viewers.TableViewer) Indicator(org.talend.dataquality.indicators.Indicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) DynamicBAWChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver)

Example 2 with DynamicBAWChartEventReceiver

use of org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver 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;
}
Also used : DynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver) BenfordFrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver) PatternDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.PatternDynamicChartEventReceiver) FrequencyDynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.FrequencyDynamicChartEventReceiver) CustomerDefaultBAWDataset(org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultBAWDataset) Indicator(org.talend.dataquality.indicators.Indicator) DynamicBAWChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver)

Example 3 with DynamicBAWChartEventReceiver

use of org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver in project tdq-studio-se by Talend.

the class DynamicAnalysisMasterPage method registerDynamicEvent.

/**
 * Added TDQ-8787 20140613 yyin: create all charts before running, register each chart with its related indicator.
 */
public void registerDynamicEvent() {
    // only worked for the analysis which support dynamic chart
    // create all charts for related indicator in current page
    createDynamicChartsBeforeRun();
    // get all indicators and datasets
    List<DynamicIndicatorModel> indiAndDatasets = getDynamicDatasets();
    // register dynamic event,for the indicator (for each column)
    for (DynamicIndicatorModel oneCategoryIndicatorModel : indiAndDatasets) {
        if (EIndicatorChartType.SUMMARY_STATISTICS.equals(oneCategoryIndicatorModel.getChartType())) {
            // when all summary indicators are selected
            DynamicBAWChartEventReceiver bawReceiver = AnalysisUtils.createDynamicBAWChartEventReceiver(oneCategoryIndicatorModel, eventReceivers);
            bawReceiver.setChartComposite(chartComposite);
        // no need to register the parent baw receiver with one of summary indicator, no need to handle baw
        // actually
        } else {
            int index = 0;
            for (Indicator oneIndicator : oneCategoryIndicatorModel.getIndicatorList()) {
                // if the indicator is a frequency indicator, create a Frequency Event Receiver
                DynamicChartEventReceiver eReceiver = createEventReceiver(oneCategoryIndicatorModel, index++, oneIndicator);
                eReceiver.setChartComposite(chartComposite);
                // clear data
                eReceiver.clearValue();
                registerIndicatorEvent(oneIndicator, eReceiver);
            }
        }
    }
    reLayoutChartComposite();
    registerOtherDynamicEvent();
}
Also used : DynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver) DynamicIndicatorModel(org.talend.dataprofiler.core.model.dynamic.DynamicIndicatorModel) Indicator(org.talend.dataquality.indicators.Indicator) DynamicBAWChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver)

Aggregations

DynamicBAWChartEventReceiver (org.talend.dataprofiler.core.ui.events.DynamicBAWChartEventReceiver)3 DynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver)3 Indicator (org.talend.dataquality.indicators.Indicator)3 DynamicIndicatorModel (org.talend.dataprofiler.core.model.dynamic.DynamicIndicatorModel)2 TableViewer (org.eclipse.jface.viewers.TableViewer)1 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)1 CustomerDefaultBAWDataset (org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultBAWDataset)1 BenfordFrequencyDynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.BenfordFrequencyDynamicChartEventReceiver)1 FrequencyDynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.FrequencyDynamicChartEventReceiver)1 PatternDynamicChartEventReceiver (org.talend.dataprofiler.core.ui.events.PatternDynamicChartEventReceiver)1