use of org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.ModuleEntryModel 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.ModuleEntryModel 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;
}
use of org.eclipse.tracecompass.internal.tmf.core.statesystem.provider.StateSystemDataProvider.ModuleEntryModel in project tracecompass by tracecompass.
the class TmfStateSystemExplorer method createPartControl.
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
getTimeGraphViewer().addTimeListener(event -> synchingToTime(event.getBeginTime()));
getTimeGraphViewer().getTimeGraphControl().addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent event) {
ITimeGraphEntry selection = getTimeGraphViewer().getSelection();
if (selection instanceof TimeGraphEntry) {
ITmfTreeDataModel model = ((TimeGraphEntry) selection).getEntryModel();
if (model instanceof ModuleEntryModel && selection.getChildren().isEmpty()) {
/**
* Schedule the analysis if it has not run yet.
*/
ITmfAnalysisModuleWithStateSystems module = ((ModuleEntryModel) model).getModule();
module.schedule();
}
TimeGraphControl control = getTimeGraphViewer().getTimeGraphControl();
boolean expandedState = control.getExpandedState(selection);
control.setExpandedState(selection, !expandedState);
}
}
});
}
Aggregations