Search in sources :

Example 1 with ChartMakerDialog

use of org.eclipse.tracecompass.internal.provisional.tmf.chart.ui.dialog.ChartMakerDialog in project tracecompass by tracecompass.

the class LamiReportViewTabPage method createNewCustomChart.

// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
/**
 * This method is used for creating a chart from the result table of the
 * analyse. It uses the custom charts plugin to configure and create the
 * chart.
 */
public void createNewCustomChart() {
    Shell shell = this.getControl().getShell();
    if (shell == null) {
        return;
    }
    /* Open the chart maker dialog */
    ChartMakerDialog dialog = new ChartMakerDialog(shell, fResultTable);
    if (dialog.open() != Window.OK) {
        return;
    }
    /* Make sure the data for making a chart was generated */
    ChartData data = dialog.getDataSeries();
    ChartModel model = dialog.getChartModel();
    if (data == null || model == null) {
        return;
    }
    /* Make a chart with the factory constructor */
    LamiViewerControl viewerControl = new LamiViewerControl(fControl, data, model);
    fCustomGraphViewerControls.add(viewerControl);
    viewerControl.getToggleAction().run();
    /* Signal the current selection to the newly created graph */
    ChartSelectionUpdateSignal signal = new ChartSelectionUpdateSignal(LamiReportViewTabPage.this, fResultTable, fSelection);
    TmfSignalManager.dispatchSignal(signal);
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ChartData(org.eclipse.tracecompass.internal.provisional.tmf.chart.core.chart.ChartData) ChartSelectionUpdateSignal(org.eclipse.tracecompass.internal.provisional.tmf.chart.core.signal.ChartSelectionUpdateSignal) ChartModel(org.eclipse.tracecompass.internal.provisional.tmf.chart.core.chart.ChartModel) ChartMakerDialog(org.eclipse.tracecompass.internal.provisional.tmf.chart.ui.dialog.ChartMakerDialog)

Aggregations

Shell (org.eclipse.swt.widgets.Shell)1 ChartData (org.eclipse.tracecompass.internal.provisional.tmf.chart.core.chart.ChartData)1 ChartModel (org.eclipse.tracecompass.internal.provisional.tmf.chart.core.chart.ChartModel)1 ChartSelectionUpdateSignal (org.eclipse.tracecompass.internal.provisional.tmf.chart.core.signal.ChartSelectionUpdateSignal)1 ChartMakerDialog (org.eclipse.tracecompass.internal.provisional.tmf.chart.ui.dialog.ChartMakerDialog)1