Search in sources :

Example 1 with CountAvgNullIndicator

use of org.talend.dataquality.indicators.columnset.CountAvgNullIndicator in project tdq-studio-se by Talend.

the class CorrelationAnalysisDetailsPage method initializeIndicator.

private void initializeIndicator(Indicator indicator) {
    if (indicator.getIndicatorDefinition() == null) {
        DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
    }
    // MOD xqliu 2010-04-06 bug 12161
    if (indicator instanceof CountAvgNullIndicator) {
        if (((CountAvgNullIndicator) indicator).getChildIndicators().size() == 0) {
            CountAvgNullIndicator countAvgNullIndicator = (CountAvgNullIndicator) indicator;
            fillSimpleIndicators(countAvgNullIndicator);
        }
        for (Indicator child : ((CompositeIndicator) indicator).getChildIndicators()) {
            // recurse
            initializeIndicator(child);
        }
    } else if (indicator instanceof CompositeIndicator) {
        // MOD qiongli 2012-5-14 TDQ-5256 should initialize children
        for (Indicator child : ((CompositeIndicator) indicator).getChildIndicators()) {
            initializeIndicator(child);
        }
    }
}
Also used : CompositeIndicator(org.talend.dataquality.indicators.CompositeIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) ColumnSetMultiValueIndicator(org.talend.dataquality.indicators.columnset.ColumnSetMultiValueIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) Indicator(org.talend.dataquality.indicators.Indicator) CompositeIndicator(org.talend.dataquality.indicators.CompositeIndicator)

Example 2 with CountAvgNullIndicator

use of org.talend.dataquality.indicators.columnset.CountAvgNullIndicator in project tdq-studio-se by Talend.

the class CorrelationAnalysisResultPage method createBubbleOrGanttChart.

private void createBubbleOrGanttChart(final ScrolledForm sForm, final Composite composite, final ColumnSetMultiValueIndicator columnSetMultiValueIndicator) {
    List<Composite> previewChartList = new ArrayList<Composite>();
    List<ModelElement> bubOrGanttColumnList = new ArrayList<ModelElement>();
    if (columnSetMultiValueIndicator instanceof CountAvgNullIndicator) {
        bubOrGanttColumnList = columnSetMultiValueIndicator.getNumericColumns();
    } else {
        bubOrGanttColumnList = columnSetMultiValueIndicator.getDateColumns();
    }
    for (ModelElement column : bubOrGanttColumnList) {
        final MetadataColumn tdColumn = (MetadataColumn) column;
        final ExpandableComposite exComp = toolkit.createExpandableComposite(composite, ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
        // $NON-NLS-1$
        exComp.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.column", tdColumn.getName()));
        exComp.setLayout(new GridLayout());
        exComp.setData(columnSetMultiValueIndicator);
        previewChartList.add(exComp);
        final Composite comp = toolkit.createComposite(exComp);
        comp.setLayout(new GridLayout(2, false));
        comp.setLayoutData(new GridData(GridData.FILL_BOTH));
        if (tdColumn != null) {
            IRunnableWithProgress rwp = new IRunnableWithProgress() {

                public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    monitor.beginTask(DefaultMessagesImpl.getString("ColumnCorrelationNominalIntervalResultPage.CreatePreview", tdColumn.getName()), // $NON-NLS-1$
                    IProgressMonitor.UNKNOWN);
                    Display.getDefault().asyncExec(new Runnable() {

                        public void run() {
                            HideSeriesChartComposite hcc = new HideSeriesChartComposite(comp, getAnalysisHandler().getAnalysis(), columnSetMultiValueIndicator, tdColumn, true);
                            GridData gd = new GridData();
                            gd.widthHint = 800;
                            gd.heightHint = 450;
                            hcc.setLayoutData(gd);
                        }
                    });
                    monitor.done();
                }
            };
            try {
                new ProgressMonitorDialog(getSite().getShell()).run(true, false, rwp);
            } catch (Exception ex) {
                log.error(ex, ex);
            }
        }
        exComp.addExpansionListener(new ExpansionAdapter() {

            @Override
            public void expansionStateChanged(ExpansionEvent e) {
                getChartComposite().layout();
                sForm.reflow(true);
            }
        });
        exComp.setExpanded(true);
        exComp.setClient(comp);
    }
    if (!previewChartList.isEmpty()) {
        this.previewChartCompsites = previewChartList.toArray(new Composite[previewChartList.size()]);
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) HideSeriesChartComposite(org.talend.dataprofiler.core.ui.editor.preview.HideSeriesChartComposite) HideSeriesChartComposite(org.talend.dataprofiler.core.ui.editor.preview.HideSeriesChartComposite) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) ArrayList(java.util.ArrayList) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) GridLayout(org.eclipse.swt.layout.GridLayout) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) GridData(org.eclipse.swt.layout.GridData) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent)

Example 3 with CountAvgNullIndicator

use of org.talend.dataquality.indicators.columnset.CountAvgNullIndicator in project tdq-studio-se by Talend.

the class IndicatorsComp method setInput.

// input composite indicator
public void setInput(Object... obj) {
    List<ColumnSetIndicatorUnit> indicatortList = new ArrayList<ColumnSetIndicatorUnit>();
    for (Object indicatorObj : obj) {
        // for SimpleStatIndicator, CountAvgNullIndicator, MinMaxDateIndicator, WeakCorrelationIndicator
        if (indicatorObj instanceof SimpleStatIndicator || indicatorObj instanceof CountAvgNullIndicator || indicatorObj instanceof MinMaxDateIndicator || indicatorObj instanceof WeakCorrelationIndicator) {
            columnSetIndicator = (ColumnSetMultiValueIndicator) indicatorObj;
            for (Indicator indicator : IndicatorHelper.getIndicatorLeavesBySingleNode(columnSetIndicator)) {
                IndicatorEnum indicatorEnum = IndicatorEnum.findIndicatorEnum(indicator.eClass());
                indicatortList.add(new ColumnSetIndicatorUnit(indicatorEnum, indicator));
            }
        // MOD msjian TDQ-8860: we always show the allMatchIndicator in the Indicators section
        } else if (indicatorObj instanceof AllMatchIndicator) {
            // for AllMatchIndicator
            AllMatchIndicator allMatchIndicator = (AllMatchIndicator) indicatorObj;
            indicatortList.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
        // TDQ-8860~
        }
    // ~
    }
    setElements(indicatortList.toArray(new ColumnSetIndicatorUnit[indicatortList.size()]));
}
Also used : WeakCorrelationIndicator(org.talend.dataquality.indicators.columnset.WeakCorrelationIndicator) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) AllMatchIndicator(org.talend.dataquality.indicators.columnset.AllMatchIndicator) ArrayList(java.util.ArrayList) MinMaxDateIndicator(org.talend.dataquality.indicators.columnset.MinMaxDateIndicator) SimpleStatIndicator(org.talend.dataquality.indicators.columnset.SimpleStatIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) ColumnSetMultiValueIndicator(org.talend.dataquality.indicators.columnset.ColumnSetMultiValueIndicator) MinMaxDateIndicator(org.talend.dataquality.indicators.columnset.MinMaxDateIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) Indicator(org.talend.dataquality.indicators.Indicator) WeakCorrelationIndicator(org.talend.dataquality.indicators.columnset.WeakCorrelationIndicator) AllMatchIndicator(org.talend.dataquality.indicators.columnset.AllMatchIndicator) SimpleStatIndicator(org.talend.dataquality.indicators.columnset.SimpleStatIndicator) ColumnSetIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)

Aggregations

CountAvgNullIndicator (org.talend.dataquality.indicators.columnset.CountAvgNullIndicator)3 ArrayList (java.util.ArrayList)2 Indicator (org.talend.dataquality.indicators.Indicator)2 ColumnSetMultiValueIndicator (org.talend.dataquality.indicators.columnset.ColumnSetMultiValueIndicator)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 ExpansionAdapter (org.eclipse.ui.forms.events.ExpansionAdapter)1 ExpansionEvent (org.eclipse.ui.forms.events.ExpansionEvent)1 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)1 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)1 ColumnSetIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)1 HideSeriesChartComposite (org.talend.dataprofiler.core.ui.editor.preview.HideSeriesChartComposite)1 CompositeIndicator (org.talend.dataquality.indicators.CompositeIndicator)1 AllMatchIndicator (org.talend.dataquality.indicators.columnset.AllMatchIndicator)1 MinMaxDateIndicator (org.talend.dataquality.indicators.columnset.MinMaxDateIndicator)1