Color lineColor = new Color(Display.getDefault(), lineColors[i]);
((ILineSeries) series[i]).setLineColor(lineColor);
final String lineColorKey = SERIES_LINE_COLOR
+ series[i].getId();
if (resources.getColor(lineColorKey) == null) {
series[i].addDisposeListener(new IDisposeListener() {
public void disposed(Event e) {
resources.removeColor(lineColorKey);
}
});
}
resources.put(lineColorKey, lineColor);
Color symbolColor = new Color(Display.getDefault(),
symbolColors[i]);
((ILineSeries) series[i]).setSymbolColor(symbolColor);
final String symbolColorKey = SERIES_SYMBOL_COLOR
+ series[i].getId();
if (resources.getColor(symbolColorKey) == null) {
series[i].addDisposeListener(new IDisposeListener() {
public void disposed(Event e) {
resources.removeColor(symbolColorKey);
}
});
}
resources.put(symbolColorKey, symbolColor);
((ILineSeries) series[i]).setLineStyle(lineStyles[i]);
((ILineSeries) series[i]).setSymbolType(symbolTypes[i]);
((ILineSeries) series[i]).setSymbolSize(symbolSizes[i]);
} else if (series[i] instanceof IBarSeries) {
Color barColor = new Color(Display.getDefault(), barColors[i]);
((IBarSeries) series[i]).setBarColor(barColor);
final String barColorKey = SERIES_BAR_COLOR + series[i].getId();
if (resources.getColor(barColorKey) == null) {
series[i].addDisposeListener(new IDisposeListener() {
public void disposed(Event e) {
resources.removeColor(barColorKey);
}
});
}