use of jkind.api.ui.counterexample.CategoryHeader in project AGREE by loonwerks.
the class AgreeCounterexampleContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
Counterexample cex = (Counterexample) inputElement;
List<Object> result = new ArrayList<>();
boolean first = true;
for (String category : layout.getCategories()) {
List<Signal<Value>> signals = cex.getCategorySignals(layout, category);
if (!signals.isEmpty()) {
if (first) {
first = false;
} else {
result.add(new Spacer());
}
result.add(new CategoryHeader(category));
List<Signal<Value>> inputSignals = signals.stream().filter(it -> {
EObject ref = refMap.get(it.getName());
return (ref instanceof org.osate.aadl2.Port) && ((org.osate.aadl2.Port) ref).isIn();
}).collect(Collectors.toList());
List<Signal<Value>> outputSignals = signals.stream().filter(it -> {
EObject ref = refMap.get(it.getName());
return (ref instanceof org.osate.aadl2.Port) && ((org.osate.aadl2.Port) ref).isOut();
}).collect(Collectors.toList());
List<Signal<Value>> otherSignals = signals.stream().filter(it -> !(inputSignals.contains(it) || outputSignals.contains(it))).collect(Collectors.toList());
result.addAll(SignalGrouper.group(null, Stream.of(inputSignals, otherSignals, outputSignals).flatMap(Collection::stream).collect(Collectors.toList())));
}
}
return result.toArray();
}
Aggregations