use of org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfFilteredXYChartViewer in project tracecompass by tracecompass.
the class TmfChartView method coupleSelectViewer.
/**
* Method to couple {@link AbstractSelectTreeViewer2} and
* {@link TmfFilteredXYChartViewer} so that they use the same legend and that
* the chart listens to selected items in the tree
*/
private void coupleSelectViewer() {
TmfViewer tree = getLeftChildViewer();
TmfXYChartViewer chart = getChartViewer();
if (tree instanceof AbstractSelectTreeViewer2 && chart instanceof TmfFilteredXYChartViewer) {
ILegendImageProvider2 legendImageProvider = new XYChartLegendImageProvider((TmfCommonXAxisChartViewer) chart);
AbstractSelectTreeViewer2 selectTree = (AbstractSelectTreeViewer2) tree;
selectTree.addTreeListener((TmfFilteredXYChartViewer) chart);
selectTree.setLegendImageProvider(legendImageProvider);
TriStateFilteredCheckboxTree checkboxTree = selectTree.getTriStateFilteredCheckboxTree();
checkboxTree.addPreCheckStateListener(new ManyEntriesSelectedDialogPreCheckedListener(checkboxTree));
}
}
use of org.eclipse.tracecompass.tmf.ui.viewers.xychart.linechart.TmfFilteredXYChartViewer in project tracecompass by tracecompass.
the class MemoryUsageView2 method createChartViewer.
@Override
protected TmfXYChartViewer createChartViewer(Composite parent) {
TmfFilteredXYChartViewer viewer = new TmfFilteredXYChartViewer(parent, fSettings, fProviderId) {
@Override
@NonNull
public OutputElementStyle getSeriesStyle(Long seriesId) {
return getPresentationProvider().getSeriesStyle(seriesId);
}
@Override
protected BaseXYPresentationProvider createPresentationProvider(ITmfTrace trace) {
return MemoryPresentationProvider.getForTrace(trace);
}
};
viewer.getSwtChart().getAxisSet().getYAxis(0).getTick().setFormat(DataSizeWithUnitFormat.getInstance());
return viewer;
}
Aggregations