use of org.eclipse.tracecompass.internal.provisional.tmf.ui.widgets.timegraph.ITimeGraphStylePresentationProvider in project tracecompass by tracecompass.
the class TimeGraphControl method getElementStyle.
@Nullable
private OutputElementStyle getElementStyle(@NonNull ITimeEvent event) {
OutputElementStyle elementStyle;
if (fTimeGraphProvider instanceof ITimeGraphStylePresentationProvider) {
ITimeGraphStylePresentationProvider provider = (ITimeGraphStylePresentationProvider) fTimeGraphProvider;
elementStyle = provider.getElementStyle(event);
if (elementStyle == null) {
return null;
}
if (elementStyle.getParentKey() == null && elementStyle.getStyleValues().isEmpty()) {
return elementStyle;
}
return new OutputElementStyle(elementStyle.getParentKey(), applyEventStyleProperties(new HashMap<>(elementStyle.getStyleValues()), event));
}
if (!(event instanceof MarkerEvent)) {
int colorIdx = fTimeGraphProvider.getStateTableIndex(event);
if (colorIdx == ITimeGraphPresentationProvider.INVISIBLE) {
return null;
}
if (colorIdx == ITimeGraphPresentationProvider.TRANSPARENT) {
return new OutputElementStyle(null, new HashMap<>());
}
}
Map<@NonNull String, @NonNull Object> styleMap = StylePropertiesUtils.updateEventStyleProperties(fTimeGraphProvider.getEventStyle(event));
return new OutputElementStyle(null, applyEventStyleProperties(styleMap, event));
}
Aggregations