Search in sources :

Example 1 with ChartSelectionUpdateSignal

use of org.eclipse.tracecompass.internal.provisional.tmf.chart.core.signal.ChartSelectionUpdateSignal 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)

Example 2 with ChartSelectionUpdateSignal

use of org.eclipse.tracecompass.internal.provisional.tmf.chart.core.signal.ChartSelectionUpdateSignal in project tracecompass by tracecompass.

the class LamiReportViewTabPage method externalUpdateSelectionCustomCharts.

/**
 * Signal handler for a trace selection range update signal. It will try to
 * map the external selection to our lami table entry.
 *
 * @param signal
 *            The received signal
 */
@TmfSignalHandler
public void externalUpdateSelectionCustomCharts(TmfSelectionRangeUpdatedSignal signal) {
    /* Make sure we are not sending a signal to ourself */
    if (signal.getSource() == this) {
        return;
    }
    TmfTimeRange range = new TmfTimeRange(signal.getBeginTime(), signal.getEndTime());
    // Custom chart signal
    /* Find which lami table entry intersects the signal */
    Set<Object> selection = getEntriesIntersectingTimerange(fResultTable, range);
    /* Update all LamiViewer */
    ChartSelectionUpdateSignal updateSignal = new ChartSelectionUpdateSignal(this, fResultTable, selection);
    TmfSignalManager.dispatchSignal(updateSignal);
}
Also used : ChartSelectionUpdateSignal(org.eclipse.tracecompass.internal.provisional.tmf.chart.core.signal.ChartSelectionUpdateSignal) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) TmfSignalHandler(org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)

Aggregations

ChartSelectionUpdateSignal (org.eclipse.tracecompass.internal.provisional.tmf.chart.core.signal.ChartSelectionUpdateSignal)2 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 ChartMakerDialog (org.eclipse.tracecompass.internal.provisional.tmf.chart.ui.dialog.ChartMakerDialog)1 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)1 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)1