use of org.eclipse.swtchart.ISeries in project tracecompass by tracecompass.
the class TmfXYChartViewer method clearContent.
// ------------------------------------------------------------------------
// Helper Methods
// ------------------------------------------------------------------------
/**
* Clears the view content.
*/
protected void clearContent() {
if (!fSwtChart.isDisposed()) {
ISeriesSet set = fSwtChart.getSeriesSet();
ISeries<?>[] series = set.getSeries();
for (int i = 0; i < series.length; i++) {
set.deleteSeries(series[i].getId());
}
for (IAxis axis : fSwtChart.getAxisSet().getAxes()) {
axis.setRange(new Range(0, 1));
}
fSwtChart.redraw();
}
}
use of org.eclipse.swtchart.ISeries in project tracecompass by tracecompass.
the class CallGraphDensityViewTest method getSeries.
private ISeries<Integer> getSeries() {
AbstractSegmentStoreDensityViewer densityViewer = fDensityViewer;
assertNotNull(densityViewer);
ISeries<Integer>[] serieses = densityViewer.getControl().getSeriesSet().getSeries();
assertNotNull(serieses);
assertTrue(serieses.length > 0);
ISeries<Integer> series = serieses[0];
assertNotNull(series);
return series;
}
use of org.eclipse.swtchart.ISeries in project tracecompass by tracecompass.
the class AbstractSegmentStoreDensityViewer method clearContent.
/**
* Clears the view content.
*/
private void clearContent() {
final Chart chart = fChart;
if (!chart.isDisposed()) {
ISeriesSet set = chart.getSeriesSet();
ISeries<?>[] series = set.getSeries();
for (int i = 0; i < series.length; i++) {
set.deleteSeries(series[i].getId());
}
for (IAxis axis : chart.getAxisSet().getAxes()) {
axis.setRange(new Range(0, 1));
}
chart.redraw();
}
}
use of org.eclipse.swtchart.ISeries in project tracecompass by tracecompass.
the class MemoryUsageViewTest method testOpenMemoryUsage.
/**
* Test if Memory Usage is populated
*/
@Test
public void testOpenMemoryUsage() {
SWTBotView viewBot = fBot.viewById(UstMemoryUsageView.ID);
viewBot.setFocus();
// Do some basic validation
Matcher<Chart> matcher = WidgetOfType.widgetOfType(Chart.class);
Chart chart = viewBot.bot().widget(matcher);
checkAllEntries();
// Verify that the chart has 4 series
fBot.waitUntil(ConditionHelpers.numberOfSeries(chart, EXPECTED_NUM_SERIES));
ISeriesSet seriesSet = chart.getSeriesSet();
ISeries<?>[] series = seriesSet.getSeries();
// Verify that each series is a ILineSeries
for (ISeries<?> serie : series) {
assertTrue(serie instanceof ILineSeries);
}
}
use of org.eclipse.swtchart.ISeries in project tracecompass by tracecompass.
the class SwtXYChartViewer method createChartSeries.
/**
* For each series defined for the chart, create the corresponding SWT
* series and add it to the series map
*/
private final void createChartSeries() {
ISeriesSet set = NonNullUtils.checkNotNull(getChart().getSeriesSet());
Iterator<Color> colors = Iterators.cycle(COLORS);
getData().getChartSeries().forEach(series -> {
ISeries swtSeries = createSwtSeries(series, set, colors.next());
fSeriesMap.put(series, swtSeries);
});
}
Aggregations