use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class ColumnSetAnalysisResultPage method createSimpleTable2.
private void createSimpleTable2(final ScrolledForm form, final Composite composite, final SimpleStatIndicator simpleStatIndicator) {
List<IndicatorUnit> units = new ArrayList<IndicatorUnit>();
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, masterPage.getSimpleStatIndicator().getRowCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, masterPage.getSimpleStatIndicator().getDistinctCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, masterPage.getSimpleStatIndicator().getDuplicateCountIndicator()));
units.add(new ColumnSetIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, masterPage.getSimpleStatIndicator().getUniqueCountIndicator()));
EIndicatorChartType simpleStatType = EIndicatorChartType.SIMPLE_STATISTICS;
// create table firstly
ITableTypeStates tableTypeState = TableTypeStatesFactory.getInstance().getTableState(simpleStatType, units);
TableWithData chartData = new TableWithData(simpleStatType, tableTypeState.getDataEntity());
TableViewer tableviewer = tableTypeState.getTableForm(composite);
tableviewer.setInput(chartData);
// MOD qiongli feature 19192.
DataExplorer dataExplorer = tableTypeState.getDataExplorer();
Analysis analysis = this.getAnalysisHandler().getAnalysis();
ChartTableFactory.addMenuAndTip(tableviewer, dataExplorer, analysis);
// create chart
if (canShowChartForResultPage()) {
IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(simpleStatType, units);
Object chart = chartTypeState.getChart();
TOPChartUtils.getInstance().decorateChart(chart, false);
if (chart != null) {
Object chartComposite2 = TOPChartUtils.getInstance().createChartComposite(composite, SWT.NONE, chart, true);
addMenuToChartComp(chartComposite2, dataExplorer, analysis, ((ICustomerDataset) chartTypeState.getDataset()).getDataEntities());
}
}
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class CorrelationAnalysisDetailsPage method createPreviewSection.
void createPreviewSection(final ScrolledForm form, Composite parent) {
previewSection = createSection(form, parent, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.graphics"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(previewSection);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
Button chartButton = new Button(sectionClient, SWT.NONE);
// $NON-NLS-1$
chartButton.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.refreshGraphics"));
final Label message = toolkit.createLabel(sectionClient, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.spaceWhite"));
message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
message.setVisible(false);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
chartComposite = toolkit.createComposite(sectionClient);
chartComposite.setLayout(new GridLayout());
chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
final Analysis analysis = correlationAnalysisHandler.getAnalysis();
chartButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (Control control : chartComposite.getChildren()) {
control.dispose();
}
boolean analysisStatue = analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
if (!analysisStatue) {
boolean returnCode = MessageDialog.openConfirm(null, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.ViewResult"), // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.RunOrSeeSampleData"));
if (returnCode) {
new RunAnalysisAction().run();
message.setVisible(false);
} else {
createPreviewCharts(form, chartComposite, false);
// $NON-NLS-1$
message.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.warning"));
message.setVisible(true);
}
} else {
createPreviewCharts(form, chartComposite, true);
}
chartComposite.layout();
form.reflow(true);
}
});
previewSection.setClient(sectionClient);
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class DynamicAnalysisMasterPage method createPreviewSection.
void createPreviewSection(final ScrolledForm form1, Composite parent) {
previewSection = createSection(form1, parent, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.graphics"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
previewSection.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(previewSection);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite actionBarComp = toolkit.createComposite(sectionClient);
GridLayout gdLayout = new GridLayout();
gdLayout.numColumns = 3;
actionBarComp.setLayout(gdLayout);
createCollapseAllLink(actionBarComp);
createExpandAllLink(actionBarComp);
Button chartButton = new Button(actionBarComp, SWT.NONE);
// $NON-NLS-1$
chartButton.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.refreshGraphics"));
final Label message = toolkit.createLabel(sectionClient, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.spaceWhite"));
message.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
message.setVisible(false);
chartButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
disposeChartComposite();
Analysis analysis = getAnalysisHandler().getAnalysis();
boolean analysisStatue = analysis.getResults().getResultMetadata() != null && analysis.getResults().getResultMetadata().getExecutionDate() != null;
if (!analysisStatue) {
boolean returnCode = MessageDialog.openConfirm(null, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.ViewResult"), // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.RunOrSeeSampleData"));
if (returnCode) {
new RunAnalysisAction().run();
message.setVisible(false);
} else {
createPreviewCharts(form1, chartComposite);
// $NON-NLS-1$
message.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.warning"));
message.setVisible(true);
}
} else {
createPreviewCharts(form1, chartComposite);
}
reLayoutChartComposite();
}
});
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
chartComposite = toolkit.createComposite(sectionClient);
chartComposite.setLayout(new GridLayout());
chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
previewSection.setClient(sectionClient);
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class FunctionalDependencyAnalysisResultPage method initCustomerDataset.
/**
* DOC xqliu Comment method "initCustomerDataset".
*
* @return
*/
private CustomerDefaultCategoryDataset initCustomerDataset() {
CustomerDefaultCategoryDataset dataset = new CustomerDefaultCategoryDataset();
Analysis analysis = this.getAnalysisHandler().getAnalysis();
for (Indicator indicator2 : analysis.getResults().getIndicators()) {
ColumnDependencyIndicator indicator = (ColumnDependencyIndicator) indicator2;
String label = ColumnDependencyHelper.getIndicatorName(indicator);
if (getAnalysisHandler().getResultMetadata().getExecutionNumber() > 0) {
Long matchCount = indicator.getDistinctACount() == null ? 0 : indicator.getDistinctACount();
Long notMatchCount = indicator.getACount() == null ? 0 : indicator.getACount() - matchCount;
// $NON-NLS-1$
dataset.addValue(matchCount, DefaultMessagesImpl.getString("ColumnDependencyResultPage.Match"), label);
// $NON-NLS-1$
dataset.addValue(notMatchCount, DefaultMessagesImpl.getString("ColumnDependencyResultPage.NotMatch"), label);
PatternChartDataEntity dataEntity = new PatternChartDataEntity();
dataEntity.setLabel(label);
dataEntity.setIndicator(indicator);
dataEntity.setNumMatch(matchCount.toString());
dataEntity.setNumNoMatch(notMatchCount.toString());
dataset.addDataEntity(dataEntity);
}
}
return dataset;
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class RedundancyAnalysisResultPage method createAnalyzedColumnSetsSection.
private void createAnalyzedColumnSetsSection(Composite parent) {
columnSetSection = createSection(form, parent, DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.analyzedColumnSets"), // $NON-NLS-1$
null);
Composite sectionClient = toolkit.createComposite(columnSetSection);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
TableViewer elementsTableViewer = new TableViewer(sectionClient, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Table table = elementsTableViewer.getTable();
GridDataFactory.fillDefaults().applyTo(table);
((GridData) table.getLayoutData()).heightHint = 240;
((GridData) table.getLayoutData()).widthHint = 600;
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setDragDetect(true);
// $NON-NLS-1$
table.setToolTipText(DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.dragAndDropToolTip"));
final TableColumn columnHeader1 = new TableColumn(table, SWT.LEAD);
columnHeader1.setWidth(300);
final TableColumn columnHeader2 = new TableColumn(table, SWT.LEAD);
columnHeader2.setWidth(300);
Analysis analysis = this.masterPage.getAnalysisHandler().getAnalysis();
isHasDeactivatedIndicator = analysis.getParameters().getDeactivatedIndicators().size() != 0;
EList<Indicator> indicators = analysis.getResults().getIndicators();
if (indicators.size() != 0) {
rowMatchingIndicatorA = (RowMatchingIndicator) indicators.get(0);
rowMatchingIndicatorB = (RowMatchingIndicator) indicators.get(1);
TdColumn columnA = null;
if (rowMatchingIndicatorA.getColumnSetA().size() > 0) {
columnA = rowMatchingIndicatorA.getColumnSetA().get(0);
if (columnA.eIsProxy()) {
columnA = (TdColumn) EObjectHelper.resolveObject(columnA);
}
}
String columnName = rowMatchingIndicatorA.getColumnSetA().size() > 0 ? ColumnHelper.getColumnOwnerAsColumnSet(columnA).getName() : PluginConstant.EMPTY_STRING;
columnHeader1.setText(columnName.equals(PluginConstant.EMPTY_STRING) ? columnName : DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.elementsFrom", // $NON-NLS-1$
columnName));
TdColumn columnB = null;
if (rowMatchingIndicatorA.getColumnSetB().size() > 0) {
columnB = rowMatchingIndicatorA.getColumnSetB().get(0);
if (columnB.eIsProxy()) {
columnB = (TdColumn) EObjectHelper.resolveObject(columnB);
}
}
columnName = rowMatchingIndicatorA.getColumnSetA().size() > 0 ? ColumnHelper.getColumnOwnerAsColumnSet(columnB).getName() : PluginConstant.EMPTY_STRING;
columnHeader2.setText(columnName.equals(PluginConstant.EMPTY_STRING) ? columnName : DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.elementsFrom", // $NON-NLS-1$
columnName));
}
ColumnPairsViewerProvider provider = new ColumnPairsViewerProvider();
elementsTableViewer.setContentProvider(provider);
elementsTableViewer.setLabelProvider(provider);
elementsTableViewer.setInput(rowMatchingIndicatorA);
columnSetSection.setClient(sectionClient);
}
Aggregations