use of org.talend.dataprofiler.core.ui.editor.preview.HideSeriesChartComposite 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()]);
}
}
use of org.talend.dataprofiler.core.ui.editor.preview.HideSeriesChartComposite 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()]);
}
}
Aggregations