use of org.talend.dataprofiler.core.ui.chart.jung.JungGraphGenerator in project tdq-studio-se by Talend.
the class CorrelationAnalysisDetailsPage method createPreviewCharts.
public void createPreviewCharts(final ScrolledForm form, final Composite composite, final boolean isCreate) {
List<Composite> previewChartList = new ArrayList<Composite>();
if (ColumnsetPackage.eINSTANCE.getWeakCorrelationIndicator() == columnSetMultiIndicator.eClass()) {
GraphBuilder gBuilder = new GraphBuilder();
gBuilder.setTotalWeight(columnSetMultiIndicator.getCount());
List<Object[]> listRows = columnSetMultiIndicator.getListRows();
// MOD msjian TDQ-4781 2012-6-8: make sure exist data
if (listRows != null && listRows.size() > 0) {
// TDQ-4781~
JungGraphGenerator generator = new JungGraphGenerator(gBuilder, listRows);
// MOD yyi 2009-09-09 feature 8834
generator.generate(composite, false, true);
}
} else {
List<ModelElement> numericOrDateList = new ArrayList<ModelElement>();
if (ColumnsetPackage.eINSTANCE.getCountAvgNullIndicator() == columnSetMultiIndicator.eClass()) {
numericOrDateList = columnSetMultiIndicator.getNumericColumns();
}
if (ColumnsetPackage.eINSTANCE.getMinMaxDateIndicator() == columnSetMultiIndicator.eClass()) {
numericOrDateList = columnSetMultiIndicator.getDateColumns();
}
for (ModelElement column : numericOrDateList) {
final MetadataColumn tdColumn = (MetadataColumn) column;
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(columnSetMultiIndicator);
previewChartList.add(exComp);
final Composite comp = toolkit.createComposite(exComp);
comp.setLayout(new GridLayout());
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(// $NON-NLS-1$
DefaultMessagesImpl.getString(// $NON-NLS-1$
"ColumnMasterDetailsPage.createPreview", tdColumn.getName()), IProgressMonitor.UNKNOWN);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
new HideSeriesChartComposite(comp, getCurrentModelElement(), columnSetMultiIndicator, tdColumn, false);
}
});
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();
form.reflow(true);
}
});
exComp.setExpanded(true);
exComp.setClient(comp);
}
}
if (!previewChartList.isEmpty()) {
this.previewChartCompsites = previewChartList.toArray(new Composite[previewChartList.size()]);
}
}
use of org.talend.dataprofiler.core.ui.chart.jung.JungGraphGenerator in project tdq-studio-se by Talend.
the class CorrelationAnalysisResultPage method createGraphicsSectionPart.
protected Section createGraphicsSectionPart(Composite parentComp) {
Section section = createSection(// $NON-NLS-1$
form, // $NON-NLS-1$
parentComp, // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.graphics"), // $NON-NLS-1$
DefaultMessagesImpl.getString("ColumnMasterDetailsPage.space"));
section.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite sectionClient = toolkit.createComposite(section);
sectionClient.setLayout(new GridLayout());
sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(sectionClient);
chartComposite = toolkit.createComposite(sectionClient);
chartComposite.setLayout(new GridLayout());
if (ColumnsetPackage.eINSTANCE.getWeakCorrelationIndicator() == columnSetMultiIndicator.eClass()) {
GridData gd = new GridData();
gd.widthHint = 900;
gd.heightHint = 450;
chartComposite.setLayoutData(gd);
GraphBuilder gBuilder = new GraphBuilder();
gBuilder.setTotalWeight(columnSetMultiIndicator.getCount());
List<Object[]> listRows = columnSetMultiIndicator.getListRows();
// MOD msjian TDQ-4781 2012-6-8: make sure exist data
if (listRows != null && listRows.size() > 0) {
JungGraphGenerator generator = new JungGraphGenerator(gBuilder, listRows);
// MOD yyi 2009-09-09 feature 8834
generator.generate(chartComposite, false, false);
}
// TDQ-4781~
} else {
createBubbleOrGanttChart(form, chartComposite, columnSetMultiIndicator);
}
section.setClient(sectionClient);
return section;
}
Aggregations