Search in sources :

Example 1 with StateSystemEntryModel

use of org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.StateSystemEntryModel in project tracecompass by tracecompass.

the class StateSystemPresentationProvider method getStateTableIndex.

@Override
public int getStateTableIndex(ITimeEvent event) {
    if (event instanceof TimeEvent) {
        TimeEvent timeEvent = (TimeEvent) event;
        Object value = timeEvent.getLabel();
        if (value != null) {
            return Math.floorMod(value.hashCode(), NUM_COLORS);
        }
        ITimeGraphEntry entry = event.getEntry();
        if (entry != null) {
            ITmfTreeDataModel model = ((TimeGraphEntry) entry).getEntryModel();
            if (model instanceof StateSystemEntryModel || model instanceof ModuleEntryModel) {
                // tooltip
                return INVISIBLE;
            }
        }
        // grey
        return NUM_COLORS;
    }
    return INVISIBLE;
}
Also used : ITmfTreeDataModel(org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataModel) ModuleEntryModel(org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.ModuleEntryModel) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) StateSystemEntryModel(org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.StateSystemEntryModel) TimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent) ITimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent) TimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)

Example 2 with StateSystemEntryModel

use of org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.StateSystemEntryModel in project tracecompass by tracecompass.

the class StateSystemPresentationProvider method getEventHoverToolTipInfo.

@Override
public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
    Map<String, String> retMap = new LinkedHashMap<>();
    if (event instanceof TimeEvent) {
        ITimeGraphEntry entry = event.getEntry();
        ITmfTreeDataModel model = ((TimeGraphEntry) entry).getEntryModel();
        if (model instanceof StateSystemEntryModel) {
            TimeGraphEntry moduleEntry = (TimeGraphEntry) entry.getParent();
            ModuleEntryModel moduleModel = (ModuleEntryModel) moduleEntry.getEntryModel();
            ITmfAnalysisModuleWithStateSystems module = (moduleModel).getModule();
            if (module instanceof TmfAbstractAnalysisModule) {
                retMap.putAll(((TmfAbstractAnalysisModule) module).getProperties());
            }
        } else if (model instanceof ModuleEntryModel) {
            ITmfAnalysisModuleWithStateSystems module = ((ModuleEntryModel) model).getModule();
            retMap.put(Messages.ModuleHelpText, module.getHelpText());
            retMap.put(Messages.ModuleIsAutomatic, Boolean.toString(module.isAutomatic()));
        }
    }
    return retMap;
}
Also used : ITmfTreeDataModel(org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataModel) ModuleEntryModel(org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.ModuleEntryModel) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) StateSystemEntryModel(org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.StateSystemEntryModel) TimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent) ITimeEvent(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent) TmfAbstractAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule) TimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) LinkedHashMap(java.util.LinkedHashMap) ITmfAnalysisModuleWithStateSystems(org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems)

Aggregations

ModuleEntryModel (org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.ModuleEntryModel)2 StateSystemEntryModel (org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.StateSystemEntryModel)2 ITmfTreeDataModel (org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataModel)2 ITimeEvent (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent)2 ITimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)2 TimeEvent (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent)2 TimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry)2 LinkedHashMap (java.util.LinkedHashMap)1 TmfAbstractAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule)1 ITmfAnalysisModuleWithStateSystems (org.eclipse.tracecompass.tmf.core.statesystem.ITmfAnalysisModuleWithStateSystems)1