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;
}
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;
}
Aggregations