Search in sources :

Example 1 with IOutputElement

use of org.eclipse.tracecompass.tmf.core.model.IOutputElement in project tracecompass by tracecompass.

the class FlameGraphPresentationProvider method getElementStyle.

@Override
@Nullable
public OutputElementStyle getElementStyle(ITimeEvent event) {
    if (event instanceof NullTimeEvent) {
        return null;
    }
    if (event instanceof FlamegraphEvent) {
        IOutputElement model = ((FlamegraphEvent) event).getModel();
        OutputElementStyle eventStyle = model.getStyle();
        if (eventStyle == null) {
            String name = event.getLabel();
            Object key = name == null ? model.getValue() : name;
            eventStyle = FlameDefaultPalette.getStyleFor(key);
        }
        return eventStyle;
    }
    return TRANSPARENT_STYLE;
}
Also used : NullTimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent) OutputElementStyle(org.eclipse.tracecompass.tmf.core.model.OutputElementStyle) IOutputElement(org.eclipse.tracecompass.tmf.core.model.IOutputElement) Nullable(org.eclipse.jdt.annotation.Nullable)

Example 2 with IOutputElement

use of org.eclipse.tracecompass.tmf.core.model.IOutputElement in project tracecompass by tracecompass.

the class BaseDataProviderTimeGraphPresentationProvider method getElementStyle.

@Override
@Nullable
public OutputElementStyle getElementStyle(ITimeEvent event) {
    if (event instanceof NullTimeEvent) {
        return null;
    }
    if (event instanceof TimeEvent) {
        IOutputElement model = ((TimeEvent) event).getModel();
        OutputElementStyle eventStyle = model.getStyle();
        if (eventStyle == null && event.getEntry() instanceof TimeGraphEntry) {
            eventStyle = ((TimeGraphEntry) event.getEntry()).getEntryModel().getStyle();
        }
        if (eventStyle != null) {
            return eventStyle;
        }
    }
    return TRANSPARENT_STYLE;
}
Also used : NullTimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent) OutputElementStyle(org.eclipse.tracecompass.tmf.core.model.OutputElementStyle) NullTimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent) TimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent) ITimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent) IOutputElement(org.eclipse.tracecompass.tmf.core.model.IOutputElement) TimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) Nullable(org.eclipse.jdt.annotation.Nullable)

Aggregations

Nullable (org.eclipse.jdt.annotation.Nullable)2 IOutputElement (org.eclipse.tracecompass.tmf.core.model.IOutputElement)2 OutputElementStyle (org.eclipse.tracecompass.tmf.core.model.OutputElementStyle)2 NullTimeEvent (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.NullTimeEvent)2 ITimeEvent (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent)1 ITimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)1 TimeEvent (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent)1 TimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry)1