use of org.eclipse.tracecompass.tmf.ui.viewers.xychart.TmfXYChartViewer in project tracecompass by tracecompass.
the class TmfChartView method loadTrace.
/**
* Load the trace into view.
*/
protected void loadTrace() {
// Initialize the tree viewer with the currently selected trace
ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
if (trace != null) {
TmfTraceSelectedSignal signal = new TmfTraceSelectedSignal(this, trace);
TmfViewer leftViewer = getLeftChildViewer();
if (leftViewer instanceof TmfTimeViewer) {
((TmfTimeViewer) leftViewer).traceSelected(signal);
}
TmfXYChartViewer chartViewer = getChartViewer();
if (chartViewer != null) {
chartViewer.traceSelected(signal);
}
}
}
use of org.eclipse.tracecompass.tmf.ui.viewers.xychart.TmfXYChartViewer in project tracecompass by tracecompass.
the class CounterView method getCumulativeAction.
private Action getCumulativeAction() {
Action action = new Action(Messages.CounterView_CumulativeAction_Text, IAction.AS_CHECK_BOX) {
@Override
public void run() {
boolean isCumulative = isChecked();
setToolTipText(isCumulative ? Messages.CounterView_CumulativeAction_DifferentialTooltipText : Messages.CounterView_CumulativeAction_CumulativeTooltipText);
TmfXYChartViewer chart = getChartViewer();
if (chart instanceof CounterChartViewer) {
((CounterChartViewer) chart).toggleCumulative();
}
}
};
action.setToolTipText(Messages.CounterView_CumulativeAction_CumulativeTooltipText);
// $NON-NLS-1$ //$NON-NLS-2$
action.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.tracecompass.tmf.ui", "icons/elcl16/sigma.gif"));
return action;
}
use of org.eclipse.tracecompass.tmf.ui.viewers.xychart.TmfXYChartViewer in project tracecompass by tracecompass.
the class CpuUsageView method cpuSelect.
/**
* Signal handler for when a cpu is selected
*
* @param signal
* the cpu being selected
* @since 2.0
*/
@TmfSignalHandler
public void cpuSelect(TmfCpuSelectedSignal signal) {
ITmfTrace trace = signal.getTrace();
TmfXYChartViewer xyViewer = getChartViewer();
TmfViewer viewer = getLeftChildViewer();
if (xyViewer instanceof CpuUsageXYViewer && viewer instanceof CpuUsageTreeViewer) {
Set<Integer> data = (Set<Integer>) getData(trace, CPU_USAGE_FOLLOW_CPU);
if (data == null) {
data = new TreeSet<>();
saveData(trace, CPU_USAGE_FOLLOW_CPU, data);
}
int core = signal.getCore();
if (core >= 0) {
data.add(core);
} else {
data.clear();
}
xyViewer.refresh();
((CpuUsageXYViewer) xyViewer).setTitle();
CpuUsageTreeViewer treeViewer = (CpuUsageTreeViewer) viewer;
treeViewer.updateContent(treeViewer.getWindowStartTime(), treeViewer.getWindowEndTime(), false);
}
}
use of org.eclipse.tracecompass.tmf.ui.viewers.xychart.TmfXYChartViewer in project tracecompass by tracecompass.
the class PatternScatterChartViewTest method getChartViewer.
private TmfXYChartViewer getChartViewer() {
SWTBotView viewBot = fBot.viewById(VIEW_ID);
PatternScatterGraphView viewPart = (PatternScatterGraphView) viewBot.getViewReference().getView(true);
TmfXYChartViewer chartViewer = viewPart.getChartViewer();
fScatterChart = chartViewer.getSwtChart();
return chartViewer;
}
Aggregations