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);
}
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);
}
Aggregations